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

Hass agent stopped working after upgrading to 2024.5.1 - dont see the devices under mqtt anymore #50

Open hauserpro opened 2 months ago

hauserpro commented 2 months ago

2024-05-06 11:23:59.553 WARNING (SyncWorker_26) [homeassistant.helpers.frame] Detected that custom integration 'hass_agent' calls async_update_device from a thread 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 2024-05-06 11:23:59.555 ERROR (SyncWorker_26) [homeassistant.util.logging] Exception in updated when handling msg on 'hass.agent/devices/pc-name': '{"serial_number":"xxxxxxxx","device":{"identifiers":"hass.agent-pc-name","manufacturer":"LAB02 Research","model":"Microsoft Windows NT 10.0.22631.0","name":"pc-name","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 758, in async_get_or_create device = self.async_update_device( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 907, in async_update_device self.hass.verify_event_loop_thread("async_update_device") File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread frame.report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'hass_agent' calls async_update_device from a thread 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. hass agent issue pic 1 hass agent issue pic 2

bewa58 commented 2 months ago

Logger: homeassistant.config_entries Quelle: config_entries.py:772 Erstmals aufgetreten: 14:48:33 (1 Vorkommnisse) Zuletzt protokolliert: 14:48:33

Error unloading entry DESKTOP-5K5PF4L for hass_agent Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 772, in async_unload result = await component.async_unload_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/hass_agent/init.py", line 203, in async_unload_entry return unload_ok ^^^^^^^^^ UnboundLocalError: cannot access local variable 'unload_ok' where it is not associated with a value

jonny190 commented 2 months ago

Could it be related to the below event when restarting the agent?

2024-05-07 10:37:57.061 ERROR (SyncWorker_23) [homeassistant.util.logging] Exception in updated when handling msg on 'hass.agent/devices/{Redacted}': '{"serial_number":"{Redacted}","device":{"identifiers":"hass.agent-{Redacted}","manufacturer":"LAB02 Research","model":"Microsoft Windows NT 10.0.19045.0","name":"{Redacted}","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 147, in updated
    hass.async_create_task(handle_apis_changed(hass, entry, apis))
  File "/usr/src/homeassistant/homeassistant/core.py", line 816, in async_create_task
    self.verify_event_loop_thread("async_create_task")
  File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread
    frame.report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report
    _report_integration(what, integration_frame, level, error_if_integration)
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration
    raise RuntimeError(
RuntimeError: Detected that custom integration 'hass_agent' calls async_create_task from a thread at custom_components/hass_agent/__init__.py, line 147: hass.async_create_task(handle_apis_changed(hass, entry, apis)). Please report it to the author of the 'hass_agent' custom integration.
jonny190 commented 2 months ago

Looks to have been flagged under https://github.com/LAB02-Research/HASS.Agent-Integration/issues/46 and quick fix under https://github.com/LAB02-Research/HASS.Agent-Integration/issues/47#issuecomment-2090454867