disforw
(Disforw)
July 11, 2021, 5:21pm
1
Add the ability to use action condition trigger on state change.
Example of current method…
choose:
- conditions:
- condition: template
value_template: '{{trigger.to_state.state == ''on''}}'
New preposed method…
choose:
- conditions:
- condition: trigger
to_state: on
123
(Taras)
July 11, 2021, 6:25pm
2
Interesting request but it’s not too difficult to do now, using your first example, or in shorthand notation:
choose:
- conditions: "{{trigger.to_state.state == 'on'}}"
If I specifically want from off
to on
, it’s simply this in shorthand notation:
choose:
- conditions:
- "{{trigger.from_state.state == 'off'}}"
- "{{trigger.to_state.state == 'on'}}"
If the automation already has a trigger that listens for the “from off to on” state-change, and it’s the first of several triggers, then we can use trigger.id
.
choose:
- conditions: "{{trigger.id == '0'}}"
2 Likes
disforw
(Disforw)
July 12, 2021, 11:33am
3
Indeed, I just use a lot of these and figured I’d throw it up there now that we have the “trigger” item available in the GUI.