I’m measuring humidity by means of a MQTT Sensor. Every 15 seconds I get a new reading. On top of the MQTT sensor a statistics sensor is configured.
The issue is that the MQTT Sensor reading is only recorded when the value has actually changed. Readings with the same value as the previous reading are discarded (this is because the recorder only records state changes). Because of this the statistics does not give the average of the last 20 readings but of the last 20 changed values. A long period of stable readings is therefore not correctly represented in the statistics sensor.
How can I configure the statistics sensor to take into account ALL sensor readings and not only the sensor readings when a change had happened.
A solution could be to change an attribute of the MQTT sensor (like a timestamp). In that way the recorder will see the change and record the reading even the state didn’t change. But I don’t find how I can set a attribute value on a MQTT sensor.