Recorder frequency configuration for all sensors

Some sensors are generating multiple events/states per second and inflating the Home Assistant DB very quickly. Excluding them from the recorder is not a good solution if the user wants to see graphs of those sensor values. It would be very nice if all sensors supported a record_interval parameter which would make it possible to override the default recorder behavior of recording every new value and make it possible to record a new value only if the specified interval has elapsed.

A real life example is that a z-wave sensor is producing 10 states per second. I want to see the updates of the sensor real time and use it for automations, etc. but I want to be able to specify that only a single value should be recorded every 5 minutes, so that the DB does not become huge.

Indeed that feature would be really nice to have!

I’m also interested in this feature for exact the same reason!

This has my vote too, for the same reason!

Same here. I have “weekly” sensors that generate +/-10,000 records per week.
ONE would be enough.
Or sensors like “memory_free” generating 55,000 records in a
month where <sarcasm>8k records</sarcasm> would be more than enough.

The way to do this is to create a filter sensor from your overactive sensor. You can then use one of the available filter algorithms to control how often the state of this new sensor changes compared to the current one. Like time throttle to make it only change state once every x seconds or throttle to only record state changes when the value increases or decreases by a defined amount. Then you can stop recording history for the first sensor and only record history for this filter sensor instead.

The option proposed here is also nice and I could see it being useful since you don’t have to create another entity wrapping the first. But the filter sensor is how you do this today and is a lot more flexible since time throttle is just one option for processing the state of a sensor.

1 Like