Adding image from Nest Doorbell to Notification
Hey folks,
Thanks for running this Discord, help for dummies like me is always appreciated!
I've got HASS Agent all setup, and I'm able to send notifications when my doorbell goes to my Windows desktop. All that works beautifully. I like the fancy option of adding an image and I've been trying to get it working without muck luck and I'm wondering if someone can point me in the right direction.
The following is what I've got in the action thus far:
Hope someone can offer some advice 🙂
35 Replies
Help us Help Others!
To help others find answers, you can mark your question as solved via
Right click solution message -> Apps -> ✅ Mark Solution
Help us Help You!
Please don't delete messages or posts because it makes it impossible to understand what happened. If you don't want your messages to be seen then don't post here.
@DrR0x
First of all, is the camera proxy properly setup as per the ha docs?
I'll double check. Thank you. Will come back shortly.
All good it's a common mistake and issue with the old docs 😂 will be adding better wording and guides to the new one once I get around to the notification setup.
😂 yeah ... I missed that. So ... this is now in my
configuration.yaml
honestly wasn't sure if it was supposed to be the long form entity id or the friendly name so I figured it made sense to add both:
Appear to be ok there but using any of those four options still isn't popping an image into the notification.
Hey there, just throwing in this as an alternative to the camera proxy:
This uses the gif generated by the Google Nest Integration
Interesting! Is that
>-
supposed to be there?
Next to image:That just enables me to do line-breaks in the script :D
Ahh! Cool! Well ... sadly still not working ... I'll come back to look at it tomorrow, for now my head hurts 😂
So the proxy is only the entity id which is not the friendly name. But also not the backend uuid type thing ha uses.
So whatever you normally use for entity id. If in doubt you can select it from the left panel in the file editor, it should autofill it.
Thanks. I'm working on the assumption that the Camera Proxy is setup correctly as I can see it in my dashboard and it's an image rather than a live stream.
The fact that both the
/api/nest/event_media/
option and the /api/camera_proxy/camera.front_door
aren't working makes me think there's something else amiss somewhere.So if you could enable extended logs and check the log file after a restart and a test notification it should show exactly what url is not found
Stop reading my mind damnit ... I was just readin on how to do that 😂
😂, you need help or have you got it?
I always need help but I've got meds for that!
Added to configuration.yaml and rebooted HA:
Test notification(s) sent, received on desktop with no image - logs:
Automation config:
Does the notification send?
Just without an image right?
Correct
So by extended logs I ment in hass.agent the app not home assistant 😂
Ohhh
But, nice job on the ha logs, I wouldn't even be able to tell you how to do that without some googling.
In your logs on your computer it will most likely have a status code somewhere because the image will be in reachable.
Just need to workout what the status code is and what url hass.agent is receivinf
Progress ..
Well this is a problem
The image should be:
/api/camera_proxy/entity id of camera
And you should be able to go to hassurl:port/api/camera_proxy/entity id of camera
It should return a bad request or not allowed or something along 5he lines of you do not have access. Not a 404 not found. That means it's setup wrong.Yeah I get 403 Forbidden when going to
http://homeassistant.local:8123/api/camera_proxy/camera.camera_proxy_camera_front_door
Although, if I open the image from the dashboard - it has a token on the request url:
http://homeassistant.local:8123/api/camera_proxy/camera.camera_proxy_camera_front_door?token=24416<redacted>
And that opens fine.Ok got it working ....
The 404 makes some sense since my machine receiving notifications doesn't know what the path
/api/camera_proxy/blah
means ... so I changed image:
to point to the full URL + the token ... and I get images on notifications.
Only question I have I guess is, how long lived is that token .. if at all ..
Answer: not very 😄 that token seems to be a temporary one so not a long term fix. Hmm. Back to the drawing board.hm
the fork should use the token you configure during initial setup for resources within the same domain as "the HA"
but I'll double check that
yeah, it does
The full url should also automatically he added right?
eli5?
If you type in /api doesnt it automatically append the hass url?
so like if hass.agent receives
/api/camera_proxy/entity.id
it would grab image from yourconfiguredhaurlandport/api/camera_proxy/entity.id
cause that's whats in the old docs 🤣
https://hassagent.readthedocs.io/en/latest/notifications/notification-usage-and-examples/#camera-proxy
Oh, no, it has a check to only include the bearer token if the "uri" starts with the "domain" not to leak the token to unknown sites
Yeah, there was even an issue on old repo for this not working although I couldn't find a way/code in the oroginal that would allow it
ahh okay
all good, just need to make a note for the new docs