LAB02-Research / HASS.Agent

Windows-based client for Home Assistant. Provides notifications, quick actions, commands, sensors and more.
https://hassagent.lab02-research.org
MIT License
1.57k stars 68 forks source link

Notifications don't work on windows #289

Open try4cou opened 1 year ago

try4cou commented 1 year ago

Hi,

I'm using Hass.Agent latest version and I can't set up notifications on my computer. I can't even send a test notification on my windows 11 pc. Notifications are allowed in windows settings.

My log contains the following error:

2023-03-10 11:39:39.301 +01:00 [INF] [NOTIFIER] Attempting to show test notification .. 2023-03-10 11:39:39.314 +01:00 [INF] [NOTIFIER] Test notification attempt completed 2023-03-10 11:39:57.996 +01:00 [FTL] [PROGRAM] FirstChanceException: Unable to read data from the transport connection: Az I/O művelet megszakítva. (Egy folyamat véget ért, vagy egy alkalmazás megszakította az I/O műveletet.). System.IO.IOException: Unable to read data from the transport connection: Az I/O művelet megszakítva. (Egy folyamat véget ért, vagy egy alkalmazás megszakította az I/O műveletet.). ---> System.Net.Sockets.SocketException (995): Az I/O művelet megszakítva. (Egy folyamat véget ért, vagy egy alkalmazás megszakította az I/O műveletet.) --- End of inner exception stack trace --- at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory`1 buffer)

Please help me to solve this issue.

Your help thanks in advance, Andy

jack5mikemotown commented 1 year ago

I am running into the same isue. I get the following error on startup:

System.InvalidOperationException: Failed initializing notifications
 ---> System.IO.IOException: Det går inte att skapa en stabil underordnad nyckel till en temporär överordnad nyckel.
   at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
   at Microsoft.Win32.RegistryKey.CreateSubKeyInternalCore(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions registryOptions)
   at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions registryOptions)
   at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey)
   at Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat.Initialize()
   at Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat.CreateToastNotifier()
   at HASS.Agent.Managers.NotificationManager.Initialize()

When I press the test notification button, I get

2023-05-02 00:53:30.677 -04:00 [INF] [NOTIFIER] Test notification attempt completed

But despite this, no notification ever shows up

logicland commented 1 year ago

Was pretty much getting the same errors as @try4cou the key was (I believe) [NOTIFIER] Notification failed to show: Settings prevent the notification type from being delivered. (0x803E0114) followed later by 2023-05-16 15:24:22.172 +01:00 [FTL] [PROGRAM] FirstChanceException: Element not found. (0x80070490)

Turned out I had Windows "Get notifications from apps and other senders" turned-off in "Notifications & actions" oddly although Hass Agent "Show Test Notification" failed to appear the sound could still be heard.

Might be worth checking "Notifications & actions"