1
0
ansible-home-assistant/templates/low-battery.yaml.j2

31 lines
711 B
Django/Jinja

- id: info_low_battery
alias: '[INFO] Low battery'
mode: single
trigger:
- platform: numeric_state
below: 15
for:
hours: 0
minutes: 1
seconds: 0
entity_id:
{% for entity in entities %}
- {{ entity }}
{% endfor %}
- platform: numeric_state
below: 10
for:
hours: 0
minutes: 1
seconds: 0
entity_id:
{% for entity in entities %}
- {{ entity }}
{% endfor %}
action:
- service: notify.mobile_app_iphone
data:
title: "Low battery"
message: >
{% raw %}{{ device_attr(trigger.entity_id, 'name_by_user') }} has low battery {{ states(trigger.entity_id) }}% {% endraw %}