Closed realthk closed 1 year ago
Same problem for me, here's some DEBUG logs with a stacktrace:
2023-03-11 11:49:21.143701 INFO HASS: Connected to Home Assistant 2023.3.3
2023-03-11 11:49:21.144109 DEBUG AppDaemon: thread_async loop, args={'function': <bound method Events.process_event of <appdaemon.events.Events object at 0x7f44abd8d960>>, 'args': ('admin', {'event_type': '__AD_LOG_EVENT', 'data': {'level': 'INFO', 'app_name': 'HASS', 'message': 'Connected to Home Assistant 2023.3.3', 'type': 'log', 'log_type': 'main_log', 'asctime': '2023-03-11 11:49:21.143766', 'ts': datetime.datetime(2023, 3, 11, 11, 49, 21, 143556), 'formatted_message': '2023-03-11 11:49:21.143766 INFO HASS: Connected to Home Assistant 2023.3.3'}}), 'kwargs': {}}
2023-03-11 11:49:21.144732 DEBUG AppDaemon: Event type:__AD_LOG_EVENT:
2023-03-11 11:49:21.144966 DEBUG AppDaemon: {'level': 'INFO', 'app_name': 'HASS', 'message': 'Connected to Home Assistant 2023.3.3', 'type': 'log', 'log_type': 'main_log', 'asctime': '2023-03-11 11:49:21.143766', 'ts': datetime.datetime(2023, 3, 11, 11, 49, 21, 143556), 'formatted_message': '2023-03-11 11:49:21.143766 INFO HASS: Connected to Home Assistant 2023.3.3'}
2023-03-11 11:49:21.145188 DEBUG AppDaemon: process_event_callbacks() admin {'event_type': '__AD_LOG_EVENT', 'data': {'level': 'INFO', 'app_name': 'HASS', 'message': 'Connected to Home Assistant 2023.3.3', 'type': 'log', 'log_type': 'main_log', 'asctime': '2023-03-11 11:49:21.143766', 'ts': datetime.datetime(2023, 3, 11, 11, 49, 21, 143556), 'formatted_message': '2023-03-11 11:49:21.143766 INFO HASS: Connected to Home Assistant 2023.3.3'}}
2023-03-11 11:49:21.145492 DEBUG AppDaemon: thread_async loop, args={'function': <bound method ADStream.process_event of <appdaemon.stream.adstream.ADStream object at 0x7f44ab2cc370>>, 'args': ({'event_type': '__AD_LOG_EVENT', 'data': {'level': 'INFO', 'app_name': 'HASS', 'message': 'Connected to Home Assistant 2023.3.3', 'type': 'log', 'log_type': 'main_log', 'asctime': '2023-03-11 11:49:21.143766', 'formatted_message': '2023-03-11 11:49:21.143766 INFO HASS: Connected to Home Assistant 2023.3.3'}, 'namespace': 'admin'},), 'kwargs': {}}
2023-03-11 11:49:21.147954 DEBUG HASS: get_ha_config()
2023-03-11 11:49:21.148085 DEBUG HASS: get_ha_config: url is /api/config
2023-03-11 11:49:21.148372 WARNING HASS: Error getting metadata - retrying: Only absolute URLs without path part are supported
2023-03-11 11:49:21.148538 DEBUG AppDaemon: Clearing callbacks for HASS
2023-03-11 11:49:21.148658 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2023-03-11 11:49:21.148794 DEBUG HASS: ------------------------------------------------------------
2023-03-11 11:49:21.148935 DEBUG HASS: Unexpected error:
2023-03-11 11:49:21.149037 DEBUG HASS: ------------------------------------------------------------
2023-03-11 11:49:21.149257 DEBUG HASS: Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py", line 343, in get_updates
self.metadata = await self.get_hass_config()
File "/usr/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py", line 700, in get_hass_config
r = await self.session.get(api_url)
File "/usr/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py", line 118, in session
self._session = aiohttp.ClientSession(
File "/usr/lib/python3.10/site-packages/aiohttp/client.py", line 235, in __init__
self._base_url.origin() == self._base_url
AssertionError: Only absolute URLs without path part are supported```
Digging into it, the latest AppDaemon passes base_url
to aiohttp.ClientSession
:
base_url
should be a URL without path:
However the addon sets ha_url = "http://supervisor/core"
, causing the above check to fail.
A workaround is to generate an access token and pass ha_url
and token
manually in appdaemon.yaml
, as described here.
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
Problem/Motivation
Updating to 4.2.3 (425810d) breaks my Appdaemon-HAOS connection. Appdaemon cannot read HA config, log entry is produced every 5 seconds:
I believe this must coming be from this line: https://github.com/AppDaemon/appdaemon/blob/dev/appdaemon/plugins/hass/hassplugin.py#L750 which is strange, according to the doc of this addon, there is no need for
ha_url
andtoken
options, so I don't have those in my appdaemon config, only this:(and this was enough for version 4.2.1 indeed. After restoring backup of 1d6ea93 it works again)