After lots of trying i came up with the following settings:
#
# https://www.home-assistant.io/integrations/recorder/
#
recorder:
purge_keep_days: 3
auto_purge: false
db_url: sqlite:////config/home-assistant_v2.db
exclude:
domains:
- device_tracker
- media_player
- uptime
- time_date
- worldclock
entity_globs:
- sensor.clock*
- sensor.date*
- sensor.time*
- sensor.uptime*
- weather.forecast*
- sensor.afvalinfo*
entities:
- sensor.electricity_meter_tijdstip
- sensor.home_assistant_v2_db_laatst_bijgewerkt
- sensor.system_monitor_disk_free
- sensor.system_monitor_disk_use
- sensor.system_monitor_last_boot
- sensor.system_monitor_load_1m
- sensor.system_monitor_load_5m
- sensor.system_monitor_load_15m
- sensor.system_monitor_memory_free
- sensor.system_monitor_memory_use
- sensor.system_monitor_network_in_end0
- sensor.system_monitor_network_out_end0
- sensor.system_monitor_network_throughput_in_end0
- sensor.system_monitor_network_throughput_out_end0
- sensor.system_monitor_packets_in_end0
- sensor.system_monitor_packets_out_end0
- sensor.system_monitor_swap_free
- sensor.system_monitor_swap_use
- sensor.aeotec_z_stick_gen7_average_background_rssi_channel_1
- sensor.aeotec_z_stick_gen7_average_background_rssi_channel_2
- sensor.aeotec_z_stick_gen7_average_background_rssi_channel_3
I tried a lot of things, the first wast excluding things from the recorder, my DB decreased a lot in size, but the problem was that it still keeps growing again, even after excluding the size added up and up to the same size of my starting point again.
The biggest states where from the system monitor sensors and energy sensors.
As suggested by @illuzn i started to use the automation to keep energy data just for one day. This seems to bring no problems in the graphs and lowers the DB size a lot.
Also, why do we need the default 10 days of data? I put it back to 3 days and this lowered the size a lot again.
I added 2 more automations i found in the old home assistant configucation from Frenck:
id: "system_recorder_repack"
alias: "System - Recorder Repack"
description: >-
Sunday morning, early morning, repack the recorder database.
This keeps the disk usage low and nice by reclaiming space.
trigger:
- platform: time
at: "05:55"
condition:
- condition: time
weekday:
- sun
action:
- service: recorder.purge
data:
repack: true
apply_filter: true
mode: single
id: "system_recorder_purge"
alias: "System - Recorder Purge"
description: >-
Purge my recorder database every hour, to keep things nice and tight.
While Home Assistant does this daily, I like to do it every hour.
trigger:
- platform: time_pattern
minutes: 12
action:
- service: recorder.purge
data:
repack: false
apply_filter: false
mode: single
For now my DB keeps around the 65MB in size, will have to see what it does after a week from now.
PS. Sorry for the bad grammer sometimes.
If anyone has suggestions or improvements, please let me know!
Thanks for the help and info on this page
Edit: Note the historical graph from the database sensor, some of my energy sensors do have this aswell, but also a lot do not have any historical data in it, just the last days. Any idea why some sensors have historical data ans some not?