From dfeef6ab489b71a781f48c9e241d27be34b74d51 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sat, 28 May 2022 20:18:06 +0300 Subject: [PATCH] Battery notifications --- .../advanced_dashboard/08_automations.yaml | 1 + .../advanced_dashboard/10_system.yaml | 16 ++++--- config/packages/modules/batteries.yaml | 45 +++++++++++++++++++ 3 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 config/packages/modules/batteries.yaml diff --git a/config/lovelace/advanced_dashboard/08_automations.yaml b/config/lovelace/advanced_dashboard/08_automations.yaml index 2429767..a5c17f7 100644 --- a/config/lovelace/advanced_dashboard/08_automations.yaml +++ b/config/lovelace/advanced_dashboard/08_automations.yaml @@ -201,6 +201,7 @@ cards: - automation.system_telegram_announce_status - automation.speech_telegram_action_do_nothing - automation.ifttt_call_service + - automation.batteries_notify_when_a_battery_is_low - type: entities title: Wallmote diff --git a/config/lovelace/advanced_dashboard/10_system.yaml b/config/lovelace/advanced_dashboard/10_system.yaml index 1e7bb92..6b6adec 100644 --- a/config/lovelace/advanced_dashboard/10_system.yaml +++ b/config/lovelace/advanced_dashboard/10_system.yaml @@ -42,9 +42,6 @@ cards: - type: custom:battery-entity-row entity: sensor.kitchen_radiator_battery_level name: Kitchen Room Radiator - - type: custom:battery-entity-row - entity: sensor.aeon_labs_zw130_wallmote_quad_battery_level - name: Wallmote - type: entities title: Aqara sensors entities: @@ -75,6 +72,10 @@ cards: entity: sensor.hallway_weather_battery - type: custom:battery-entity-row entity: sensor.hallway_motion_battery + - type: custom:battery-entity-row + entity: sensor.guest_bedroom_weather_battery + - type: custom:battery-entity-row + entity: sensor.terrarium_weather_battery - type: entities title: Aqara Devices entities: @@ -86,8 +87,13 @@ cards: entity: sensor.bedroom_wall_switch_battery - type: custom:battery-entity-row entity: sensor.bathroom_switch_battery - # - type: custom:battery-entity-row - # entity: sensor.cube_power + - type: custom:battery-entity-row + entity: sensor.living_room_opple_battery + - type: custom:battery-entity-row + entity: sensor.bedroom_opple_battery + - type: custom:battery-entity-row + entity: sensor.living_room_cover_battery_level + - type: vertical-stack cards: - type: entities diff --git a/config/packages/modules/batteries.yaml b/config/packages/modules/batteries.yaml new file mode 100644 index 0000000..f980de6 --- /dev/null +++ b/config/packages/modules/batteries.yaml @@ -0,0 +1,45 @@ +automation: + - alias: Batteries · Notify when a battery is low + trigger: + platform: numeric_state + entity_id: + - sensor.trisensor_battery_level + - sensor.front_door_battery + + - sensor.multisensor_6_battery_level + - sensor.living_room_right_window_battery + - sensor.living_room_opple_battery + - sensor.desk_switch_battery + - sensor.living_room_cover_battery_level + # - sensor.living_room_radiator_battery_level + + - sensor.bedroom_door_battery + - sensor.bedroom_left_window_battery + - sensor.bedroom_right_window_battery + - sensor.bedroom_weather_battery + - sensor.bedroom_opple_battery + - sensor.bedside_switch_battery + - sensor.bedroom_wall_switch_battery + - sensor.bedroom_radiator_battery_level + + - sensor.kitchen_window_battery + - sensor.kitchen_weather_battery + - sensor.kitchen_motion_battery + - sensor.kitchen_radiator_battery_level + + - sensor.bathroom_weather_battery + - sensor.bathroom_switch_battery + + - sensor.hallway_weather_battery + - sensor.hallway_motion_battery + + - sensor.guest_bedroom_weather_battery + - sensor.terrarium_weather_battery + below: 20 + + action: + - service: notify.telegram + data_template: + title: "⚙️ *System Module · Low Battery*" + message: >- + {{ trigger.entity_id + "battery is reporting: " + trigger.to_state.state }}