diff --git a/customize.yaml b/customize.yaml index 52f9a69..feef757 100644 --- a/customize.yaml +++ b/customize.yaml @@ -1,2 +1,4 @@ media_player.wohnzimmer_main: icon: mdi:audio-video +sensor.home_assistant_datenbankgrosse: + icon: mdi:database diff --git a/sensors.yaml b/sensors.yaml index 738cf1b..04b8076 100644 --- a/sensors.yaml +++ b/sensors.yaml @@ -10,3 +10,11 @@ - platform: dwd_weather_warnings name: "DWD Unwetterwarnungen" region_name: "Münster-Süd" +# Database size sensor + - platform: sql + db_url: !secret ha_recorder_dburl + queries: + - name: "Home Assistant Datenbankgröße" + query: 'SELECT table_schema "database", Round(Sum(data_length + index_length) / 1048576, 2) "value" FROM information_schema.tables WHERE table_schema="homeassistant" GROUP BY table_schema;' + column: 'value' + unit_of_measurement: MB