I’m using the SmartMeter add-on (DSMR) to parse data and present in Home-Assistant.
sensor
platform: dsmr
port: /dev/ttyUSB0
dsmr_version: 5
My smartmeter spits out data every single second. This gives a nice actual reading, however I’ve noticed my database is getting larger and larger. Graph loading takes about 1 minute, which is not very responsive…
Is it possible to reduce the amount of data stored to the database to 1 minute values?
I have tried scan_interval: 300 but that has no effect.
Additional, i would like to keep weekly, montly and yearly data for comparison purposes.
Using an entity_id that doesn’t exist should prevent this template sensor from updating automatically. Then use an automation to update it every minute:
For the longer term data collection, I wouldn’t count on HA’s database. I don’t think it’s intended for that. Maybe use the File notification component (and an automation) to record values at the larger periods. Or maybe someone else has a better idea for that part.
@peter_pdj I had the same issue with a huge database because of my smart meter spitting out data out at a high interval. I found this topic and followed the advice to create a filter sensor. Followed by a service call to recorder.purge which actually cleans up the database. Hope this helps for you.