Hi everyone,
our growing amount of sensors are producing huge amounts of data at very high frequency. This frequency can often times not be adjusted, meaning that sensors update every second or every few seconds without pushing any relevant information.
I personally have been filtering some of my sensors by publishing to a dedicated MQTT topic, subscribing to that using Node-Red, filtering the data there and then publishing the filtered data to an MQTT topic that Home Assistant is subscribed to.
However, that is only possible if the sensors are running a custom firmware such as Tasmota. Even ESPHome does not allow filtering when you use it as a Bluetooth Proxy (luckily Tasmota does).
Would it not be possible to add an interface that would allow processing of the data Home Assistant is about to write to the database?
Right now, Home Assistant already allows selecting which entities to write to the database by adjusting the recorder
config ( Recorder - Home Assistant (home-assistant.io) ). Could this maybe be extended to allow templating or simple filterting?
A good starting point would be something simple like the ESPHome sensor delta filtering ( Sensor Component — ESPHome ).
Would it be possible to add this to the Home Assistant recorder
?
Thank you for your consideration.
Alex
Possible config approach:
recorder:
include:
entities:
- sensor.abc_temperature*
filters:
- delta: 2.0 #this would only write to database if temperature changes by +-2.0 °C
- sensor.abc_power*
filters:
- delta: 5% #this would only write to database if power consumption changes by +-5%
- sensor.abc_something_else*
filters:
- or:
- throttle: 10min #sensor data will be written to database either if delta is 5 OR if the last write was more than 10 min ago
- delta: 5.0