ESPHome  2024.11.3
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::bme68x_bsec2::BME68xBSEC2Component Class Referenceabstract

#include <bme68x_bsec2.h>

Inheritance diagram for esphome::bme68x_bsec2::BME68xBSEC2Component:
esphome::Component esphome::bme68x_bsec2_i2c::BME68xBSEC2I2CComponent

Public Member Functions

void setup () override
 
void dump_config () override
 
float get_setup_priority () const override
 
void loop () override
 
void set_algorithm_output (AlgorithmOutput algorithm_output)
 
void set_operating_age (OperatingAge operating_age)
 
void set_temperature_offset (float offset)
 
void set_voltage (Voltage voltage)
 
void set_sample_rate (SampleRate sample_rate)
 
void set_temperature_sample_rate (SampleRate sample_rate)
 
void set_pressure_sample_rate (SampleRate sample_rate)
 
void set_humidity_sample_rate (SampleRate sample_rate)
 
void set_bsec2_configuration (const uint8_t *data, const uint32_t len)
 
void set_state_save_interval (uint32_t interval)
 
void set_temperature_sensor (sensor::Sensor *sensor)
 
void set_pressure_sensor (sensor::Sensor *sensor)
 
void set_humidity_sensor (sensor::Sensor *sensor)
 
void set_gas_resistance_sensor (sensor::Sensor *sensor)
 
void set_iaq_sensor (sensor::Sensor *sensor)
 
void set_iaq_static_sensor (sensor::Sensor *sensor)
 
void set_iaq_accuracy_sensor (sensor::Sensor *sensor)
 
void set_co2_equivalent_sensor (sensor::Sensor *sensor)
 
void set_breath_voc_equivalent_sensor (sensor::Sensor *sensor)
 
void set_iaq_accuracy_text_sensor (text_sensor::TextSensor *sensor)
 
virtual uint32_t get_hash ()=0
 
- Public Member Functions inherited from esphome::Component
float get_actual_setup_priority () const
 
void set_setup_priority (float priority)
 
virtual float get_loop_priority () const
 priority of loop(). More...
 
void call ()
 
virtual void on_shutdown ()
 
virtual void on_safe_shutdown ()
 
uint32_t get_component_state () const
 
virtual void mark_failed ()
 Mark this component as failed. More...
 
bool is_failed () const
 
bool is_ready () const
 
virtual bool can_proceed ()
 
bool status_has_warning () const
 
bool status_has_error () const
 
void status_set_warning (const char *message="unspecified")
 
void status_set_error (const char *message="unspecified")
 
void status_clear_warning ()
 
void status_clear_error ()
 
void status_momentary_warning (const std::string &name, uint32_t length=5000)
 
void status_momentary_error (const std::string &name, uint32_t length=5000)
 
bool has_overridden_loop () const
 
void set_component_source (const char *source)
 Set where this component was loaded from for some debug messages. More...
 
const char * get_component_source () const
 Get the integration where this component was declared as a string. More...
 

Protected Member Functions

void set_config_ (const uint8_t *config, u_int32_t len)
 
float calc_sensor_sample_rate_ (SampleRate sample_rate)
 
void update_subscription_ ()
 
void run_ ()
 
void read_ (int64_t trigger_time_ns)
 
void publish_ (const bsec_output_t *outputs, uint8_t num_outputs)
 
int64_t get_time_ns_ ()
 
void publish_sensor_ (sensor::Sensor *sensor, float value, bool change_only=false)
 
void publish_sensor_ (text_sensor::TextSensor *sensor, const std::string &value)
 
void load_state_ ()
 
void save_state_ (uint8_t accuracy)
 
void queue_push_ (std::function< void()> &&f)
 
- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
 
virtual void call_setup ()
 
virtual void call_dump_config ()
 
void set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a unique name. More...
 
void set_interval (uint32_t interval, std::function< void()> &&f)
 
bool cancel_interval (const std::string &name)
 Cancel an interval function. More...
 
void set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f)
 Set an retry function with a unique name. More...
 
void set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f)
 
bool cancel_retry (const std::string &name)
 Cancel a retry function. More...
 
void set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a unique name. More...
 
void set_timeout (uint32_t timeout, std::function< void()> &&f)
 
bool cancel_timeout (const std::string &name)
 Cancel a timeout function. More...
 
