I have excluded all ‘domains’ from ‘data-base’ but the ‘data-base’ is still growing.
Now almost 2GB size.
I also have some automation - to purge the DB, but looks like it is poorly working.
What I have wrong set-up? Any practical info…?
# Set-up MariaDB for Hass.io
recorder:
db_url: mysql://hass:password@core-mariadb/homeassistant?charset=utf8
# include:
# domains:
# - sensor
exclude:
domains:
- alarm_control_panel
- automation
- binary_sensor
- camera
- device_tracker
- group
- light
- miele
- persistent_notification
- person
- sensor
- sun
- switch
- weather
- zone
# entities:
#Tracking history
history:
I’m not sure if it is still an issue but the purge day counter used to reset every time you restarted home assistant. So if you have been restarting every day it would never purge.
Thanks for the code above to show Maria DB size as a sensor.
If anyone else tries it and is alarmed that their table apparently is 8GB or so (like I was!) note that the value returned by the code above is in KB not MB! Just divide by 1024 again:
query: 'SELECT table_schema "database", Round(Sum(data_length + index_length) / 1024 / 1024, 1) "value" FROM information_schema.tables WHERE table_schema="homeassistant" GROUP BY table_schema;'
Very cool. I think the card formatting may be indented off a bit:
cards:
- cards:
- content: >-
**domains:** {%- set unique_domains = states |
map(attribute='domain') |list | unique | list -%} {%- for domain
in unique_domains -%} {{"\n"}}- {{domain}} {%- endfor -%} {{"\n"}}
type: markdown
- content: >-
**entities:** {%- for state in states -%} {{"\n"}} -
{{state.entity_id}} {%- endfor -%}
type: markdown
- entities:
- entity: sensor.database_size
show_header_toggle: false
title: Maria DataBase size
type: entities
type: horizontal-stack
panel: true
path: system-info
title: System info
However either way when I paste the above in a manual card I get no card type found and in the bottom under the configuration I get: Cannot read property ‘setConfig’ of undefined