Open iankaufmann opened 1 week ago
Hm, interesting, HASS.Agent will use the token that is provided during setup to access the media, but, it tries to do it only when the URI/URL points towards the domain that you have HA configured. For example:
https://yourha.net/media/local/ozo63ta2atr71.png
Looks like the camera proxy works as intended because it's handled internally by the integration and a time-based token is appended to the URI provided in notification data. I'll need to see how the Android application handles this. One option would be to always try the "https://yourha.net/media/local/something.smth" is user provided URI starting with "/media".
I tried to use full URI "https://yourha.net/media/local/ozo63ta2atr71.png" and the media only one "/media/local/ozo63ta2atr71.png" and unfortunately first one works for HASS.Agent and not for HA and the second one only for HA...
I'll do a dive into Android app to figure things out and then work something out.
Thanks for taking a look!
After digging into it a little bit, I noticed that the HASS.Agent-Integration looks to be trying to deal with these (line 84): https://github.com/hass-agent/HASS.Agent-Integration/blob/main/custom_components/hass_agent/notify.py
It looks like media_source.is_media_source_id(image)
must be evaluating to false
in my case because the logs just say "/media..." when it seems like if the media source was being found, the integration would be sending over a URL that starts with "https://".
Did a little bit of digging and it looks like the HA Companion App is the place where the relative URLs/URIs are handled. Basically the app checks if the URL/URI is absolute and if not then additional logic is in place to request the relative resource from HA instance. Guess we'll do the same then.
I have a media source that contains annotated images at:
/media/local/BlueIrisAIAnnotated
To be clear, images in notifications work just fine if instead I use:
/api/camera_proxy/camera.blueiris_garage
So I am NOT having an issue with receiving notifications, or even receiving notifications containing images.
What doesn't work is using:
/media/local/BlueIrisAIAnnotated/garage.20241005_190403565.jpg
Using this media source for notifications works with the companion app on my Android phone, so I know that it isn't an issue with the media source itself.
I can only assume it has something to do with authentication between HASS.Agent and Home Assistant.
Is it possible to get this to work?
From Developer tools I am executing this:
I get the notification, but no image, with this log result:
Misc info (please complete the following information):
Windows build (ideally screenshot/info of
winver.exe
output):HASS.Agent version: 2.1.0
Please check what's applicable (multiple answers possible):