iOS actionable notification with camera image attached

Hey there,

Has anyone successfully made an actionable notification with a camera the push?

I was trying to do this and here is my sample code but it only shows the first category. From what I understand my code is asking for two push categories

doorbell_alert:
    sequence:
      - service: notify.iOSApp
        data:
          message: "Ding, Doorbell!!"
            push:
              category: "DOORBELL"
            action_data: # Anything passed in action_data will get echoed back to Home Assistant.
              entity_id: light.test
              my_custom_data: foo_bar
              category: camera
            entity_id: camera.door_camera

I can with this service call (from dev tools-services):
domain: notify
service: ios
{"title": "test", "message": "Like I said: this is a test", "data": {"push": {"category": "camera"}, "entity_id": "camera.camera_entity"}}

What I can’t do is merge a ‘camera’ category notification with custom actions. In the iOS yaml config I have:

push:
  categories:
    - name: camera
      identifier: 'camera'
      actions:
        - identifier: 'CAM_YES'
          title: 'Do it!'
          activationMode: 'background'
          authenticationRequired: no
          destructive: no
          behavior: 'default'
          context: 'default'
        - identifier: 'CAM_NO'
          title: 'No'
          activationMode: 'background'
          authenticationRequired: no
          destructive: no
          behavior: 'default'
          context: 'default'

so I can add actions to the ‘camera’ category, but it doesn’t work as expected. If I use ‘camera’ as category, I receive the camera video stream notification, without any actionable button. But, If I use ‘CAMERA’, I obtain the actions without the stream…

With other custom categories, without video streams, action buttons work as espected. I have an AppDaemon app listening to the different ios.notification_action_fired events and it’s awesome to react and decide actions for HASS with a touch in the wrist (w/apple watch). @robbiet480 is doing a fantastic job with the iOS app.

Other thing I can’t make it work is the textInput behaviour, has anyone made it work? I’d love to order complex instructions to my HASS with a raw text input answering a notification…
In the yaml config:

- name: execorder
      identifier: 'EXECORDER'
      actions:
        - identifier: 'INPUTORDER'
          title: 'Tell me'
          activationMode: 'background'
          authenticationRequired: no
          destructive: no
          behavior: 'textInput'
          context: 'minimal'
          textInputButtonTitle: "I'm listening" # Only for iOS 10 when behavior is TextInput.
          textInputPlaceholder: 'tell me more' # Only for iOS 10 when behavior is TextInput.

I’m also trying to make this work. Is there any chance @robbiet480 you could update the example at https://home-assistant.io/docs/ecosystem/ios/notifications/content_extensions/ to include the actions? I’d like to make a push notification if I left my garage door open to send me a feed and give me the option to close the door. So far I can get the notification (no thumbnail) and when I tap it I do see the live feed but my actionable notifications don’t show up. I’m not sure how to combine them and looks like there’s quite a few trying to figure it out too.

@Jer78 @azogue were you guys able to get it working with both camera and custom actions? I want to do something similar but faced the same issue you guys posted :frowning:

No, sorry. I use them a lot but not with cameras. I don’t know where the problem is.

I started to use the telegram bot for almost all notifications, because you can make new ‘action buttons’ without the need to ‘declare’ them before. I hope (don’t know) the next iOS version will be more customisable for the action buttons…

No. I even sent @robbiet480 a PM. He never replied :frowning:

That’s too bad :frowning_face: Have either of you submitted this issue in GitHub ? If not I will

1 Like

No I didn’t. Might be a good idea

Just submitted this issue: https://github.com/home-assistant/home-assistant/issues/8693

Feel free to add additional info if I missed anything, hopefully we’ll get some responses there

Has anyone figured out how to do this?

Not yet. If you can, add a comment to the github issue raised (link above) and hopefully Robbie will reply one day with an update to the docs.

1 Like

Hi guys!

You say you got the camera snapshot only to work, how?

My camera feed is visible in the main page for Hass and in mjpeg format.
The config is like this in configuration.yaml:
camera 2:

and like this is automation.yaml:

  • id: hikvision_motion_notification
    alias: Motion detected Hikvision
    trigger:
    • platform: state
      entity_id: binary_sensor.hikvision_sensor_motion
      from: 'off’
      to: 'on’
      action:
    • service: notify.ios_ios_lars_iphone
      data:
      message: Hikvision Motion Detected
      data:
      push:
      category: camera
      entity_id: camera.hikvision

I get a notification just fine, but no camera snapshot.
I also tried to call the service with the example and i just get the notification but no snapshot.

I have restarted the phone and Home Assistant several times and it never works.

I would love to get this working.

Thanks!

try this config and open ios app go to setting scroll down find notifications settings tap on update notifications by the way i’m using the old automations

automation old:
 #camera    
  - alias: camera
    trigger:
      platform: state
      entity_id: binary_sensor.hikvision_sensor_motion
      from: 'off'
      to: 'on'
    action:
      service: notify.ios_your_iphone  
      data:
        message: Something happened at home!
        data:
          push:
            category: camera
          entity_id: camera.hikvision

this works indeed. try it in the HA dev section bei sending this notification to your phone:

{"message":"Something happened at home!", "data":{"push":{"category":"camera"}, "entity_id":"camera.hikvision"}}

if the camera uses mjpeg, you’ll even get the video stream in your notification.

2 Likes

But this is just the camera feed, no actionable notifications, correct?

what action in your notification are you thinking about? i thought showing a picture of your camera stream within an ios notification was what you where looking for?

No. If you see the documentation here, you’ll see a video with custom actions. The idea is to show the camera (front door / garage) and have actionable notifications like Open Door / Garage, Close Door / Garage. Robbie said it’s possible but no one can figure it out and he’s MIA.

ok. got it.

i’m going to try it this week if i get it to work i let you know

Sure. I’d love to know how to do it. I tried every combination I could think of but clearly not the one that works lol