GamerClassN7 / HA_Desktop_Companion

App which is using native HA Api to comunicate and report data to HA
52 stars 5 forks source link

Device not connected to local push notifications #85

Closed myokeeh closed 2 months ago

myokeeh commented 2 months ago

Describe the Bug

Thanks for this app! FYI, when the app is offline, HA 'notify.notify' will result in error 'Device not connected to local push notifications'

https://community.home-assistant.io/t/device-not-connected-to-local-push-notifications/754563/1

Steps to Reproduce

Setup the app (Edit:) Quit the app (right click menu) in HA, send a notification in the HA developer/debug tool ('notify.notify') OR in an automation in HA, send a notification ('notify.notify')

Expected Behaviour

I hope the app can be setup so that when it's offline, it gets excluded so it doesn't cause automations/notifications to fail. I'm still new to HA, so there might be a way to do it on that side that I haven't discovered yet.

Version

1.0.0.4

GamerClassN7 commented 2 months ago

Describe the Bug

Thanks for this app! FYI, when the app is offline, HA 'notify.notify' will result in error 'Device not connected to local push notifications'

https://community.home-assistant.io/t/device-not-connected-to-local-push-notifications/754563/1

Steps to Reproduce

Setup the app in HA, send a notification in the HA developer/debug tool ('notify.notify') OR in an automation in HA, send a notification ('notify.notify')

Expected Behaviour

I hope the app can be setup so that when it's offline, it gets excluded so it doesn't cause automations/notifications to fail. I'm still new to HA, so there might be a way to do it on that side that I haven't discovered yet.

Version

1.0.0.4

Hmm 🤔 I am just using native API. I am not sure if I can do something about it, can you verify that the official companion app doesn't have the same behavior ?

myokeeh commented 2 months ago

Oops. I forgot the crucial step which is to make sure the app is not running or simply turning off the PC.

GamerClassN7 commented 2 months ago

@myokeeh it doesn't matter if you force shutdown or close the app, i am asking if you have similar experience when you force close companion app on your Phone for example. Since even my companion app uses same API. if your mobile companion app have exact same behavior i cant do anything about it since API is provided by Home Assistant developers

myokeeh commented 2 months ago

Just tested a few scenarios:

For the following three, I disabled the PC/laptop under the "Mobile App" integration in HA.

When I reenable the PC/laptop under "Mobile App" and sent the test notification, the error came back. The PC/laptop is currently off.

GamerClassN7 commented 2 months ago

Just tested a few scenarios:

For the following three, I disabled the PC/laptop under the "Mobile App" integration in HA.

  • iPhone completely off. Sent the test notification. No error.
  • iPhone companion app force quit. Sent the test notification. No error.
  • iPhone in airplane mode. Sent the test notification. No error.

When I reenable the PC/laptop under "Mobile App" and sent the test notification, the error came back. The PC/laptop is currently off.

Ok, I will try to look in to the issue but there is not much documentation around native API ;)

GamerClassN7 commented 2 months ago

Just tested a few scenarios: For the following three, I disabled the PC/laptop under the "Mobile App" integration in HA.

  • iPhone completely off. Sent the test notification. No error.
  • iPhone companion app force quit. Sent the test notification. No error.
  • iPhone in airplane mode. Sent the test notification. No error.

When I reenable the PC/laptop under "Mobile App" and sent the test notification, the error came back. The PC/laptop is currently off.

Ok, I will try to look in to the issue but there is not much documentation around native API ;)

After investigation, there is nothing i can do about it since my app is using native WS notifications, not the cloud one as Android/iphone (Firebase, ACM), and due to luck of documentation, there is nothing i can do about it, but i tryed to test it in notification scenario there is error in log "YES" but that is all automation run as usual, all other devices receive notification and Automation is successfully run. So without better documentation for Notifications in HA i have no choice than close the issue. you can try to contact HA devs if they can share some light on it.

https://developers.home-assistant.io/docs/api/native-app-integration/notifications/

Sorry :(

GamerClassN7 commented 2 months ago

Unable to resolve

myokeeh commented 2 months ago

Thanks for following up.