illi
June 18, 2021, 10:00am
1
I’ve looked through some topics now, but I can’t seem to find an answer. So I will ask myself:
Is it possible to list entities for automation as a trigger so if any one of the entities does something, the automation will be triggered?
Trigger:
-entity 1
-entity 2
-entity 3
Action:
-some template with trigger.entity
Greetings!
Troon
(Troon)
June 18, 2021, 10:03am
2
Try the documentation. Spoiler: yes.
See automation 3 under Examples in the second link.
illi
June 18, 2021, 10:16am
3
I feel embarrassed. Thanks!
myle
(StePhan McKillen (Other kiwi Here))
June 19, 2021, 3:33am
4
I have this
- id: "notify stephan phone Door Change"
alias: "notify Stephan phone Door Change"
initial_state: true
trigger:
- entity_id:
- binary_sensor.garage_side_door
- binary_sensor.garage_door
- binary_sensor.front_door
- binary_sensor.cupboard_door
- binary_sensor.linen_door
- binary_sensor.washing_door
- binary_sensor.dryer_door
platform: state
action:
- data_template:
title: "Home Assistant"
message: "{{ trigger.to_state.attributes.friendly_name }} was {% if trigger.to_state.state == 'on' %} Open {% else %} Closed {% endif %}"
service: notify.stephan_phone
illi
June 19, 2021, 8:43am
5
I thought data_template and value_template are outdated? Is this working?
Vex
(Marcin Bielecki)
January 5, 2023, 1:19pm
6
do you know if it is possible to give the list in such or analogous way?
entity_id: "{{ states | selectattr('entity_id', 'search', 'valve_position') | map(attribute='entity_id') | list }}"
1 Like