ericklein / air_quality

displays and logs local indoor and outdoor weather and air quality information
MIT License
0 stars 0 forks source link

DWEET support for when CO2 sensor is not available #47

Closed ericklein closed 2 years ago

ericklein commented 2 years ago

When CO2 sensor is not available, AQ uses the convention of setting sensorData.internalCO2 to 10000. DWEET will attempt to push CO2 values even when there is no sensor reading it, so it will push 10000 upstream. Is that the intended behavior?

disquisitioner commented 2 years ago

Good catch! I see from looking at readSensor() that it sets internal CO2, temperature and humidity to 10000 if no data was read from the sensor. I hadn't spotted that before. Knowing that indicates an error condition I will add a test so post_dweet() doesn't get called if that error (no data) exists. Thanks.

disquisitioner commented 2 years ago

I added the required if() test in the network update branch I'm working on, so will follow up here when that pull request goes in. (I added that same logic to apply to uploading data to InfluxDB.)

ericklein commented 2 years ago

I modified the logic due to another bug for DWEET, MQTT, and Influxdb, and verified in MQTT and Influxdb that values publish when CO2 = 10000 (no CO2 sensor) and when we have an actual value. I'm going to close this bug. @disquisitioner you can reopen if there is an issue.