While researching something in the Home Assistant documentation a month or two ago, I bumped into information regarding the method for prompting the user with a yes/no dialog as an Action (or maybe a Condition?) in an automation. “Cool” I thought, but at the time had no use for it.
Well, now I have use for it, but can’t find it! Did I imagine it, or was that functionality recently removed?
If you can point me at said non-imaginary documentation, it would be much appreciated.
Thanks.
Dashboard cards that support tap action also support a confirmation:
https://www.home-assistant.io/dashboards/actions/#confirmation
Also tell us your use case. Both suggestions above are valid, but it would depend on your use case which would work best.
I’ve implemented OpenGarage openers on my garage doors, have set up dashboard buttons to open&close the doors…which on rare occasions are inadvertently finger brushed and activated. And yes, either suggestion could work, but the dashboard tap confirmation option would probably be the more elegant solution for this.
(And no, it’s not for an automation, that’s just where I had thought maybe I’d seen it; totally barking up the wrong tree)
Thank you @tom_l and @Didgeridrew for your quick replies; my apology for the tardy response.
Button and other built-in cards have an action setting. As for my cases, I use the custom button card from HACS which also supports this.
Maybe if I could add an usecase.
I have iOS actions configured ( Actions | Home Assistant Companion Docs (home-assistant.io)). This creates a quick button on my homescreen of my iOS device. Love the simplicity of it. I’m using it to open my door. It is on my homescreen and sometimes my phone is being used by my son of 3 years old. When he accidentally pushes the button, the door opens.
I’d like it to ask a confirmation or even better; ask a pin.
Any thoughts on this?
Use the trigger in that example. Under your actions, send an actionable notification (see link earlier in thread). The next action in the automation can then use a wait for trigger for the response (the chosen action). This will only work for predefined responses. I’m not aware of any way to get an input value like a pin.
thanks, I already was thinking this route, but there are 2 downsides as far as I can see.
- The actionable notification is always getting send to specific phone or a predefined group. The action is available to all who have a iOS device, and thus there is no absolute link to who pushes the action and who gets the notification.
- The button on the iphone opens ha, fires the automation and then sends the notification. This makes the iphone receive a new notification which has to be pushed and another click to open the door. Making it a lot less intuitive.
Maybe i should go down another path, but can’t seem to figure what is easiest.
Not quite. You should have a notify service for each individual device and you can have notify groups. This means, you can control who you send the notification to using some choose actions in the automation. More logic, but possible.
Not ideal, for sure. How about making a special mobile view on your dashboard and make the iOS action navigate to that view? Still two steps, but you can then do the confirmation via the HA UI.
Agreed, it is possible to send to individuals and groups. But the action is available to all. So for example; when I hit the button, I can send a notification to my phone, but when my wife pushes the same action on her phone, i’m getting the notification. There is no hard link between someone pushing the action on the iPhone and receiving a notification or selecting a notification. At least; not that I’m known to.
The second suggestion is something I can look at. Thanks for the suggestion.
I see. You can work around that by not using notify groups, but instead looping yourself and send individual notifications. You can add additional event data to be echoed back when you receive the event and that way add the additional context needed.