Inital Commit

This commit is contained in:
2022-10-11 15:40:40 +13:00
commit 7089991005
50 changed files with 1313 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
- id: notify_if_batteries_are_low
alias: Daily alert that zigbee batteries Are Low
initial_state: true
trigger:
- platform: time
at: "19:00:00"
condition:
- condition: or
conditions:
- condition: template
value_template: >
{% set min_battery_level = 20 -%}
{% set ns = namespace(found=false) -%}
{% for entity_id in states.group.battery_levels.attributes.entity_id -%}
{% set parts = entity_id.split('.') -%}
{% if (states(entity_id) | replace("%","") | int) < min_battery_level -%}
{% set ns.found = true -%}
{% endif -%}
{% endfor -%}
{{ ns.found }}
action:
- service: notify.pushover_notifications
data:
title: View Road Sensors
message: >
{%- set min_battery_level = 20 -%}
{%- for entity_id in states.group.battery_levels.attributes.entity_id -%}
{%- set parts = entity_id.split('.') -%}
{%- if (states(entity_id) | replace("%","") | int) < min_battery_level -%}
{{ states[parts[0]][parts[1]].name }} level is {{ states(entity_id) }}%.{{ '\n' }}
{%- endif -%}
{%- endfor -%}