HASS.Agent-Integration icon indicating copy to clipboard operation
HASS.Agent-Integration copied to clipboard

HASS.Agent no longer sends notifications after updating to Home Assistant Core 2024.5.0

Open peterskajr opened this issue 1 year ago • 22 comments

After updating Home Assistant to Home Assistant Core 2024.5.0, lost the ability to send notifications back to the Windows PC. The Test Notification button in the HASS Configuration page still sent the test notification, but any automations that were previously written to send notifications no longer worked. The pc no longer showed up as a service: notifiy.windowspc option. Reverting back my Home Assistant to the previous version of 2024.4.4 restored the HASS.Agent notifications.

peterskajr avatar May 01 '24 23:05 peterskajr

Can it be related to https://developers.home-assistant.io/blog/2024/04/10/new-notify-entity-platform/?

rrozema avatar May 02 '24 05:05 rrozema

Also media player doesn't work anymore - it's unavailable (in all 3 of my instances). EDIT: i just went back to 2024.4.x, all works again. So problem is indeed 2024.5 HA

Protoncek avatar May 02 '24 07:05 Protoncek

Same, after the update got a bunch of repairs, hass.agent notification not available anymore...

atax112 avatar May 02 '24 07:05 atax112

Same for me, Media Player unavailable after updating to 2024.5

WizGnome avatar May 02 '24 09:05 WizGnome

Since author of this addon doesn't actively work on this (latest version is 2022) i think that probably doesn't read these issues also. So, i found a solution on a more recent fork of hass agent: https://github.com/hass-agent/HASS.Agent-Integration/issues/2 (corrected link) After this manual modification all works again.

Protoncek avatar May 02 '24 12:05 Protoncek

Since author of this addon doesn't actively work on this (latest version is 2022) i think that probably doesn't read these issues also. So, i found a solution on a more recent fork of hass agent: https://github.com/hass-agent/HASS.Agent-Integration/issues/2 After this manual modification all works again.

Hey, I guess the link is wrong? Doesnt point to what you mean... Edit: the text was ok, the link not...

https://github.com/hass-agent/HASS.Agent-Integration/issues/2

Ok, so, quick&dirty fix for anyone that can/wants edit the files manually :D

Navigate to "/config/custom_components/hass_agent" - either inside the container or via some editor when using the supervisor enabled HA. Edit "init.py" file (for example "vi init.py") Add "async" in following places: a) line 27: "async def update_device_info(hass: HomeAssistant, entry: ConfigEntry, new_device_info):" b) line 139: "async def updated(message: ReceiveMessage):" Add "await" in following places: a) line 144: "await update_device_info(hass, entry, payload)" Restart Home Assistant What I did was do the above changes on version lower than 2024.5.0, confirmed that notifications and media player are working, then I upgraded to 2024.5.0 and tested the same - appears to work as expected.

image

atax112 avatar May 02 '24 13:05 atax112

Yeah, figured it out in the meantime, updated my comment with the linked potential fix. Many thanks @Protoncek !

atax112 avatar May 02 '24 13:05 atax112

Thanks for correction...

Protoncek avatar May 02 '24 13:05 Protoncek

Did the steps above, I can confirm working!

atax112 avatar May 02 '24 13:05 atax112

Thanks to everyone! I'm very sorry that this plugin is not progressing further :( I'm afraid of what will happen if a more serious problem comes.

v1k70rk4 avatar May 02 '24 15:05 v1k70rk4

Thanks to everyone! I'm very sorry that this plugin is not progressing further :( I'm afraid of what will happen if a more serious problem comes.

Seems like it will be continued here https://github.com/hass-agent

zanix avatar May 02 '24 17:05 zanix

Confirmed fix suggested by atax112 works.

Axsgranted avatar May 03 '24 02:05 Axsgranted

I think line 124 also needs an 'await'

    await update_device_info(hass, entry, response_json)

Failure404 avatar May 04 '24 19:05 Failure404

Confirmed fix suggested by atax112 works.

jonny190 avatar May 07 '24 09:05 jonny190

Since author of this addon doesn't actively work on this (latest version is 2022) i think that probably doesn't read these issues also. So, i found a solution on a more recent fork of hass agent: https://github.com/hass-agent/HASS.Agent-Integration/issues/2 After this manual modification all works again.

Hey, I guess the link is wrong? Doesnt point to what you mean... Edit: the text was ok, the link not...

hass-agent/HASS.Agent-Integration#2 (comment)

Ok, so, quick&dirty fix for anyone that can/wants edit the files manually :D

Navigate to "/config/custom_components/hass_agent" - either inside the container or via some editor when using the supervisor enabled HA. Edit "init.py" file (for example "vi init.py") Add "async" in following places: a) line 27: "async def update_device_info(hass: HomeAssistant, entry: ConfigEntry, new_device_info):" b) line 139: "async def updated(message: ReceiveMessage):" Add "await" in following places: a) line 144: "await update_device_info(hass, entry, payload)" Restart Home Assistant What I did was do the above changes on version lower than 2024.5.0, confirmed that notifications and media player are working, then I upgraded to 2024.5.0 and tested the same - appears to work as expected.

image