void defer (const std::string &name, std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
void defer (std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
bool cancel_defer (const std::string &name)
 Cancel a defer callback using the specified name, name must not be empty. More...
 

Protected Attributes

struct bme68x_dev bme68x_
 
bsec_bme_settings_t bsec_settings_
 
bsec_version_t version_
 
uint8_t bsec_instance_ [BSEC_INSTANCE_SIZE]
 
struct bme68x_heatr_conf bme68x_heatr_conf_
 
uint8_t op_mode_
 
bsec_library_return_t bsec_status_ {BSEC_OK}
 
int8_t bme68x_status_ {BME68X_OK}
 
int64_t last_time_ms_ {0}
 
uint32_t millis_overflow_counter_ {0}
 
std::queue< std::function< void()> > queue_
 
uint8_t const * bsec2_configuration_ {nullptr}
 
uint32_t bsec2_configuration_length_ {0}
 
bool bsec2_blob_configured_ {false}
 
ESPPreferenceObject bsec_state_
 
uint32_t state_save_interval_ms_ {21600000}
 
uint32_t last_state_save_ms_ = 0
 
float temperature_offset_ {0}
 
AlgorithmOutput algorithm_output_ {ALGORITHM_OUTPUT_IAQ}
 
OperatingAge operating_age_ {OPERATING_AGE_28D}
 
Voltage voltage_ {VOLTAGE_3_3V}
 
SampleRate sample_rate_ {SAMPLE_RATE_LP}
 
SampleRate temperature_sample_rate_ {SAMPLE_RATE_DEFAULT}
 
SampleRate pressure_sample_rate_ {SAMPLE_RATE_DEFAULT}
 
SampleRate humidity_sample_rate_ {SAMPLE_RATE_DEFAULT}
 
sensor::Sensortemperature_sensor_ {nullptr}
 
sensor::Sensorpressure_sensor_ {nullptr}
 
sensor::Sensorhumidity_sensor_ {nullptr}
 
sensor::Sensorgas_resistance_sensor_ {nullptr}
 
sensor::Sensoriaq_sensor_ {nullptr}
 
sensor::Sensoriaq_static_sensor_ {nullptr}
 
sensor::Sensoriaq_accuracy_sensor_ {nullptr}
 
sensor::Sensorco2_equivalent_sensor_ {nullptr}
 
sensor::Sensorbreath_voc_equivalent_sensor_ {nullptr}
 
text_sensor::TextSensoriaq_accuracy_text_sensor_ {nullptr}
 
- Protected Attributes inherited from esphome::Component
uint32_t component_state_ {0x0000}
 State of this component. More...
 
float setup_priority_override_ {NAN}
 
const char * component_source_ {nullptr}
 

Detailed Description

Definition at line 47 of file bme68x_bsec2.h.

Member Function Documentation

◆ calc_sensor_sample_rate_()

float esphome::bme68x_bsec2::BME68xBSEC2Component::calc_sensor_sample_rate_ ( SampleRate  sample_rate)
protected

Definition at line 141 of file bme68x_bsec2.cpp.

◆ dump_config()

void esphome::bme68x_bsec2::BME68xBSEC2Component::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 59 of file bme68x_bsec2.cpp.

◆ get_hash()

virtual uint32_t esphome::bme68x_bsec2::BME68xBSEC2Component::get_hash ( )
pure virtual

◆ get_setup_priority()

float esphome::bme68x_bsec2::BME68xBSEC2Component::get_setup_priority ( ) const
overridevirtual

Reimplemented from esphome::Component.

Definition at line 104 of file bme68x_bsec2.cpp.

◆ get_time_ns_()

int64_t esphome::bme68x_bsec2::BME68xBSEC2Component::get_time_ns_ ( )
protected

Definition at line 452 of file bme68x_bsec2.cpp.

◆ load_state_()

void esphome::bme68x_bsec2::BME68xBSEC2Component::load_state_ ( )
protected

Definition at line 480 of file bme68x_bsec2.cpp.

◆ loop()

void esphome::bme68x_bsec2::BME68xBSEC2Component::loop ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 106 of file bme68x_bsec2.cpp.

◆ publish_()

void esphome::bme68x_bsec2::BME68xBSEC2Component::publish_ ( const bsec_output_t *  outputs,
uint8_t  num_outputs 
)
protected

Definition at line 384 of file bme68x_bsec2.cpp.

◆ publish_sensor_() [1/2]

void esphome::bme68x_bsec2::BME68xBSEC2Component::publish_sensor_ ( sensor::Sensor sensor,
float  value,
bool  change_only = false 
)
protected

Definition at line 463 of file bme68x_bsec2.cpp.

◆ publish_sensor_() [2/2]

void esphome::bme68x_bsec2::BME68xBSEC2Component::publish_sensor_ ( text_sensor::TextSensor sensor,
const std::string &  value 
)
protected

Definition at line 472 of file bme68x_bsec2.cpp.

◆ queue_push_()

void esphome::bme68x_bsec2::BME68xBSEC2Component::queue_push_ ( std::function< void()> &&  f)
inlineprotected

Definition at line 107 of file bme68x_bsec2.h.

◆ read_()

void esphome::bme68x_bsec2::BME68xBSEC2Component::read_ ( int64_t  trigger_time_ns)
protected

Definition at line 286 of file bme68x_bsec2.cpp.

◆ run_()

void esphome::bme68x_bsec2::BME68xBSEC2Component::run_ ( )
protected

Definition at line 206 of file bme68x_bsec2.cpp.

◆ save_state_()

void esphome::bme68x_bsec2::BME68xBSEC2Component::save_state_ ( uint8_t  accuracy)
protected

Definition at line 497 of file bme68x_bsec2.cpp.

◆ set_algorithm_output()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_algorithm_output ( AlgorithmOutput  algorithm_output)
inline

Definition at line 54 of file bme68x_bsec2.h.

◆ set_breath_voc_equivalent_sensor()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_breath_voc_equivalent_sensor ( sensor::Sensor sensor)
inline

Definition at line 80 of file bme68x_bsec2.h.

◆ set_bsec2_configuration()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_bsec2_configuration ( const uint8_t *  data,
const uint32_t  len 
)
inline

Definition at line 64 of file bme68x_bsec2.h.

◆ set_co2_equivalent_sensor()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_co2_equivalent_sensor ( sensor::Sensor sensor)
inline

Definition at line 79 of file bme68x_bsec2.h.

◆ set_config_()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_config_ ( const uint8_t *  config,
u_int32_t  len 
)
protected

Definition at line 128 of file bme68x_bsec2.cpp.

◆ set_gas_resistance_sensor()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_gas_resistance_sensor ( sensor::Sensor sensor)
inline

Definition at line 75 of file bme68x_bsec2.h.

◆ set_humidity_sample_rate()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_humidity_sample_rate ( SampleRate  sample_rate)
inline

Definition at line 62 of file bme68x_bsec2.h.

◆ set_humidity_sensor()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_humidity_sensor ( sensor::Sensor sensor)
inline

Definition at line 74 of file bme68x_bsec2.h.

◆ set_iaq_accuracy_sensor()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_iaq_accuracy_sensor ( sensor::Sensor sensor)
inline

Definition at line 78 of file bme68x_bsec2.h.

◆ set_iaq_accuracy_text_sensor()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_iaq_accuracy_text_sensor ( text_sensor::TextSensor sensor)
inline

Definition at line 83 of file bme68x_bsec2.h.

◆ set_iaq_sensor()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_iaq_sensor ( sensor::Sensor sensor)
inline

Definition at line 76 of file bme68x_bsec2.h.

◆ set_iaq_static_sensor()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_iaq_static_sensor ( sensor::Sensor sensor)
inline

Definition at line 77 of file bme68x_bsec2.h.

◆ set_operating_age()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_operating_age ( OperatingAge  operating_age)
inline

Definition at line 55 of file bme68x_bsec2.h.

◆ set_pressure_sample_rate()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_pressure_sample_rate ( SampleRate  sample_rate)
inline

Definition at line 61 of file bme68x_bsec2.h.

◆ set_pressure_sensor()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_pressure_sensor ( sensor::Sensor sensor)
inline

Definition at line 73 of file bme68x_bsec2.h.

◆ set_sample_rate()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_sample_rate ( SampleRate  sample_rate)
inline

Definition at line 59 of file bme68x_bsec2.h.

◆ set_state_save_interval()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_state_save_interval ( uint32_t  interval)
inline

Definition at line 69 of file bme68x_bsec2.h.

◆ set_temperature_offset()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_temperature_offset ( float  offset)
inline

Definition at line 56 of file bme68x_bsec2.h.

◆ set_temperature_sample_rate()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_temperature_sample_rate ( SampleRate  sample_rate)
inline

Definition at line 60 of file bme68x_bsec2.h.

◆ set_temperature_sensor()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_temperature_sensor ( sensor::Sensor sensor)
inline

Definition at line 72 of file bme68x_bsec2.h.

◆ set_voltage()

void esphome::bme68x_bsec2::BME68xBSEC2Component::set_voltage ( Voltage  voltage)
inline

Definition at line 57 of file bme68x_bsec2.h.

◆ setup()

void esphome::bme68x_bsec2::BME68xBSEC2Component::setup ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 22 of file bme68x_bsec2.cpp.

◆ update_subscription_()

void esphome::bme68x_bsec2::BME68xBSEC2Component::update_subscription_ ( )
protected

Definition at line 148 of file bme68x_bsec2.cpp.

Field Documentation

◆ algorithm_output_

AlgorithmOutput esphome::bme68x_bsec2::BME68xBSEC2Component::algorithm_output_ {ALGORITHM_OUTPUT_IAQ}
protected

Definition at line 134 of file bme68x_bsec2.h.

◆ bme68x_

struct bme68x_dev esphome::bme68x_bsec2::BME68xBSEC2Component::bme68x_
protected

Definition at line 109 of file bme68x_bsec2.h.

◆ bme68x_heatr_conf_

struct bme68x_heatr_conf esphome::bme68x_bsec2::BME68xBSEC2Component::bme68x_heatr_conf_
protected

Definition at line 114 of file bme68x_bsec2.h.

◆ bme68x_status_

int8_t esphome::bme68x_bsec2::BME68xBSEC2Component::bme68x_status_ {BME68X_OK}
protected

Definition at line 117 of file bme68x_bsec2.h.

◆ breath_voc_equivalent_sensor_

sensor::Sensor* esphome::bme68x_bsec2::BME68xBSEC2Component::breath_voc_equivalent_sensor_ {nullptr}
protected

Definition at line 152 of file bme68x_bsec2.h.

◆ bsec2_blob_configured_

bool esphome::bme68x_bsec2::BME68xBSEC2Component::bsec2_blob_configured_ {false}
protected

Definition at line 126 of file bme68x_bsec2.h.

◆ bsec2_configuration_

uint8_t const* esphome::bme68x_bsec2::BME68xBSEC2Component::bsec2_configuration_ {nullptr}
protected

Definition at line 124 of file bme68x_bsec2.h.

◆ bsec2_configuration_length_

uint32_t esphome::bme68x_bsec2::BME68xBSEC2Component::bsec2_configuration_length_ {0}
protected

Definition at line 125 of file bme68x_bsec2.h.

◆ bsec_instance_

uint8_t esphome::bme68x_bsec2::BME68xBSEC2Component::bsec_instance_[BSEC_INSTANCE_SIZE]
protected

Definition at line 112 of file bme68x_bsec2.h.

◆ bsec_settings_

bsec_bme_settings_t esphome::bme68x_bsec2::BME68xBSEC2Component::bsec_settings_
protected

Definition at line 110 of file bme68x_bsec2.h.

◆ bsec_state_

ESPPreferenceObject esphome::bme68x_bsec2::BME68xBSEC2Component::bsec_state_
protected

Definition at line 128 of file bme68x_bsec2.h.

◆ bsec_status_

bsec_library_return_t esphome::bme68x_bsec2::BME68xBSEC2Component::bsec_status_ {BSEC_OK}
protected

Definition at line 116 of file bme68x_bsec2.h.

◆ co2_equivalent_sensor_

sensor::Sensor* esphome::bme68x_bsec2::BME68xBSEC2Component::co2_equivalent_sensor_ {nullptr}
protected

Definition at line 151 of file bme68x_bsec2.h.

◆ gas_resistance_sensor_

sensor::Sensor* esphome::bme68x_bsec2::BME68xBSEC2Component::gas_resistance_sensor_ {nullptr}
protected

Definition at line 147 of file bme68x_bsec2.h.

◆ humidity_sample_rate_

SampleRate esphome::bme68x_bsec2::BME68xBSEC2Component::humidity_sample_rate_ {SAMPLE_RATE_DEFAULT}
protected

Definition at line 141 of file bme68x_bsec2.h.

◆ humidity_sensor_

sensor::Sensor* esphome::bme68x_bsec2::BME68xBSEC2Component::humidity_sensor_ {nullptr}
protected

Definition at line 146 of file bme68x_bsec2.h.

◆ iaq_accuracy_sensor_

sensor::Sensor* esphome::bme68x_bsec2::BME68xBSEC2Component::iaq_accuracy_sensor_ {nullptr}
protected

Definition at line 150 of file bme68x_bsec2.h.

◆ iaq_accuracy_text_sensor_

text_sensor::TextSensor* esphome::bme68x_bsec2::BME68xBSEC2Component::iaq_accuracy_text_sensor_ {nullptr}
protected

Definition at line 155 of file bme68x_bsec2.h.

◆ iaq_sensor_

sensor::Sensor* esphome::bme68x_bsec2::BME68xBSEC2Component::iaq_sensor_ {nullptr}
protected

Definition at line 148 of file bme68x_bsec2.h.

◆ iaq_static_sensor_

sensor::Sensor* esphome::bme68x_bsec2::BME68xBSEC2Component::iaq_static_sensor_ {nullptr}
protected

Definition at line 149 of file bme68x_bsec2.h.

◆ last_state_save_ms_

uint32_t esphome::bme68x_bsec2::BME68xBSEC2Component::last_state_save_ms_ = 0
protected

Definition at line 130 of file bme68x_bsec2.h.

◆ last_time_ms_

int64_t esphome::bme68x_bsec2::BME68xBSEC2Component::last_time_ms_ {0}
protected

Definition at line 119 of file bme68x_bsec2.h.

◆ millis_overflow_counter_

uint32_t esphome::bme68x_bsec2::BME68xBSEC2Component::millis_overflow_counter_ {0}
protected

Definition at line 120 of file bme68x_bsec2.h.

◆ op_mode_

uint8_t esphome::bme68x_bsec2::BME68xBSEC2Component::op_mode_
protected

Definition at line 115 of file bme68x_bsec2.h.

◆ operating_age_

OperatingAge esphome::bme68x_bsec2::BME68xBSEC2Component::operating_age_ {OPERATING_AGE_28D}
protected

Definition at line 135 of file bme68x_bsec2.h.

◆ pressure_sample_rate_

SampleRate esphome::bme68x_bsec2::BME68xBSEC2Component::pressure_sample_rate_ {SAMPLE_RATE_DEFAULT}
protected

Definition at line 140 of file bme68x_bsec2.h.

◆ pressure_sensor_

sensor::Sensor* esphome::bme68x_bsec2::BME68xBSEC2Component::pressure_sensor_ {nullptr}
protected

Definition at line 145 of file bme68x_bsec2.h.

◆ queue_

std::queue<std::function<void()> > esphome::bme68x_bsec2::BME68xBSEC2Component::queue_
protected

Definition at line 122 of file bme68x_bsec2.h.

◆ sample_rate_

SampleRate esphome::bme68x_bsec2::BME68xBSEC2Component::sample_rate_ {SAMPLE_RATE_LP}
protected

Definition at line 138 of file bme68x_bsec2.h.

◆ state_save_interval_ms_

uint32_t esphome::bme68x_bsec2::BME68xBSEC2Component::state_save_interval_ms_ {21600000}
protected

Definition at line 129 of file bme68x_bsec2.h.

◆ temperature_offset_

float esphome::bme68x_bsec2::BME68xBSEC2Component::temperature_offset_ {0}
protected

Definition at line 132 of file bme68x_bsec2.h.

◆ temperature_sample_rate_

SampleRate esphome::bme68x_bsec2::BME68xBSEC2Component::temperature_sample_rate_ {SAMPLE_RATE_DEFAULT}
protected

Definition at line 139 of file bme68x_bsec2.h.

◆ temperature_sensor_

sensor::Sensor* esphome::bme68x_bsec2::BME68xBSEC2Component::temperature_sensor_ {nullptr}
protected

Definition at line 144 of file bme68x_bsec2.h.

◆ version_

bsec_version_t esphome::bme68x_bsec2::BME68xBSEC2Component::version_
protected

Definition at line 111 of file bme68x_bsec2.h.

◆ voltage_

Voltage esphome::bme68x_bsec2::BME68xBSEC2Component::voltage_ {VOLTAGE_3_3V}
protected

Definition at line 136 of file bme68x_bsec2.h.


The documentation for this class was generated from the following files: