Actionable notifications and getting a camera feed to load

Setting up actionable notifications has been pretty straight forward with the exception of getting my camera feed to actually open up the camera feed for that particular camera. It loads the whole dashboard and then I have to search for and open the corresponding camera which is less than ideal.

I use unifi cameras and also have RSTPtoWebRTC working finally so i dont have the terrible lag that i did before.

How would I get the camera to actually load the feed itself instead of the entire cameras dashboard? I have been trying to figure out how to get the path and the best that I cam up with was using the developer options and it showed me what it was using.

entity_picture: >-
  /api/camera_proxy/camera.doorbell?token=<mysupercooltoken>
friendly_name: Doorbell
supported_features: 2
access_token: <mysupercooltoken>
frontend_stream_type: web_rtc

I have not been able to get the URI right even with this information. Hoping someone else has this issue solved! Many thanks!

Have you tried this: Dynamic attachments | Home Assistant Companion Docs

I believe that is for iOS only. I was hoping that maybe android devices had this by now since it appears that it has been about 2 years or so, but it doesnt look like its here yet.

It looks like there has been some discussions about this:

Actionable notifications on Android: camera stream?.

Actionable notifications for Android w/ Cam Snapshot.

I use clickAction to bring me to a dashboard that contains only that camera feed. I have the dash set to full page and subview. Subview hides it and that dash is only accessible by a direct path.

Can you possibly provide an example of how you used clickAction? That is pretty much exactly what I am looking for. Many thanks!

The key is added to the data section.


    action:
      - service: notify.mobile_app_<your_device_id_here>
        data:
          title: "Motion Detected in Backyard"
          message: "Someone might be in the backyard."
          data:
            clickAction: "/lovelace/cameras"
            ttl: 0
            priority: "high"

ttl and priority is not required. Those 2 entries ensure that the message is delivered immediately, for android only.

1 Like

ok cool, I see how you have it,

I am kind of having a rough time becuase I have 6 doors in all that I want to have a snapshot taken my automation is triggered, then allow me to decide what to do next. The only way so far I have been able to get it working is to have the automation trigger that will in trurn run a script for my notification. This script has 3 options, REMIND, IGNORE, and URI which is what you have helped me with.

This all works, but it has led to a lot of stuff because each door is using a trigger automation, a script to send the actionable notification, another automation to handle whatever I select for REMIND or IGNORE, and then the reminder automation to send after x minutes have passed.

I spend literally all day yesterday trying to get this condensed into one script without success. It wont send a notification at all for some reason.

At any rate, 18 automations and 6 scripts really sucks because there HAS to be a better way. I will try your method for the camera feed as I also use android only in this house and will let you know how it works out. I am guessing I will need to remove the URI option and replace it with clickAction. Thanks for the help!

Here is what I have for the actionable notifications that does work, but I will probably be changing it to how you have it loading the feed. The entity_id is only there in the hopes that one day android will be supported for live feeds in notifications.

clickAction executes when you click the message itself. You can have the actions remind and ignore but the 3rd would not be needed or could be used for something else. clickAction would be inline with image and entity_id.

If I press anywhere in the message body or image, it will bring me to a dash. I also have 3 actions pause this camera for 5 or 20min or all cameras for 20 minutes

image

Edit: Another thing that is available through clickAction is the ability to open another app. I prefer protect than viewing the camera in HA. So to open protect when clicking the message body you can use

       image: camera.attributes.entity_picture,
       clickAction: "app://com.ubnt.unifi.protect",
       ttl: 0,
       priority: "high",
       actions: ...

oh ok i get it now! That will work even better that way. I could, but dont think I will go to the unifi app itself, although its good to know I can. I finally was able to get webRTC working and it runs better than in unifiprotect imho. maybe not forever though.

Thanks!

1 Like

I use the app because those triggers are something I need to review what happened. As opposed to, I need to see what’s going on right now then I go to ha with web rtc.

that does make sense. I may end up having both in mine… clickAction takes me to the app and URI takes me to the dashboard