Ok, So I made an actionable notification that has a push notification with YES and NO buttons. I can handle they yes and no options if they are pressed but I can’t figure out how to handle the possibility if the timeout finishes and there was no response to the push notification. If the person presses the YES button on the phone, I want to close the door. If the person presses the NO button on the phone, I want to do nothing. IF the person doesn’t press anything, after waiting for 2 minutes, I want to go ahead and close the door. Here is my code. Any help would be greatly appreciated.
alias: TEST
description: message tara and ask if she wants to close the garage door 3
trigger:
- platform: zone
entity_id: device_tracker.tara
zone: zone.near_home
event: leave
condition:
- condition: state
entity_id: cover.garage_door_2
state: open
action:
- service: notify.mobile_app_pixel_4
data:
data:
actions:
- action: YESCLOSEGARAGE2
title: 'Yes'
- action: NOCLOSEGARAGE2
title: 'No'
message: Door is open. Close?
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: YESCLOSEGARAGEDOOR2
- platform: event
event_type: mobile_app_notification_action
event_data:
action: NOCLOSEGARAGEDOOR2
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- choose:
- conditions:
- condition: template
value_template: '{{ wait.trigger.event.data.action == ''YESCLOSEGARAGEDOOR2'' }}'
sequence:
- service: mqtt.publish
data:
topic: sensor/garage/action2
payload: CLOSE
- conditions:
- condition: template
value_template: '{{ wait.trigger.event.data.action == ''NOCLOSEGARAGEDOOR2'' }}'
sequence:
- service: mqtt.publish
data:
topic: sensor/garage/action2
payload: #how to say Dont Do anything?
#need something here if I don't get an answer within 2 min like:
- conditions:
- condition: template
value_template: '{{ wait.trigger.event.data.action == "none" }}'
sequence:
- service: mqtt.publish
data:
topic: sensor/garage/action2
payload: CLOSE