Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Image notification not displaying image #209

Open
Alby247 opened this issue Dec 26, 2024 · 7 comments
Open

Bug: Image notification not displaying image #209

Alby247 opened this issue Dec 26, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@Alby247
Copy link

Alby247 commented Dec 26, 2024

HAOS on bare metal

Core 2024.12.5
Supervisor 2024.12.0
Operating System 14.1
Frontend 20241127.8

Hass.agent integration 2.1.0-beta1 installed via HACS.

Hass. Agent installed on Win11 PC.

Show test notification works fine, displays image of the kitten.

Set up automation to display image from security camera:

action: notify.acerlaptop
data:
  message: Person at front door
  data:
    image: http://192.168.10.5:8123/config/www/frontdoor.jpg

Notification works with message but no image.

The image appears to be being copied to the cache folder (default to "C:\Users\myusername\AppData\Local\HASS.Agent\Client\cache\images\20241226145810_64abcece.jpg"

But when viewing this image it is not viewable in Win11. The image at config/www/ is viewable in Win11, so it seems the file is being corrupted when it is copied to the cache folder. Image is jpg 1280x720, 397kb, 96dpi 24 bit. Tried png version, same problem.

@Alby247 Alby247 added the bug Something isn't working label Dec 26, 2024
@Alby247 Alby247 changed the title Bug: Image nbotification not displaying image Bug: Image notification not displaying image Dec 26, 2024
@Alby247
Copy link
Author

Alby247 commented Dec 26, 2024

Just noticed that the file size of the image in the cache folder is only 5.36kb while original image is 397kb.

@amadeo-alex
Copy link
Collaborator

Hello
What version of HASS.Agent (not integration) are you using?
I'm asking since the original version did not include the authentication token when trying to access HASS media so it wasn't possible to view the image/media.
You can also test it by opening a private browser window (important step) and then navigating to "http://192.168.10.5:8123/config/www/frontdoor.jpg" if it fails with permission denied then it won't work with original HASS.Agent.

If it is one of the forked ones, could you please enable extended logging and try to show the notification again? (and then paste the logs here of course :D)

@Alby247
Copy link
Author

Alby247 commented Jan 1, 2025

It's this fork, https://github.com/hass-agent/HASS.Agent latest version 2.1.0

Log:

2025-01-02 05:46:24.137 +11:00 [FTL] [PROGRAM] FirstChanceException: Access to the path 'Global\RazerReadWriteGuardMutex' is denied.
System.UnauthorizedAccessException: Access to the path 'Global\RazerReadWriteGuardMutex' is denied.
   at System.Threading.Mutex.OpenExistingWorker(String name, Mutex& result)
   at System.Threading.Mutex.OpenExisting(String name)
   at LibreHardwareMonitor.Hardware.Mutexes.<Open>g__CreateOrOpenExistingMutex|4_0(String name)
2025-01-02 05:46:25.438 +11:00 [INF] [VIRTDESKT] Virtual Desktop Manager initialized
2025-01-02 05:46:25.439 +11:00 [DBG] [AUDIOMGR] initializing
2025-01-02 05:46:25.882 +11:00 [INF] [AUDIOMGR] initialized
2025-01-02 05:46:25.939 +11:00 [INF] [SETTINGS_QUICKACTIONS] Config not found, no entities loaded
2025-01-02 05:46:25.942 +11:00 [INF] [SETTINGS_COMMANDS] Config not found, no entities loaded
2025-01-02 05:46:31.208 +11:00 [INF] [SETTINGS_SENSORS] Loaded 1 entities
2025-01-02 05:46:31.223 +11:00 [INF] [HOTKEY] Completed bind for global quickaction hotkey
2025-01-02 05:46:31.440 +11:00 [INF] [LOCALAPI] Initializing ..
2025-01-02 05:46:31.440 +11:00 [INF] [LOCALAPI] Ignoring certificate errors for images
2025-01-02 05:46:31.615 +11:00 [INF] [MQTT] Identifying as device: ACERLAPTOP
2025-01-02 05:46:31.734 +11:00 [INF] [MQTT] Connecting ..
2025-01-02 05:46:31.768 +11:00 [INF] [SERVICE] Local install path: C:\Program Files\HASS.Agent Satellite Service\Service\
2025-01-02 05:46:31.876 +11:00 [INF] [MEDIA] Ready
2025-01-02 05:46:31.919 +11:00 [WRN] [MEDIA] No MediaSession active
2025-01-02 05:46:32.018 +11:00 [INF] [MQTT] Connected
2025-01-02 05:46:32.122 +11:00 [INF] [HASS_API] Home Assistant version: 2024.12.5
2025-01-02 05:46:32.143 +11:00 [INF] [NOTIFIER] Ready
2025-01-02 05:46:32.477 +11:00 [INF] [HASS_API] System connected with http://192.168.10.5:8123
2025-01-02 05:46:33.762 +11:00 [INF] [MQTT] Initial registration completed
2025-01-02 05:46:34.866 +11:00 [INF] [LOCALAPI] listening on port 5115
2025-01-02 05:47:52.719 +11:00 [DBG] [STORAGE] Using token bearer authentication for : http://192.168.10.5:8123/config/www/frontdoor.jpg
2025-01-02 05:48:10.930 +11:00 [DBG] [STORAGE] Using token bearer authentication for : http://192.168.10.5:8123/config/www/frontdoor.jpg

Opening the link in a private window requires a HA login with authentication, then when logged in the image isn't shown, just a blank screen in the HA interface - no error message. I'm using Firefox. The image is viewable in Windows photos from this pc.

@amadeo-alex
Copy link
Collaborator

amadeo-alex commented Jan 1, 2025

Ok, it properly recognizes the URL and provides the bearer token but

then when logged in the image isn't shown, just a blank screen in the HA interface - no error message

if the image is not shown in the logged in browser, HASS.Agent won't be able to retrieve it also.
On thing to clarify:

The image at config/www/ is viewable in Win11
The image is viewable in Windows photos from this pc.

If the image is stored in the HAOS then how do you open it on the pc? Network mount or I'm missing something?

@Alby247
Copy link
Author

Alby247 commented Jan 1, 2025

If the image is stored in the HAOS then how do you open it on the pc? Network mount or I'm missing something?

Yes, Samba share in HA, opening it via file explorer in Windows.

I'm at work now so can't check locally, but accessing HA remotely (through Nginx) and using the Filebrowser add-on in HA I can browse to the www folder and open the image in HA (in A Firefox window). Will need to check on local when I get home tonight.

@Alby247
Copy link
Author

Alby247 commented Jan 2, 2025

Uninstalled everything Cleared browser cache. Rebooted Win PC an HA PC (reboot not just restart).

Reinstalled Win app and HA Integration, doubled checking it was the right versions.

Still nothing. Can't even send a message notification now, much less an image notification.

Would really like this to work but it's wasting too much time, will use telegram notifications or something instead.

@amadeo-alex
Copy link
Collaborator

In general we need to achieve a situation where opening the URL in the same browser where you're logged in to HA will properly open the image. Then, if it can be opened in the browser but HASS.Agent cannot display it we can look for fault on HASS.Agent side.

Let's try to get back to the original state before you reinstalled everything:

  • is the installed integration the forked one from HACS?
  • does HA discover your device where HASS.Agent is installed?

If not, we'll go deeper - do you have MQTT.Explorer installed by any chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants