trvrnrth / esphome-bsec-bme680

ESPHome component for the Bosch BME680 sensor via BSEC providing temperature, humidity, pressure and indoor air quality measurements.
85 stars 17 forks source link

State save interval unit is unclear #5

Closed maurik69 closed 3 years ago

maurik69 commented 3 years ago

Hi Guys, let me say that this porting on ESPHome looks great! I'm testing it on a custom board based on ESP32 and works fine but looking at the logs at boot I'm finding a differente value for the state_save_interval from the one I set in the yaml file.

The yaml looks like: bme680_bsec: ....

Interval at which to save BSEC state (default is 6 hours)

state_save_interval: 6 hours

but the logs reports:

[12:39:59][C][bme680_bsec.sensor:056]: BME680 via BSEC: [12:39:59][C][bme680_bsec.sensor:061]: BSEC Version: 1.4.7.4 [12:39:59][C][bme680_bsec.sensor:062]: Address: 0x77 [12:39:59][C][bme680_bsec.sensor:071]: Temperature Offset: 6.00 [12:39:59][C][bme680_bsec.sensor:072]: IAQ Mode: Static [12:39:59][C][bme680_bsec.sensor:073]: State Save Interval: 360s

So the setting is for 6 hours and the value reported is 360s. The expected value should be 360 minutes or 21600 seconds... Looks like and error in the time unit conversion.

Which value is used by the library to store state data?

TIA

trvrnrth commented 3 years ago

Oops. Internally the interval is stored in minutes so what you're seeing is the fact that I got the logging wrong! Fixed in de8c6d011faa336f5aa7af9b09d65b39435223a5