i am using a ESP8266 with BME680 and the code from the second (advanced) example here:
I noticed there is an time offset of 15 seconds between the reporting of the BME680 Raw values (temperature, humidity, pressure, gas_resistance), the values from the sensor template (Indoor Air Quality) and the values from the text sensor template (IAQ Classification).
I assume it does not take 15s to calculate the template values.
So I have two questions:
Can somebody explain where this offset comes from?
Is there a way to trigger the sensor data aquisition manually?
Background for my question is that I want to use deep sleep in the future but noticed that not all values are reported at the same time, which results in unnecessary time where the uC is consuming power but has not reported all the sensor values.
I already tried to use component.update: temperature
but this results in an error: ID 'temperature' of type sensor::Sensor doesn't inherit from PollingComponent. Please double check your ID is pointing to the correct value.
I also tried id(temperature).publish_state(id(temperature).state);
but this does only publish a exisiting value (e.g. when setting update interval to “never” the reported values always default to 0)
BME680 sensor is read and values published at 11:30:57.
Text sensor and teamplate sensor are published at 11:31:20.
Offset of 23s. The actual offset seems to be random with each reset/reboot but stays the same within each reset/reboot.
By default, some temp sensor measures each value 16 times when requesting a new value. You can, however, configure this amount. Possible oversampling values:
The offset value seems to be random with each reboot and it does not really correlate with the delay/offset I actually see when the sensor data is published.
The two components both have a update_interval of 60s. These doesn’t always sync up.
Try setting the update_interval to never in the text_sensor and then just call component.update of the text_sensor in the on_value action in the temperature section of the bme680 sensor.
I’m actually trying to accomplish almost the same on an AHT20. Here, I want the frontend to be able to set an calibration offset (don’t want to compile this to the firmware obviously) and figured I could do it this way:
But also getting the same yaml linting error. It’s just an asthetic thing of course, re-sending the value after changing the value so I don’t have to wait 60s after a value change. I’m sure this must be possible?