Falls jemand das Template für die Docker-Compose brauchen kann, hier bitte:
configuration.yaml -- um den Entity-Recorder etwas einzudämmen:
Code: Alles auswählen
recorder:
db_url: !secret recorder_db_url
purge_keep_days: 30
auto_purge: true
exclude:
domains:
- device_tracker
- time_date
entity_globs:
- sensor.date*
- sensor.time*
- binary_sensor.kamera_einfahrt*
- binary_sensor.browsermod_*
- sensor.browsermod_*
- camera.browsermod_*
- light.browsermod_*
- number.browsermod_*
- switch.browsermod_*
- select.browsermod_*
- update.browsermod_*
- media_player.browsermod_*
entities:
- sensor.home_assistant_v2_db_size
- binary_sensor.browsermod_firehd10_2
Code: Alles auswählen
#homeassistant
recorder_db_url: mysql://<User>:<Password>@>IPAddress>:<Port>/<DBName>?charset=utf8mb4
Code: Alles auswählen
mariadb:
container_name: mariadb
image: mariadb:latest
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: <Password>
MYSQL_DATABASE: <DBName>
MYSQL_USER: <User>
MYSQL_PASSWORD: <Password>
ports:
- 3306:3306
logging:
options:
max-size: "5m"
max-file: "3"
volumes:
- ./volumes/mariadb/data:/var/lib/mysql
Zusätzlich habe ich in Home-Assistant das Volume für die MariaDB angegeben:
Code: Alles auswählen
- ./volumes/mariadb/data:/mariadb
Code: Alles auswählen
sensor:
### Systemintegration "System Monitor"
- platform: systemmonitor
resources:
- type: disk_use_percent
arg: /
- type: memory_use_percent
- type: processor_use
- type: last_boot
scan_interval: 120
- platform: filesize
file_paths:
- /config/home-assistant_v2.db
- /config/home-assistant.log
- platform: sql
db_url: !secret recorder_db_url
queries:
- name: db Size
query: SELECT table_schema "database", Round(Sum(data_length + index_length) / 1024, 1) "value" FROM information_schema.tables WHERE table_schema="<DBName>" GROUP BY table_schema;
column: 'value'
unit_of_measurement: MB