I am trying to configure an automation that when the alarm siren is sounding, I get a push notification with an actionable button to turn it off.
Initially, I just wanted to see how actionable buttons look on IOS and I cant get them to show, I can see the notification come in but no button, even if I long press, nothing.
I just tried to configure a simple open link button.
this is how its configured at the minute:
description: ''
mode: single
triggers:
- trigger: alarm_control_panel.triggered
target:
entity_id: alarm_control_panel.theblarney_alarm_manager
options:
for: '00:00:00'
conditions: []
actions:
- action: notify.mobile_app_theblarney_iphone
metadata: {}
data:
message: Alarm Triggered by the main door opening
title: Alarm Triggered
data:
actions:
- action: URI
title: Open Link
uri: http://www.google.com
I wasn’t sure if your message saying you had sorted it out was related to asking a good question or that you figured out the answer. So here goes just in case.
There are two parts to having a button that HA can respond to. I’m not sure what the URI thing is you’re trying, but I don’t think there are any built in actions. Basically you are defining the action to send back to HA, then HA has to do something with it. Here’s the action I have that forwards all persistent notifications to my mobile device with an action of CLEAR_ALERTS.
action: notify.mobile_app_kyles_iphone
metadata: {}
data:
message: '{{trigger.event.data.service_data.message}}'
title: '{{trigger.event.data.service_data.title}}'
data:
push:
badge: '{{states(''input_number.notification_count'')}}'
actions:
- action: CLEAR_ALERTS
title: Mark All as Read
Then I have an automation that lists for that mobile app notification and dismisses all the notifications.
alias: Delete All Persistent Notifications from Mobile
description: ""
triggers:
- event_type: mobile_app_notification_action
event_data:
action: CLEAR_ALERTS
trigger: event
id: dismiss_all_mobile
conditions: []
actions:
- action: persistent_notification.dismiss_all
metadata: {}
data: {}
mode: single
I had not formatted my post correctly so was saying I had sorted that out but can see how its confusing.
My issue is that I cannot get any buttons to show in IOS so all i wanted to do is get any kind of button working, then once I have sorted that, I know what i need to do to get the rest working.
The google button was just a test to see how it looked.
There are two things in the developer docs that might be pertinent:
The action to open a web page seems to behave differently on Android and iOS. It’s possible that URI call just won’t work on iOS, and it might not create the button.
You must have the HA app (either iOS or the Watch app if you want to use that) installed for the buttons to show up.
You might try something other than URI as a test. You can use the HA developer area to listen to the mobile events to see it come across, and that will hopefully generate the test button.