Hi there, I am fairly new to HA and have always managed to find what I’m looking for in the community posts…until now. I’d really appreciate help on this template I’m trying to create. It is supposed to reference one of two triggers I want my automation to wait for, in order to decide how to proceed. If I double press button no2, I want the automation to stop. If I single press button no1, I want it to continue before the timeout. At the moment, it continues with both triggers.
I have read through quite a few topics and documentation and tried many different combinations, but cannot find anything that works for my use case.
For reference, among other stuff, I have looked at this post as well as the trigger variables and MQTT device trigger documentation. My trigger yaml looks different though and have no idea if it’s even possible to reference the subtype.
This is the relevant yaml snippet :
- wait_for_trigger:
- domain: mqtt
device_id: 6ce568a8659cae6362c3e45
type: action
subtype: 2_initial_press
trigger: device
- domain: mqtt
device_id: 6ce568a8659cae6362c3e45
type: action
subtype: 1_short_release
trigger: device
timeout:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger.device.subtype == '2_initial_press' }}"
sequence:
- stop: Cancel automation
- conditions:
- condition: template
value_template: "{{ wait.trigger.mqtt.subtype == '1_short_release' }}"
sequence: []
Thanks in advance!