LAB02-Research / HASS.Agent-Integration

HASS.Agent's Home Assistant integration. Adds notifications and mediaplayer capabilities to HASS.Agent - a Windows based client (companion app) for Home Assistant.
MIT License
101 stars 17 forks source link

2033 #52

Closed sebastianjshaw closed 3 weeks ago

sebastianjshaw commented 1 month ago

I'm getting a reoccuring error in my Home Assistant Logs. I'm on 2022.11.9 of the HACS integration and 2022.14.0 of the HASS.Agent Windows client.

`Logger: homeassistant.util.logging
Source: util/logging.py:95
First occurred: 09:13:30 (18 occurrences)
Last logged: 09:22:01

Exception in updated when handling msg on 'hass.agent/devices/DESKTOP': '{"serial_number":"xxxx","device":{"identifiers":"hass.agent-DESKTOP","manufacturer":"LAB02 Research","model":"Microsoft Windows NT 10.0.19045.0","name":"DESKTOP","sw_version":"2022.14.0"},"apis":{"notifications":true,"media_player":false}}' Traceback (most recent call last): File "/config/custom_components/hass_agent/__init__.py", line 144, in updated update_device_info(hass, entry, payload) File "/config/custom_components/hass_agent/__init__.py", line 29, in update_device_info device_registry.async_get_or_create( File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 760, in async_get_or_create device = self.async_update_device( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 919, in async_update_device self.hass.verify_event_loop_thread("device_registry.async_update_device") File "/usr/src/homeassistant/homeassistant/core.py", line 447, in verify_event_loop_thread frame.report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 159, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 197, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'hass_agent' calls device_registry.async_update_device from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#device_registryasync_update_device at custom_components/hass_agent/__init__.py, line 29: device_registry.async_get_or_create(. Please report it to the author of the 'hass_agent' custom integration.`

Any ideas on how to resolve?

3mta3 commented 1 month ago

EDIT: Appears this integration is no longer maintained, but has been forked - issue appears resolved in the new repository. I followed the instructions to install the 2.x windows agent and HACS integration from the fork: https://github.com/hass-agent

Same issue here. Tried uninstalling the HACS integration, reboot, reinstall, error persists. Suspect a breaking change in a recentish HASS update. FWIW I'm running Home Assistant Core 2024.6.4 in a Docker container on Ubuntu 22.04.4.

Logger: homeassistant.util.logging
Source: util/logging.py:95
First occurred: 12:32:58 PM (6 occurrences)
Last logged: 12:33:57 PM

Exception in updated when handling msg on 'hass.agent/devices/OfficePC': '{"serial_number":"xxxx","device":{"identifiers":"hass.agent-OfficePC","manufacturer":"LAB02 Research","model":"Microsoft Windows NT 10.0.22631.0","name":"OfficePC","sw_version":"2022.14.0"},"apis":{"notifications":true,"media_player":true}}' Traceback (most recent call last): File "/config/custom_components/hass_agent/__init__.py", line 144, in updated update_device_info(hass, entry, payload) File "/config/custom_components/hass_agent/__init__.py", line 29, in update_device_info device_registry.async_get_or_create( File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 760, in async_get_or_create device = self.async_update_device( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 919, in async_update_device self.hass.verify_event_loop_thread("device_registry.async_update_device") File "/usr/src/homeassistant/homeassistant/core.py", line 447, in verify_event_loop_thread frame.report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 159, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 197, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'hass_agent' calls device_registry.async_update_device from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#device_registryasync_update_device at custom_components/hass_agent/__init__.py, line 29: device_registry.async_get_or_create(. Please report it to the author of the 'hass_agent' custom integration.
sebastianjshaw commented 3 weeks ago

Thanks! I've upgraded (sidegraded?) to the fork as well and it all seems resolved. Thanks!

sebastianjshaw commented 3 weeks ago

Closing as resolution described