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: hass.agent client side issues with notifications [distinct from 2024.4.5 update notifications issue] #80

Closed
2 of 4 tasks
robertoleonardo opened this issue May 2, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@robertoleonardo
Copy link


Describe the bug
i was on the original LAB02 Version of HASS Agent until i started having the integration side notification issue that everyone else has had with the recent ha update. in the process of sorting that out, i learned about this fork for the window client and made the transition [sidenote: thanks for keeping this project alive!]

i was able to fix the server side notifications error with the modifications to init.py described in the related issue, but now i'm realizing that notifications don't work client side either. the "test notifications" button doesn't give me anything. my logs are below.

i just downgraded to the lab02 version again and the test notifications button works again -- so it doesn't appear to be anything relating to my windows settings.

this is what my log says on multiple machines i've tried it on

**2024-05-02 15:41:54.796 -07:00 [WRN] [NOTIFIER] Showing notifications might fail, reason: Unsupported**
2024-05-02 15:41:54.800 -07:00 [INF] [NOTIFIER] Ready
2024-05-02 15:41:54.841 -07:00 [INF] [MQTT] Connected
2024-05-02 15:41:54.905 -07:00 [INF] [HASS_API] Home Assistant version: 2024.5.0
2024-05-02 15:41:55.125 -07:00 [INF] [LOCALAPI] listening on port 5115
2024-05-02 15:41:55.327 -07:00 [INF] [HASS_API] System connected with https://hass.robjlee.com
2024-05-02 15:41:56.801 -07:00 [INF] [MQTT] Initial registration completed
**2024-05-02 15:42:02.328 -07:00 [INF] [NOTIFIER] Attempting to show test notification ..
2024-05-02 15:42:02.342 -07:00 [INF] [NOTIFIER] Test notification attempt completed
2024-05-02 15:42:02.476 -07:00 [ERR] [NOTIFIER] Notification 'HASS.Agent' failed to show**

Misc info (please complete the following information):

  • HASS.Agent version: both 2.0.1 AND the current beta
  • multiple windows machines (windows 10 on one, and windows 11 - version information below -- on the other 2):
    image

Please check what's applicable (multiple answers possible):

  • Installed via installer
  • Installed manually
  • Problem occurs in HASS.Agent
  • Problem occurs in Satellite Service
@robertoleonardo robertoleonardo added the bug Something isn't working label May 2, 2024
@amadeo-alex
Copy link
Collaborator

amadeo-alex commented May 3, 2024

That is strange, first thing that comes to my mind is that notifications for forked HASS.Agent version may be disabled in windows settings (Settings->Notifications and actions) but then it produces something like this:

2024-05-03 11:26:27.298 +02:00 [WRN] [NOTIFIER] Showing notifications might fail, reason: DisabledForApplication

The difference between original and forked version is LAB02-Research#18 (notification library change from "UWP.Toolkit" to "Windows APP SDK") - some users experienced silent crashes on some Windows 11 versions with UWP.Tookit.

Did you do any kind of modification to your systems? (privacy scripts etc)
Are you running the HASS.Agent in elevated/admin mode by any chance? (microsoft/WindowsAppSDK#3816)

@robertoleonardo
Copy link
Author

robertoleonardo commented May 3, 2024 via email

@amadeo-alex
Copy link
Collaborator

Additional link regarding the elevated/admin programs and app sdk notifications - https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/notifications/app-notifications/app-notifications-quickstart?tabs=cs
Zp6oxW

@robertoleonardo
Copy link
Author

ah ha - your ideas made me remember: i have UAC disabled. i just reenabled and rebooted and, sure enough, notifications work. good call.

that's a bummer - i cannot stand UAC and, given the choice between living with the stale version of hass.agent or keeping uac enabled for notifications, i'm going to choose to stay with the old hass.agent.

we've reached the outer limits of my technical know-how so i have no idea -- is this just something that's never gonna change and i'm going to have to live with it, or might there be a way for notifications to be made to work without forcing me to keep uac enabled?

@amadeo-alex
Copy link
Collaborator

The question if it's not going to change can be separated into two:

  1. Is m$ going to support notifications in elevated application? (just to be clear, I find the restriction laughable but I've learned that sometimes they just don't give)
  2. Is HASS.Agent (we as a fork) going to handle it somehow? This is a longer answer, the only way I can see it happening is for me to abstract all notification code and then have both "UWP.Toolkit" and "Windows APP SDK" as a selectable option for the users. This however is simpler said than done not mentioning that most likely there won't ba a feature parity between those two - TL;DR: time & effort

There is however other option you can try. There are ways to launch program as "non-elevated" but I don't think those will work with UAC disabled.

One more thing that comes to my mind, can you right click the "HASS.Agent.exe" (not the shortcut), then "Properties", "Compatibility" and see if the "Run as administrator" is checked?

@robertoleonardo
Copy link
Author

robertoleonardo commented May 3, 2024 via email

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