I have a little problem though. I currently have actionable notifications working and I’m loving it. I have created a group of iphones that each receive a snapshot taken froma camera above my front door when the doorbell is pressed. the actionable notification comes through showing the picture and a action button asks if you would like to view the live feed from the camera. if you press the action button a dynamic notification is sent containing the camera feed. the thing is all devices in the group receive the dynamic notification not just the device that requested it. I have tried to use the device ID from the ios_notication_action_fired event payload but it doesnt seem to work.
this works but sends to all devices in group:
alias: Wesley wants the stream
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: SHOW_FEED
action:
send to all because I don’t know who fired the event
this doesn’t work and breaks the automation:
alias: Wesley wants the stream
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
sourceDeviceID: wesleys_iphone
action:
send wesley the feed because I know he pressed the button
I think I’ve sort of solved the problem. I went through the log and found “sourceDeviceName=wesley’s iphone” in the ios_notification_action_fired event. I couldn’t get that to work, even tried with and without quotation marks around wesley’s iphone. After that entry was “sourceDevicePermanentID=98357BA9-B763-4D96-BEBD-63486A87FB4F” and using that works! The downside is that I think the only way to find this ID number is from the log which is a little bit boring.
Each device will need its own automation containing its ID to receive the live feed dynamic notification. Does someone know of a way to script if else type automations? I think thats probably not possible right now.
Here’s the working automation:
- alias: Wesley wants the stream
trigger:
- platform: event
event_type: ios.notification_action_fired
event_data:
# actionName: SHOW_FEED
# sourceDeviceName: "wesley's iphone"
sourceDevicePermanentID: 98357BA9-B763-4D96-BEBD-63486A87FB4F
action:
- service: notify.ios_wesleys_iphone
data:
message: Door Cam Live
data:
push:
category: camera
entity_id: camera.door_cam_live
Another thing has occurred to me whilst writing this and that is that this automation will fire when any actionable button is pressed by the device with the corresponding ID. This works for me, for now, as I only have one action. I see this solution failing me as the complexity of my ios notifications increases!
Are you getting a notification with a still pic and then you have a button to send yourself another push with the live feed?
I’m trying to accomplish getting the live feed in the first notification and have actions like “close garage door”. I’ve tried practically every combination but can’t seem to get a camera along with actionable notifications in the same push. Ideas?
Have you read the whole code I am using? It sounds like you would just have to rearrange it slightly to achieve what you want. If you’ve had a go and it doesn’t work then maybe something funny is going on. I’ll have a little play with it when I get home to see if the live feed can have an action button attached.
Yes I read your code at the link you posted. However, I think it’s much different as you only have one category per push notification. The docs say you can add actionable notifications onto the video stream in a single notification (Implies you can combine 2 separate categories to a notification) but there’s no example of how to combine categories together. I’ve tried all sorts of combos but either I get nothing but the message or just the message and camera feed but the actionable part never appears. If you do figure it out, I’d love to know!!
I’m going to give up. Here’s the combo’s I’ve tried. Actually, I’ve tried more but these at least compile pthe YAML properly. The documentation is not clear at all on how to combine dynamic content such as video with actionable notifications. I didn’t try adding the camera to the ios part because it doesn’t seem logical there. Any ideas?
I took the following blurb from the ‘Dynamic Content’ page to mean that your iOS push category identifer had to be either ‘map’ or ‘camera’. I tried this with map (I have no camrea feeds) and it only produced a map notificatino with no action buttons. With this logic it would also limit you to only having one set of actions for a camera or a map notification.
Combining with actionable notifications
As you can see the category key is used to tell the device what kind of content extension to use. You can use the same category identifiers in your own custom actions to add actions to the content extension.
Automation Entry (testing by triggering in the web UI)
Yeah I get what you’re saying but i figured it wouldn’t be the way he programmed it because it would limit to one camera or map push. I’m sure it’s something to do with adding an extra category but there’s something we are obviously not getting. I guess we will just have to be patient and wait for @robbiet480
You have have seen already, but with the latest updates (0.54 and later) if you set your action identifier to ‘camera’ all lowercase, then you can get the actions with the camera image. unfortunately this overrides all camera notify so you will see them on all camera notifications.