1
0
ansible-home-assistant/templates/scripts/check-unavailable.yaml.j2

18 lines
578 B
Django/Jinja

check_unavailable:
alias: '[INFO] Check unavailable devices'
sequence:
{% for entity in entities %}
- choose:
- conditions:
- condition: state
entity_id: {{ entity }}
state: unavailable
sequence:
- service: notify.home_assistant
data:
message: >
Device unavailable
{% raw %}{{ {% endraw %} device_attr('{{entity}}', 'name_by_user'){% raw %} }} {% endraw %}is unavailable
target: [ "1109936159951441960" ]
{% endfor %}