I am so sorry, I know there are a lot of examples but, after reading and reading, I can’t get it working. I’m trying to create an automation to close the garage door, if it’s open for 5 mins. It’s my code:
alias: Door open
description: ""
trigger:
- platform: device
device_id: 3ac70e1d66eec172cab97d178449cf36
domain: cover
entity_id: cover.garage_door
type: opened
for:
hours: 0
minutes: 5
seconds: 0
condition: []
action:
- service: notify.notify
data:
message: The garage door is opened!
data:
actions:
- service: cover.close_cover
title: Close
data: {}
target:
entity_id: cover.garage_door
title: Garage door
mode: single
I get the notification, and the button to close, but, nothing happens. Can anybody please help me?
You have to define the actions as you did but then react on them separately. Not within the definition.
So either put another automation with the trigger, that someone hits the button or wait without your automation until someone hits the button. I don’t like the second way, because you don’t know when it will happen and what happens until then with your system.
Hello, thanks for your answer and the link. I tried to follow it, but I don’t know what I am doing wrong. I don’t know how to trigger the action when I press the button.
service: notify.mobile_app_<your_device_id_here>
data:
message: "Something happened at home!"
data:
actions:
- action: "ALARM" # The key you are sending for the event
title: "Sound Alarm" # The button title
Hello @i5Js
Would you be so gracious as to post your working code for this? I have been working on this and I cant seem to get it working—much appreciation in advance.