11#include <VOCGasIndexAlgorithm.h>
12#include <NOxGasIndexAlgorithm.h>
33static const uint8_t SGP40_FEATURESET = 0x0020;
34static const uint8_t SGP41_FEATURESET = 0x0040;
36static const uint16_t SGP4X_CMD_GET_SERIAL_ID = 0x3682;
37static const uint16_t SGP4X_CMD_GET_FEATURESET = 0x202f;
38static const uint16_t SGP4X_CMD_SELF_TEST = 0x280e;
39static const uint16_t SGP40_CMD_MEASURE_RAW = 0x260F;
40static const uint16_t SGP41_CMD_MEASURE_RAW = 0x2619;
41static const uint16_t SGP41_CMD_NOX_CONDITIONING = 0x2612;
46static const uint16_t SGP4X_SELF_TEST_TIME = 320;
47static const uint16_t SGP40_MEASURE_TIME = 30;
48static const uint16_t SGP41_MEASURE_TIME = 55;
68 void setup()
override;
virtual void setup()
Where the component's initialization should happen.
This class simplifies creating components that periodically check a state.
Base-class for all sensors.
This class implements support for the Sensirion sgp4x i2c GAS (VOC) sensors.
SUB_SENSOR(voc) SUB_SENSOR(nox) void set_voc_algorithm_tuning(uint16_t index_offset
SGP4xBaselines voc_baselines_storage_
uint16_t uint16_t uint16_t uint16_t std_initial
uint16_t uint16_t learning_time_gain_hours
optional< uint32_t > nox_conditioning_start_
uint32_t seconds_since_last_store_
ESPPreferenceObject pref_
uint8_t samples_to_stabilize_
void dump_config() override
int16_t sensirion_init_sensors_()
uint16_t uint16_t uint16_t gating_max_duration_minutes
uint16_t learning_time_offset_hours
void set_nox_algorithm_tuning(uint16_t index_offset, uint16_t learning_time_offset_hours, uint16_t learning_time_gain_hours, uint16_t gating_max_duration_minutes, uint16_t gain_factor)
VOCGasIndexAlgorithm voc_algorithm_
void set_store_baseline(bool store_baseline)
optional< GasTuning > voc_tuning_params_
NOxGasIndexAlgorithm nox_algorithm_
SUB_SENSOR(humidity) SUB_SENSOR(temperature) void setup() override
void update_gas_indices_()
optional< GasTuning > nox_tuning_params_
uint16_t uint16_t uint16_t uint16_t uint16_t gain_factor
const float MAXIMUM_STORAGE_DIFF_STATE0
const float MAXIMUM_STORAGE_DIFF_STATE1
const uint32_t SHORTEST_BASELINE_STORE_INTERVAL
uint16_t gating_max_duration_minutes
uint16_t learning_time_gain_hours
uint16_t learning_time_offset_hours