@obrienlabs wrote:
I’m trying to get this automation to fire for every entity with device_class of door. When the state changes I want to get notified. I also don’t want to have to list every entity_id manually, looking for an automated way to get this automation to work. Thoughts?
Can’t quite figure out the trigger.
- id: '1590437448747' alias: Notify if any door opens description: '' trigger: platform: template value_template: '{%- for item in states.binary_sensor -%}{%- if item.attributes.device_class == "door" -%}true{%- endif -%}{%- endfor -%}' condition: - condition: template value_template: '{{ trigger.from_state.state != trigger.to_state.state }}' action: - data: {} service: notify.discord_webhook data_template: message: ' {% set option = trigger.to_state.state %} {{trigger.to_state.name}} is now {{ "open" if option == "on" else "closed" }}'
Posts: 1
Participants: 1