Very dangerous for someone like me without any background on coding... I think I will have to wait for a fix in Agent :(

CT2HUU avatar May 07 '24 22:05 CT2HUU

No particular danger here: open studio code server (if you don't have it install it from addons), find file "init.py" in folder, specified above, then

  • right-click on it and click CTRL+C, followed by CTRL+V. A new file with "__ copy.py" will appear. That way you made a copy of original.
  • made above changes and restart HA

Worst thing it can happen is that hass.agent still won't work, but HA will - in this case:

  • see what you did wrong, correct and restart again.

But, if you'd like to go back to original:

  • delete "init.py" you just changed
  • click on copy you made eariler
  • press F2 and delete part "_copy" at the end of file. Make sure that you don't delete .py
  • restart HA again and you're back on original Since without these changes thing doesn't work you have nothing to loose trying, right?

Protoncek avatar May 08 '24 05:05 Protoncek

No particular danger here: open studio code server (if you don't have it install it from addons), find file "init.py" in folder, specified above, then

  • right-click on it and click CTRL+C, followed by CTRL+V. A new file with "__ copy.py" will appear. That way you made a copy of original.
  • made above changes and restart HA

Worst thing it can happen is that hass.agent still won't work, but HA will - in this case:

  • see what you did wrong, correct and restart again.

But, if you'd like to go back to original:

  • delete "init.py" you just changed
  • click on copy you made eariler
  • press F2 and delete part "_copy" at the end of file. Make sure that you don't delete .py
  • restart HA again and you're back on original Since without these changes thing doesn't work you have nothing to loose trying, right?

ok, I will give it a try. thanks for the step by step procedure.

CT2HUU avatar May 12 '24 11:05 CT2HUU

Since author of this addon doesn't actively work on this (latest version is 2022) i think that probably doesn't read these issues also. So, i found a solution on a more recent fork of hass agent: https://github.com/hass-agent/HASS.Agent-Integration/issues/2 After this manual modification all works again.

Hey, I guess the link is wrong? Doesnt point to what you mean... Edit: the text was ok, the link not...

hass-agent#2

Ok, so, quick&dirty fix for anyone that can/wants edit the files manually :D

Navigate to "/config/custom_components/hass_agent" - either inside the container or via some editor when using the supervisor enabled HA. Edit "init.py" file (for example "vi init.py") Add "async" in following places: a) line 27: "async def update_device_info(hass: HomeAssistant, entry: ConfigEntry, new_device_info):" b) line 139: "async def updated(message: ReceiveMessage):" Add "await" in following places: a) line 144: "await update_device_info(hass, entry, payload)" Restart Home Assistant What I did was do the above changes on version lower than 2024.5.0, confirmed that notifications and media player are working, then I upgraded to 2024.5.0 and tested the same - appears to work as expected.

image

I followed this and it worked. But in my case, the file "init__.py" is called "init.py" so I tried to rename it to "init__.py" and do the changes+restart and it didn't worked, then I rename it to "__init.py" with the changes +restart and it worked. No idea why mine has a diferent name, but it is working. Thanks for the backup tip @Protoncek and thanks for the guide/solution @atax112

CT2HUU avatar May 12 '24 22:05 CT2HUU

Since author of this addon doesn't actively work on this (latest version is 2022) i think that probably doesn't read these issues also. So, i found a solution on a more recent fork of hass agent: https://github.com/hass-agent/HASS.Agent-Integration/issues/2 After this manual modification all works again.

Hey, I guess the link is wrong? Doesnt point to what you mean... Edit: the text was ok, the link not... hass-agent#2

Ok, so, quick&dirty fix for anyone that can/wants edit the files manually :D

Navigate to "/config/custom_components/hass_agent" - either inside the container or via some editor when using the supervisor enabled HA. Edit "init.py" file (for example "vi init.py") Add "async" in following places: a) line 27: "async def update_device_info(hass: HomeAssistant, entry: ConfigEntry, new_device_info):" b) line 139: "async def updated(message: ReceiveMessage):" Add "await" in following places: a) line 144: "await update_device_info(hass, entry, payload)" Restart Home Assistant What I did was do the above changes on version lower than 2024.5.0, confirmed that notifications and media player are working, then I upgraded to 2024.5.0 and tested the same - appears to work as expected.

image

I followed this and it worked. But in my case, the file "init__.py" is called "init.py" so I tried to rename it to "init__.py" and do the changes+restart and it didn't worked, then I rename it to "__init.py" with the changes +restart and it worked. No idea why mine has a diferent name, but it is working. Thanks for the backup tip @Protoncek and thanks for the guide/solution @atax112

The fork has these fixes, it requires removing this integration and adding the new one. https://github.com/hass-agent/HASS.Agent-Integration

zanix avatar May 13 '24 03:05 zanix

Not only fork is fixed, but also actively supported, seems like. Moving to it.

formatBCE avatar May 25 '24 04:05 formatBCE

Question for the more advanced users out there like @formatBCE and @zanix. How do I implement the fork in HA? What is the forcing function to pull from the fork instead of the HACS store?

TrackingSolo avatar Jan 14 '25 10:01 TrackingSolo

Question for the more advanced users out there like @formatBCE and @zanix. How do I implement the fork in HA? What is the forcing function to pull from the fork instead of the HACS store?

In HACS, click three dots on top right, choose Custom repositories. In opened window paste URL to fork GitHub and choose "Integration" in drop-down. Click Add. After that the integration will be available for installation. Search in main window for Hass agent and pick forked one.

formatBCE avatar Jan 14 '25 13:01 formatBCE