AppDaemon 4.5.11 constantly disconnects from HA Core 2025.7.1 with "TypeError: argument of type 'NoneType' is not iterable"
What happened?
Umgebungsinformationen:
- AppDaemon Add-on Version: 0.17.7 (AppDaemon 4.5.11)
- Home Assistant OS Version: 16.0 (amd64 / generic-x86-64)
- Home Assistant Core Version: 2025.7.1
- Home Assistant Supervisor Version: 2025.07.1
- Host-System: Dedizierter Intel NUC (läuft unter Proxmox, aber HA OS ist direkt auf dem NUC installiert).
- Python Version: 3.12.11 (aus AppDaemon Log)
Problembeschreibung:
Das AppDaemon Add-on startet erfolgreich, verbindet sich mit Home Assistant Core und authentifiziert sich. Kurz danach trennt es die Verbindung mit WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds und einem ClientConnectionResetError. Dieser Zyklus wiederholt sich ständig, wodurch AppDaemon unbrauchbar ist.
Im Log ist zu sehen, dass diesen Disconnects regelmäßig ein TypeError: argument of type 'NoneType' is not iterable vorausgeht. Dieser TypeError tritt in der internen AppDaemon-Logik (specifically in appdaemon/state.py bei entity_exists) auf, wenn versucht wird, einen state_changed-Event zu verarbeiten.
Es scheint sich nicht um ein Problem mit einer spezifischen Entität zu handeln, da der TypeError durch verschiedene Entitäten ausgelöst wurde (z.B. sensor.ann_kathrin_15_buetooth_distance, sensor.mi_hub_undefinedtype_singleton, sensor.shellyplug_s_80646f83ea7c_power). Dies deutet auf ein generelles Timing- oder Initialisierungsproblem in AppDaemon bei der Verarbeitung von state_changed-Events beim Start oder Reconnect hin, bei dem die interne Status-Struktur temporär inkonsistent ist (NoneType statt eines iterierbaren Objekts).
Bereits durchgeführte Fehlerbehebungsschritte (ohne Erfolg):
- Kompletter Neustart des Home Assistant Host-Systems (NUC).
- AppDaemon Add-on deinstalliert und neu installiert.
- Neues Long-Lived Access Token für AppDaemon generiert und in der Add-on-Konfiguration hinterlegt.
-
ha_urlinappdaemon.yamlwurde testweise aufhttp://supervisor/coregeändert und auch komplett auskommentiert, um die automatische Erkennung zu nutzen – Problem bleibt bestehen. - Die
app_init_delay,appdaemon_startup_conditionsundplugin_startup_conditionswurden inappdaemon.yamlschrittweise erhöht (bis zu 60/45/30 Sekunden) – Problem bleibt bestehen. - Temporäre Deaktivierung der im Log genannten Entitäten (
sensor.ann_kathrin_15_buetooth_distance,sensor.mi_hub_undefinedtype_singleton,sensor.shellyplug_s_80646f83ea7c_power) – derTypeErrorwird dann von anderen Entitäten ausgelöst, das Problem bleibt bestehen.
appdaemon.yaml Konfiguration:
appdaemon:
latitude: 50.1833
longitude: 8.4833
elevation: 350
time_zone: Europe/Berlin
plugins:
HASS:
type: hass
# ha_url: [http://10.0.0.157:8123](http://10.0.0.157:8123) # Diese Zeile wurde testweise auskommentiert
token: !secret appdaemon_token # Token ist korrekt und aktuell
retry_secs: 10
ws_timeout: 30
app_init_delay: 20 # Ursprünglicher Wert, wurde testweise erhöht
appdaemon_startup_conditions:
delay: 15 # Ursprünglicher Wert, wurde testweise erhöht
event:
event_type: homeassistant_started
plugin_startup_conditions:
delay: 10 # Ursprünglicher Wert, wurde testweise erhöht
event:
event_type: homeassistant_started
### Version
4.5.11
### Installation type
Home Assistant add-on
### Relevant log output
```sh
Home Assistant Supervisor: 2025.07.1
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-appdaemon: starting
s6-rc: info: service init-appdaemon successfully started
s6-rc: info: service appdaemon: starting
s6-rc: info: service appdaemon successfully started
s6-rc: info: service legacy-services: starting
[09:54:12] INFO: Starting AppDaemon...
s6-rc: info: service legacy-services successfully started
2025-07-11 09:54:17.777698 INFO AppDaemon: ------------------------------------------------------------
2025-07-11 09:54:17.778293 INFO AppDaemon: AppDaemon Version 4.5.11 starting
2025-07-11 09:54:17.778466 INFO AppDaemon: ------------------------------------------------------------
2025-07-11 09:54:17.778599 INFO AppDaemon: Python version is 3.12.11
2025-07-11 09:54:17.779028 INFO AppDaemon: Configuration read from: /config/appdaemon.yaml
2025-07-11 09:54:17.779260 INFO AppDaemon: Added log: AppDaemon
2025-07-11 09:54:17.779409 INFO AppDaemon: Added log: Error
2025-07-11 09:54:17.779529 INFO AppDaemon: Added log: Access
2025-07-11 09:54:17.779635 INFO AppDaemon: Added log: Diag
2025-07-11 09:54:17.780638 INFO AppDaemon: Using /config/apps as app_dir
2025-07-11 09:54:17.782063 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module appdaemon.plugins.hass.hassplugin
2025-07-11 09:54:17.782394 INFO HASS: HASS Plugin initialization complete
2025-07-11 09:54:17.789778 INFO AppDaemon: HTTP configured but no consumers are configured - disabling
2025-07-11 09:54:17.792939 WARNING AppDaemon: No apps found in /config/apps. This is probably a mistake
2025-07-11 09:54:17.793507 INFO AppDaemon: Starting Apps with 10 workers and 10 pins
2025-07-11 09:54:17.796125 INFO AppDaemon: Waiting for plugins to be ready
2025-07-11 09:54:17.797255 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:54:17.798275 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:54:17.799351 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:54:17.801398 INFO AppDaemon: All plugins ready
2025-07-11 09:54:17.802672 INFO AppDaemon: Scheduler running in realtime
2025-07-11 09:54:17.807248 INFO AppDaemon: App initialization complete
2025-07-11 09:54:17.887763 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:54:17.889414 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:54:22.890315 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:54:22.891224 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:54:22.892805 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:54:22.991242 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:54:22.993109 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:54:27.856658 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:54:27.857538 INFO HASS: Completed initialization in 5.0s
2025-07-11 09:54:27.997326 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:54:27.998633 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:54:28.000156 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:54:28.082961 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:54:28.084741 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:54:32.958589 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:54:32.959181 INFO HASS: Completed initialization in 5.0s
2025-07-11 09:54:32.960148 INFO AppDaemon: Processing restart for plugin namespace 'default'
2025-07-11 09:54:33.085064 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:54:33.085719 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:54:33.086331 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:54:33.142085 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:54:33.143657 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:54:38.053245 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:54:38.053924 INFO HASS: Completed initialization in 5.0s
2025-07-11 09:54:38.055076 INFO AppDaemon: Processing restart for plugin namespace 'default'
2025-07-11 09:54:38.145045 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:54:38.145657 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:54:38.146303 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:54:38.209715 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:54:38.212155 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:54:43.121044 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:54:43.121743 INFO HASS: Completed initialization in 5.0s
2025-07-11 09:54:43.122729 INFO AppDaemon: Processing restart for plugin namespace 'default'
2025-07-11 09:54:43.213118 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:54:43.213715 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:54:43.214354 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:54:43.266322 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:54:43.267819 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:54:48.187151 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:54:48.187856 INFO HASS: Completed initialization in 5.0s
2025-07-11 09:54:48.188775 INFO AppDaemon: Processing restart for plugin namespace 'default'
2025-07-11 09:54:48.268693 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:54:48.269208 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:54:48.269847 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:54:48.316044 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:54:48.317368 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:54:53.248221 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:54:53.248804 INFO HASS: Completed initialization in 5.0s
2025-07-11 09:54:53.249615 INFO AppDaemon: Processing restart for plugin namespace 'default'
2025-07-11 09:54:53.319607 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:54:53.320125 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:54:53.320803 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:54:53.380015 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:54:53.382349 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:54:58.298659 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:54:58.299438 INFO HASS: Completed initialization in 5.0s
2025-07-11 09:54:58.300346 INFO AppDaemon: Processing restart for plugin namespace 'default'
2025-07-11 09:54:58.382124 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:54:58.383138 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:54:58.383807 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:54:58.418659 WARNING AppDaemon: ------------------------------------------------------------
2025-07-11 09:54:58.419025 WARNING AppDaemon: Unexpected error during process_event()
2025-07-11 09:54:58.419245 WARNING AppDaemon: ------------------------------------------------------------
2025-07-11 09:54:58.420655 WARNING AppDaemon: Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/appdaemon/events.py", line 239, in process_event
self.AD.state.set_state_simple(namespace, entity_id, data["data"]["new_state"])
File "/usr/lib/python3.12/site-packages/appdaemon/state.py", line 780, in set_state_simple
if self.entity_exists(namespace, entity_id):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/appdaemon/state.py", line 473, in entity_exists
return namespace in self.state and entity in self.state[namespace]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
2025-07-11 09:54:58.421191 WARNING AppDaemon: {
"event_type": "state_changed",
"data": {
"entity_id": "button.lumi_v3_1747_info",
"old_state": {
"entity_id": "button.lumi_v3_1747_info",
"state": "2024-12-09T12:40:59.847797+00:00",
"attributes": {
"button.info": "Mi Hub",
"model": "lumi.gateway.v3",
"did": "78244769",
"mac": "78:11:DC:AF:17:47",
"lan_ip": "10.0.0.90",
"app_link": "mihome://device?uid=1725410708&did=78244769",
"miot_type": "urn:miot-spec-v2:device:gateway:0000A019:lumi-v3:2",
"available": true,
"home_room": "Meisenweg 10 Untergescho\u00df Flur",
"icon": "mdi:information",
"updater": "cloud",
"updated_at": "2025-07-11 09:54:43.453329+02:00",
"gateway.guard_mode": false,
"alarm": false,
"alarm.volume": 0,
"light.on": false,
"motion_sensor.illumination": 523,
"state_updater": "cloud",
"state_property": null,
"converters": [
"button.info",
"light.light.on",
"switch.alarm",
"number.alarm.volume",
"sensor.motion_sensor.illumination"
],
"customizes": {},
"info": null,
"device_class": "update",
"friendly_name": "Mi Hub Info"
},
"last_changed": "2025-07-10T20:14:23.641430+00:00",
"last_reported": "2025-07-11T07:54:43.453912+00:00",
"last_updated": "2025-07-11T07:54:43.453912+00:00",
"context": {
"id": "01JZW7NFVX40E2VBV0N3WEBF3A",
"parent_id": null,
"user_id": null
}
},
"new_state": {
"entity_id": "button.lumi_v3_1747_info",
"state": "2024-12-09T12:40:59.847797+00:00",
"attributes": {
"button.info": "Mi Hub",
"model": "lumi.gateway.v3",
"did": "78244769",
"mac": "78:11:DC:AF:17:47",
"lan_ip": "10.0.0.90",
"app_link": "mihome://device?uid=1725410708&did=78244769",
"miot_type": "urn:miot-spec-v2:device:gateway:0000A019:lumi-v3:2",
"available": true,
"home_room": "Meisenweg 10 Untergescho\u00df Flur",
"icon": "mdi:information",
"updater": "cloud",
"updated_at": "2025-07-11 09:54:58.404348+02:00",
"gateway.guard_mode": false,
"alarm": false,
"alarm.volume": 0,
"light.on": false,
"motion_sensor.illumination": 523,
"state_updater": "cloud",
"state_property": null,
"converters": [
"button.info",
"light.light.on",
"switch.alarm",
"number.alarm.volume",
"sensor.motion_sensor.illumination"
],
"customizes": {},
"info": null,
"device_class": "update",
"friendly_name": "Mi Hub Info"
},
"last_changed": "2025-07-10T20:14:23.641430+00:00",
"last_reported": "2025-07-11T07:54:58.404901+00:00",
"last_updated": "2025-07-11T07:54:58.404901+00:00",
"context": {
"id": "01JZW7NYF4KN7WP59SV8VGY4B2",
"parent_id": null,
"user_id": null
}
},
"metadata": {
"time_fired": "2025-07-11T07:54:58.404901+00:00",
"origin": "LOCAL",
"context": {
"id": "01JZW7NYF4KN7WP59SV8VGY4B2",
"parent_id": null,
"user_id": null
}
}
}
}
2025-07-11 09:54:58.421423 WARNING AppDaemon: ------------------------------------------------------------
2025-07-11 09:54:58.440408 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:54:58.442016 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:55:03.357601 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:55:03.358291 INFO HASS: Completed initialization in 5.0s
2025-07-11 09:55:03.359249 INFO AppDaemon: Processing restart for plugin namespace 'default'
2025-07-11 09:55:03.443994 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:55:03.444729 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:55:03.445473 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:55:03.502895 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:55:03.504338 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:55:08.418751 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:55:08.420247 INFO HASS: Completed initialization in 5.0s
2025-07-11 09:55:08.423198 INFO AppDaemon: Processing restart for plugin namespace 'default'
2025-07-11 09:55:08.629706 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:55:08.643430 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:55:08.653928 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:55:08.809053 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:55:08.811616 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:55:13.479790 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:55:13.481256 INFO HASS: Completed initialization in 5.0s
2025-07-11 09:55:13.483885 INFO AppDaemon: Processing restart for plugin namespace 'default'
2025-07-11 09:55:13.813611 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:55:13.816052 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:55:13.817492 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:55:13.985906 WARNING AppDaemon: ------------------------------------------------------------
2025-07-11 09:55:13.986211 WARNING AppDaemon: Unexpected error during process_event()
2025-07-11 09:55:13.986451 WARNING AppDaemon: ------------------------------------------------------------
2025-07-11 09:55:13.987296 WARNING AppDaemon: Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/appdaemon/events.py", line 239, in process_event
self.AD.state.set_state_simple(namespace, entity_id, data["data"]["new_state"])
File "/usr/lib/python3.12/site-packages/appdaemon/state.py", line 780, in set_state_simple
if self.entity_exists(namespace, entity_id):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/appdaemon/state.py", line 473, in entity_exists
return namespace in self.state and entity in self.state[namespace]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
2025-07-11 09:55:13.987811 WARNING AppDaemon: {
"event_type": "state_changed",
"data": {
"entity_id": "sensor.1006761d87a4c738_distance",
"old_state": {
"entity_id": "sensor.1006761d87a4c738_distance",
"state": "2.4",
"attributes": {
"state_class": "measurement",
"current_mac": "48:fe:1b:10:6e:82",
"unit_of_measurement": "m",
"device_class": "distance",
"friendly_name": "Anna-Maria_Bluetooth Distance"
},
"last_changed": "2025-07-11T07:55:09.874449+00:00",
"last_reported": "2025-07-11T07:55:09.874449+00:00",
"last_updated": "2025-07-11T07:55:09.874449+00:00",
"context": {
"id": "01JZW7P9NJE30CR1AAKXZVHYS6",
"parent_id": null,
"user_id": null
}
},
"new_state": {
"entity_id": "sensor.1006761d87a4c738_distance",
"state": "2.5",
"attributes": {
"state_class": "measurement",
"current_mac": "48:fe:1b:10:6e:82",
"unit_of_measurement": "m",
"device_class": "distance",
"friendly_name": "Anna-Maria_Bluetooth Distance"
},
"last_changed": "2025-07-11T07:55:13.887021+00:00",
"last_reported": "2025-07-11T07:55:13.887021+00:00",
"last_updated": "2025-07-11T07:55:13.887021+00:00",
"context": {
"id": "01JZW7PDJZ4F7Y6DNMVH8D18HD",
"parent_id": null,
"user_id": null
}
},
"metadata": {
"time_fired": "2025-07-11T07:55:13.887021+00:00",
"origin": "LOCAL",
"context": {
"id": "01JZW7PDJZ4F7Y6DNMVH8D18HD",
"parent_id": null,
"user_id": null
}
}
}
}
2025-07-11 09:55:13.988050 WARNING AppDaemon: ------------------------------------------------------------
2025-07-11 09:55:13.988391 WARNING AppDaemon: Previous message repeated 1 times
2025-07-11 09:55:13.988610 WARNING AppDaemon: ------------------------------------------------------------
2025-07-11 09:55:13.989395 WARNING AppDaemon: Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/appdaemon/events.py", line 239, in process_event
self.AD.state.set_state_simple(namespace, entity_id, data["data"]["new_state"])
File "/usr/lib/python3.12/site-packages/appdaemon/state.py", line 780, in set_state_simple
if self.entity_exists(namespace, entity_id):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/appdaemon/state.py", line 473, in entity_exists
return namespace in self.state and entity in self.state[namespace]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
2025-07-11 09:55:13.989818 WARNING AppDaemon: {
"event_type": "state_changed",
"data": {
"entity_id": "sensor.ann_kathrin_15_buetooth_distance",
"old_state": {
"entity_id": "sensor.ann_kathrin_15_buetooth_distance",
"state": "2.7",
"attributes": {
"state_class": "measurement",
"current_mac": "41:ee:af:cd:61:c4",
"unit_of_measurement": "m",
"device_class": "distance",
"friendly_name": "Ann-Kathrin_15_Buetooth Distance"
},
"last_changed": "2025-07-11T07:55:07.877319+00:00",
"last_reported": "2025-07-11T07:55:07.877319+00:00",
"last_updated": "2025-07-11T07:55:07.877319+00:00",
"context": {
"id": "01JZW7P7Q52MC8C1CJ5DWV5MHJ",
"parent_id": null,
"user_id": null
}
},
"new_state": {
"entity_id": "sensor.ann_kathrin_15_buetooth_distance",
"state": "2.4",
"attributes": {
"state_class": "measurement",
"current_mac": "41:ee:af:cd:61:c4",
"unit_of_measurement": "m",
"device_class": "distance",
"friendly_name": "Ann-Kathrin_15_Buetooth Distance"
},
"last_changed": "2025-07-11T07:55:13.893520+00:00",
"last_reported": "2025-07-11T07:55:13.893520+00:00",
"last_updated": "2025-07-11T07:55:13.893520+00:00",
"context": {
"id": "01JZW7PDK5KGEDGDZNFGRND5AR",
"parent_id": null,
"user_id": null
}
},
"metadata": {
"time_fired": "2025-07-11T07:55:13.893520+00:00",
"origin": "LOCAL",
"context": {
"id": "01JZW7PDK5KGEDGDZNFGRND5AR",
"parent_id": null,
"user_id": null
}
}
}
}
2025-07-11 09:55:13.990052 WARNING AppDaemon: ------------------------------------------------------------
2025-07-11 09:55:14.019658 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:55:14.021615 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:55:17.804363 WARNING HASS: ------------------------------------------------------------
2025-07-11 09:55:17.804692 WARNING HASS: Unexpected error during websocket send
2025-07-11 09:55:17.804947 WARNING HASS: ------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/appdaemon/utils.py", line 483, in wrapper
result = await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/appdaemon/plugins/hass/hassplugin.py", line 369, in websocket_send_json
await self.ws.send_json(request)
File "/usr/lib/python3.12/site-packages/aiohttp/client_ws.py", line 261, in send_json
await self.send_str(dumps(data), compress=compress)
File "/usr/lib/python3.12/site-packages/aiohttp/client_ws.py", line 245, in send_str
await self._writer.send_frame(
File "/usr/lib/python3.12/site-packages/aiohttp/_websocket/writer.py", line 73, in send_frame
raise ClientConnectionResetError("Cannot write to closing transport")
aiohttp.client_exceptions.ClientConnectionResetError: Cannot write to closing transport
2025-07-11 09:55:17.805273 WARNING HASS: ------------------------------------------------------------
2025-07-11 09:55:17.855855 WARNING HASS: Previous message repeated 1 times
2025-07-11 09:55:17.856142 WARNING HASS: ------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/appdaemon/utils.py", line 483, in wrapper
result = await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/appdaemon/plugins/hass/hassplugin.py", line 369, in websocket_send_json
await self.ws.send_json(request)
File "/usr/lib/python3.12/site-packages/aiohttp/client_ws.py", line 261, in send_json
await self.send_str(dumps(data), compress=compress)
File "/usr/lib/python3.12/site-packages/aiohttp/client_ws.py", line 245, in send_str
await self._writer.send_frame(
File "/usr/lib/python3.12/site-packages/aiohttp/_websocket/writer.py", line 73, in send_frame
raise ClientConnectionResetError("Cannot write to closing transport")
aiohttp.client_exceptions.ClientConnectionResetError: Cannot write to closing transport
2025-07-11 09:55:17.856475 WARNING HASS: ------------------------------------------------------------
2025-07-11 09:55:18.762651 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:55:18.763648 INFO HASS: Completed initialization in 5.0s
2025-07-11 09:55:18.765167 INFO AppDaemon: Processing restart for plugin namespace 'default'
2025-07-11 09:55:19.022166 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:55:19.023004 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:55:19.023972 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:55:19.091216 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:55:19.093406 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:55:22.896536 WARNING HASS: ------------------------------------------------------------
2025-07-11 09:55:22.896916 WARNING HASS: Unexpected error during websocket send
2025-07-11 09:55:22.897189 WARNING HASS: ------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/appdaemon/utils.py", line 483, in wrapper
result = await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/appdaemon/plugins/hass/hassplugin.py", line 369, in websocket_send_json
await self.ws.send_json(request)
File "/usr/lib/python3.12/site-packages/aiohttp/client_ws.py", line 261, in send_json
await self.send_str(dumps(data), compress=compress)
File "/usr/lib/python3.12/site-packages/aiohttp/client_ws.py", line 245, in send_str
await self._writer.send_frame(
File "/usr/lib/python3.12/site-packages/aiohttp/_websocket/writer.py", line 73, in send_frame
raise ClientConnectionResetError("Cannot write to closing transport")
aiohttp.client_exceptions.ClientConnectionResetError: Cannot write to closing transport
2025-07-11 09:55:22.897551 WARNING HASS: ------------------------------------------------------------
2025-07-11 09:55:22.959500 WARNING HASS: Previous message repeated 1 times
2025-07-11 09:55:22.959850 WARNING HASS: ------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/appdaemon/utils.py", line 483, in wrapper
result = await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/appdaemon/plugins/hass/hassplugin.py", line 369, in websocket_send_json
await self.ws.send_json(request)
File "/usr/lib/python3.12/site-packages/aiohttp/client_ws.py", line 261, in send_json
await self.send_str(dumps(data), compress=compress)
File "/usr/lib/python3.12/site-packages/aiohttp/client_ws.py", line 245, in send_str
await self._writer.send_frame(
File "/usr/lib/python3.12/site-packages/aiohttp/_websocket/writer.py", line 73, in send_frame
raise ClientConnectionResetError("Cannot write to closing transport")
aiohttp.client_exceptions.ClientConnectionResetError: Cannot write to closing transport
2025-07-11 09:55:22.960124 WARNING HASS: ------------------------------------------------------------
2025-07-11 09:55:23.910716 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:55:23.911866 INFO HASS: Completed initialization in 4.9s
2025-07-11 09:55:23.913709 INFO AppDaemon: Processing restart for plugin namespace 'default'
2025-07-11 09:55:24.094821 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:55:24.095736 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:55:24.097059 INFO HASS: Waiting for Home Assistant to start
2025-07-11 09:55:24.188179 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2025-07-11 09:55:24.190977 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2025-07-11 09:55:28.004121 WARNING HASS: ------------------------------------------------------------
2025-07-11 09:55:28.004531 WARNING HASS: Unexpected error during websocket send
2025-07-11 09:55:28.004832 WARNING HASS: ------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/appdaemon/utils.py", line 483, in wrapper
result = await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/appdaemon/plugins/hass/hassplugin.py", line 369, in websocket_send_json
await self.ws.send_json(request)
File "/usr/lib/python3.12/site-packages/aiohttp/client_ws.py", line 261, in send_json
await self.send_str(dumps(data), compress=compress)
File "/usr/lib/python3.12/site-packages/aiohttp/client_ws.py", line 245, in send_str
await self._writer.send_frame(
File "/usr/lib/python3.12/site-packages/aiohttp/_websocket/writer.py", line 73, in send_frame
raise ClientConnectionResetError("Cannot write to closing transport")
aiohttp.client_exceptions.ClientConnectionResetError: Cannot write to closing transport
2025-07-11 09:55:28.005193 WARNING HASS: ------------------------------------------------------------
2025-07-11 09:55:28.052283 WARNING HASS: Previous message repeated 1 times
2025-07-11 09:55:28.052614 WARNING HASS: ------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/appdaemon/utils.py", line 483, in wrapper
result = await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/appdaemon/plugins/hass/hassplugin.py", line 369, in websocket_send_json
await self.ws.send_json(request)
File "/usr/lib/python3.12/site-packages/aiohttp/client_ws.py", line 261, in send_json
await self.send_str(dumps(data), compress=compress)
File "/usr/lib/python3.12/site-packages/aiohttp/client_ws.py", line 245, in send_str
await self._writer.send_frame(
File "/usr/lib/python3.12/site-packages/aiohttp/_websocket/writer.py", line 73, in send_frame
raise ClientConnectionResetError("Cannot write to closing transport")
aiohttp.client_exceptions.ClientConnectionResetError: Cannot write to closing transport
2025-07-11 09:55:28.052890 WARNING HASS: ------------------------------------------------------------
2025-07-11 09:55:29.068858 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5}
2025-07-11 09:55:29.069869 INFO HASS: Completed initialization in 5.0s
2025-07-11 09:55:29.071436 INFO AppDaemon: Processing restart for plugin namespace 'default'
2025-07-11 09:55:29.192799 INFO HASS: Connected to Home Assistant 2025.7.1 with aiohttp websocket
2025-07-11 09:55:29.194595 INFO HASS: Authenticated to Home Assistant 2025.7.1
2025-07-11 09:55:29.196781 INFO HASS: Waiting for Home Assistant to start
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service appdaemon: stopping
2025-07-11 09:55:29.277463 INFO AppDaemon: SIGTERM Received
2025-07-11 09:55:29.277906 INFO AppDaemon: AppDaemon is shutting down
2025-07-11 09:55:29.310759 INFO HASS: Disconnecting from Home Assistant
2025-07-11 09:55:30.041001 INFO AppDaemon: Saving all namespaces
2025-07-11 09:55:30.041410 INFO AppDaemon: AppDaemon is stopped.
[09:55:30] INFO: Service AppDaemon exited with code 0 (by signal 0)
s6-rc: info: service appdaemon successfully stopped
s6-rc: info: service init-appdaemon: stopping
s6-rc: info: service init-appdaemon successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
Relevant code in the app or config file that caused the issue
Anything else?
No response
Similar problem?
https://github.com/xaviml/controllerx/issues/1225
Any solution yet?
No solution yet?
I'm stuck at the very same issue. Even a fresh install of AppDaemon immediatly fails:
`s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service base-addon-banner: starting
Add-on: AppDaemon Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
Add-on version: 0.17.9 You are running the latest version of this add-on. System: Home Assistant OS 16.2 (amd64 / qemux86-64) Home Assistant Core: 2025.9.4 Home Assistant Supervisor: 2025.09.0
Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.
s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service init-appdaemon: starting s6-rc: info: service init-appdaemon successfully started s6-rc: info: service appdaemon: starting s6-rc: info: service appdaemon successfully started s6-rc: info: service legacy-services: starting [09:49:07] INFO: Starting AppDaemon... s6-rc: info: service legacy-services successfully started 2025-09-22 09:49:13.206090 INFO AppDaemon: ------------------------------------------------------------ 2025-09-22 09:49:13.206643 INFO AppDaemon: AppDaemon Version 4.5.11 starting 2025-09-22 09:49:13.206818 INFO AppDaemon: ------------------------------------------------------------ 2025-09-22 09:49:13.206955 INFO AppDaemon: Python version is 3.12.11 2025-09-22 09:49:13.207458 INFO AppDaemon: Configuration read from: /config/appdaemon.yaml 2025-09-22 09:49:13.207709 INFO AppDaemon: Added log: AppDaemon 2025-09-22 09:49:13.207836 INFO AppDaemon: Added log: Error 2025-09-22 09:49:13.207940 INFO AppDaemon: Added log: Access 2025-09-22 09:49:13.208038 INFO AppDaemon: Added log: Diag 2025-09-22 09:49:13.209083 INFO AppDaemon: Using /config/apps as app_dir 2025-09-22 09:49:13.210793 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module appdaemon.plugins.hass.hassplugin 2025-09-22 09:49:13.211326 INFO HASS: HASS Plugin initialization complete 2025-09-22 09:49:13.218593 INFO AppDaemon: Initializing HTTP 2025-09-22 09:49:13.218983 INFO AppDaemon: Using 'ws' for event stream 2025-09-22 09:49:13.219364 INFO AppDaemon: HTTP Listening on port 5050 2025-09-22 09:49:13.223082 INFO AppDaemon: Starting API 2025-09-22 09:49:13.225257 INFO AppDaemon: Starting Admin Interface 2025-09-22 09:49:13.225619 INFO AppDaemon: Starting Dashboards 2025-09-22 09:49:13.242706 INFO AppDaemon: Starting Apps with 1 workers and 1 pins 2025-09-22 09:49:13.247000 INFO AppDaemon: Running on port 5050 2025-09-22 09:49:13.247570 INFO AppDaemon: Waiting for plugins to be ready 2025-09-22 09:49:13.248087 INFO HASS: Connected to Home Assistant 2025.9.4 with aiohttp websocket 2025-09-22 09:49:13.250045 INFO HASS: Authenticated to Home Assistant 2025.9.4 2025-09-22 09:49:13.269106 INFO HASS: Waiting for Home Assistant to start 2025-09-22 09:49:13.274585 INFO AppDaemon: All plugins ready 2025-09-22 09:49:13.277218 INFO AppDaemon: Scheduler running in realtime 2025-09-22 09:49:13.286668 INFO AppDaemon: New app config: hello_world 2025-09-22 09:49:13.295170 INFO AppDaemon: Starting apps: {'hello_world'} 2025-09-22 09:49:13.333075 INFO AppDaemon: Calling initialize() for hello_world 2025-09-22 09:49:13.406160 INFO hello_world: Hello from AppDaemon 2025-09-22 09:49:13.407035 INFO hello_world: You are now ready to run Apps! 2025-09-22 09:49:13.409643 INFO AppDaemon: App initialization complete 2025-09-22 09:49:13.862347 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2025-09-22 09:49:13.870903 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed 2025-09-22 09:49:13.871240 INFO AppDaemon: Stopping apps: {'hello_world'} 2025-09-22 09:49:18.888967 INFO HASS: Connected to Home Assistant 2025.9.4 with aiohttp websocket 2025-09-22 09:49:18.895024 INFO HASS: Authenticated to Home Assistant 2025.9.4 2025-09-22 09:49:18.921774 INFO HASS: Waiting for Home Assistant to start 2025-09-22 09:49:19.475257 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2025-09-22 09:49:19.477665 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed 2025-09-22 09:49:19.478027 INFO AppDaemon: Stopping apps: {'hello_world'} 2025-09-22 09:49:23.333529 WARNING HASS: Timed out [0:00:10] waiting for request: {'type': 'get_states', 'id': 5} 2025-09-22 09:49:23.335254 INFO HASS: Completed initialization in 4.5s 2025-09-22 09:49:24.482455 INFO HASS: Connected to Home Assistant 2025.9.4 with aiohttp websocket 2025-09-22 09:49:24.483939 INFO HASS: Authenticated to Home Assistant 2025.9.4 2025-09-22 09:49:24.487336 INFO HASS: Waiting for Home Assistant to start 2025-09-22 09:49:24.514037 WARNING AppDaemon: ------------------------------------------------------------ 2025-09-22 09:49:24.514609 WARNING AppDaemon: Unexpected error during process_event() 2025-09-22 09:49:24.514887 WARNING AppDaemon: ------------------------------------------------------------ 2025-09-22 09:49:24.516926 WARNING AppDaemon: Traceback (most recent call last): File "/usr/lib/python3.12/site-packages/appdaemon/events.py", line 239, in process_event self.AD.state.set_state_simple(namespace, entity_id, data["data"]["new_state"]) File "/usr/lib/python3.12/site-packages/appdaemon/state.py", line 780, in set_state_simple if self.entity_exists(namespace, entity_id): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/appdaemon/state.py", line 473, in entity_exists return namespace in self.state and entity in self.state[namespace] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'NoneType' is not iterable 2025-09-22 09:49:24.518485 WARNING AppDaemon: { "event_type": "state_changed", "data": { "entity_id": "sensor.sensor_wohnzimmer_linkquality", "old_state": { "entity_id": "sensor.sensor_wohnzimmer_linkquality", "state": "112", "attributes": { "state_class": "measurement", "unit_of_measurement": "lqi", "icon": "mdi:signal", "friendly_name": "Sensor Wohnzimmer Linkquality" }, "last_changed": "2025-09-22T07:49:23.165872+00:00", "last_reported": "2025-09-22T07:49:23.165872+00:00", "last_updated": "2025-09-22T07:49:23.165872+00:00", "context": { "id": "01K5R6C62X5Y48W2CHG51R21ZA", "parent_id": null, "user_id": null } }, "new_state": { "entity_id": "sensor.sensor_wohnzimmer_linkquality", "state": "116", "attributes": { "state_class": "measurement", "unit_of_measurement": "lqi", "icon": "mdi:signal", "friendly_name": "Sensor Wohnzimmer Linkquality" }, "last_changed": "2025-09-22T07:49:24.497632+00:00", "last_reported": "2025-09-22T07:49:24.497632+00:00", "last_updated": "2025-09-22T07:49:24.497632+00:00", "context": { "id": "01K5R6C7CHX1CRHH0YCPP1DTSR", "parent_id": null, "user_id": null } }, "metadata": { "origin": "LOCAL", "context": { "id": "01K5R6C7CHX1CRHH0YCPP1DTSR", "parent_id": null, "user_id": null }, "time_fired": "2025-09-22T07:49:24.497632+00:00" } } } 2025-09-22 09:49:24.519561 WARNING AppDaemon: ------------------------------------------------------------ 2025-09-22 09:49:24.520043 WARNING AppDaemon: Previous message repeated 1 times 2025-09-22 09:49:24.520358 WARNING AppDaemon: ------------------------------------------------------------` ...
@acockburn do you need any support? Could you replicate this issue?
I haven't been able to replicate this, but it seems like some sort of weird interaction between AppDaemon and Home Assistant. Something bad happens when getting the initial state, so the namespace never gets set, which causes the TypeError: argument of type 'NoneType' is not iterable error. Unfortunately, it's hard to tell what's happening beyond that, but we have improved the error messages around the HASS disconnection in the dev branch.
Could either of you try again with that branch? In the meantime, I'll see if I can find anything else that might explain it
For me the issue was triggered by the amount of entities Homeassistant propagates. It seems to cause an error when >10.000 entities are present (not sure about the exact amount).
Since I managed to get down to ~8k entities, the problem does not exist anymore.
You could also try increasing the ws_timeout timeout for the HASS plugin. That will allow the plugin more time for the complete state to come in.
I haven't been able to replicate this, but it seems like some sort of weird interaction between AppDaemon and Home Assistant. Something bad happens when getting the initial state, so the namespace never gets set, which causes the
TypeError: argument of type 'NoneType' is not iterableerror. Unfortunately, it's hard to tell what's happening beyond that, but we have improved the error messages around the HASS disconnection in thedevbranch.Could either of you try again with that branch? In the meantime, I'll see if I can find anything else that might explain it
Yes, please find the attached log
I have around 7000 entities, so this should be no problem.
I'm experiencing the same issue here with a fresh install of the AppDaemon Addon, happy to help debug if there's anything I can provide.
@jsl12
Could either of you try again with that branch? In the meantime, I'll see if I can find anything else that might explain it
Running dev image from October 4 I captured a snippet of debug logs. Pasted to GitHub gist:
https://gist.github.com/nugget/be7a7451379457bd8486f60779166960
I also experimented with increasing ws_timeout but that didn't seem to have any effect, even at 120 seconds. Logs above are with ws_timeout at the default value.
Has anyone tried it with latest dev?
I think it's going to take #2443 for this to work because having so many entities is making the websocket messages exceed an internal limit. That PR exposes this limit as ws_max_msg_size, which you can set to 0 to effectively disable that limit
Running the latest dev image from docker hub, dated 2025-10-22T15:48:18.555Z digest sha256:e54ef4c1019df5d1f30364726b4b743b1555cef0d1b6fa398edbf84f1ca80d70
appdaemon.yaml contains:
ws_timeout: 120
ws_max_msg_size: 0
This appears to "fix the glitch" for my continual disconnects and hello_world restarts.
Unfortunately didn't fix it in my case. Running the same version that @nugget posted above with the same parameters in appdaemon.yaml and I get the following errors:
2025-10-24 11:19:53.241831 INFO HASS: Completed initialization in 11.352ms
2025-10-24 11:19:53.243002 INFO HASS: Connected to Home Assistant 2025.9.4 with aiohttp websocket
2025-10-24 11:19:53.243386 INFO HASS: Authenticated to Home Assistant 2025.9.4
2025-10-24 11:19:53.243767 INFO HASS: Waiting for Home Assistant to start
2025-10-24 11:19:53.269918 ERROR HASS: Error from aiohttp websocket: Message size 4199918 exceeds limit 4194304
2025-10-24 11:19:53.270186 ERROR HASS: Websocket connection lost
2025-10-24 11:19:53.270282 INFO HASS: Attempting reconnection in 5.0s
This continues to repeat.
If it's helpful, my Home Assistant instance is huge. More than 15k entities.
Try restarting AppDaemon. It only loads the config file at startup, and that's showing that there's still a limit on the websocket message size. If the ws_max_msg_size: 0 is really loaded, then there will be no limit to the message size
I had tried restarting previously. But when I checked my configuration file again, it seems something overwrote it. I stopped AppDaemon completely, edited the configuration file a second time and then started AppDaemon and now it's working.
Thanks for the fix!
@frido100 can you check your setup with the latest dev version?
@frido100 can you check your setup with the latest dev version?
I am suddenly seeing this issue too. 4.5.11 has been running fine for me since it got released. The dev image won't start for me
2025-10-30 13:17:20.738 ERROR AppDaemon: ===== Failed to configure AppDaemon =====================================
2025-10-30 13:17:20.738 ERROR AppDaemon: ===========================================================================
Requirement already satisfied: matplotlib in /usr/local/lib/python3.12/site-packages (from -r /conf/requirements.txt (line 1)) (3.10.7)
Requirement already satisfied: deepdiff>7.0.0 in /usr/local/lib/python3.12/site-packages (from -r /conf/requirements.txt (line 2)) (8.6.1)
Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (1.3.3)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (4.60.1)
Requirement already satisfied: kiwisolver>=1.3.1 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (1.4.9)
Requirement already satisfied: numpy>=1.23 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (2.3.4)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (25.0)
Requirement already satisfied: pillow>=8 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (12.0.0)
Requirement already satisfied: pyparsing>=3 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (3.2.5)
Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (2.9.0.post0)
Requirement already satisfied: orderly-set<6,>=5.4.1 in /usr/local/lib/python3.12/site-packages (from deepdiff>7.0.0->-r /conf/requirements.txt (line 2)) (5.5.0)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.12/site-packages (from python-dateutil>=2.7->matplotlib->-r /conf/requirements.txt (line 1)) (1.17.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
[notice] A new release of pip is available: 25.0.1 -> 25.3
[notice] To update, run: pip install --upgrade pip
2025-10-30 13:17:51.695 ERROR AppDaemon: ===== Failed to configure AppDaemon =====================================
2025-10-30 13:17:51.695 ERROR AppDaemon: ===========================================================================
Requirement already satisfied: matplotlib in /usr/local/lib/python3.12/site-packages (from -r /conf/requirements.txt (line 1)) (3.10.7)
Requirement already satisfied: deepdiff>7.0.0 in /usr/local/lib/python3.12/site-packages (from -r /conf/requirements.txt (line 2)) (8.6.1)
Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (1.3.3)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (4.60.1)
Requirement already satisfied: kiwisolver>=1.3.1 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (1.4.9)
Requirement already satisfied: numpy>=1.23 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (2.3.4)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (25.0)
Requirement already satisfied: pillow>=8 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (12.0.0)
Requirement already satisfied: pyparsing>=3 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (3.2.5)
Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.12/site-packages (from matplotlib->-r /conf/requirements.txt (line 1)) (2.9.0.post0)
Requirement already satisfied: orderly-set<6,>=5.4.1 in /usr/local/lib/python3.12/site-packages (from deepdiff>7.0.0->-r /conf/requirements.txt (line 2)) (5.5.0)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.12/site-packages (from python-dateutil>=2.7->matplotlib->-r /conf/requirements.txt (line 1)) (1.17.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
[notice] A new release of pip is available: 25.0.1 -> 25.3
[notice] To update, run: pip install --upgrade pip
2025-10-30 13:18:48.237 ERROR AppDaemon: ===== Failed to configure AppDaemon =====================================
2025-10-30 13:18:48.237 ERROR AppDaemon: ===========================================================================
(the image tagged with 4.5.12 starts correctly)
@dekiesel can you make a separate issue for this and post your appdaemon.yaml? I'm fairly sure this has been addressed with some of the open PRs
I've been having similar sporadic issues on my installation for a while and tried the suggested fixes but none worked. The only fix that would get AD working was to restart HAOS.
However I started debugging the system when AD was unresponsive and after digging through the logs, I saw that the core was throwing errors:
core logs
Errors were related to Bluetooth, which was enabled to track devices and I also noticed that known_devices.yaml had 1.9M lines. I also checked /config/.storage/homeassistant.exposed_entities and this file was quite large as well, about ~46MB.
I figured that if I remove these the number of entities would drop, so I stopped the core core stop, removed the files and started it up again core start and AD started working immediately.
I also adjusted my Bluetooth configs to stop spamming HA with entities.
So this does somewhat seem to be related to a large number of entities as people are suggesting.
Hope that this helps some other people facing similar issues.
At this point I'm just impatiently waiting for an AppDaemon add-on release that lets me set ws_max_msg_size: 0 which will finally, after nearly a year of downtime, let me get my alarm system back online in Home Assistant.
Are we still waiting for @frido100 to validate their setup? @jsl12 ?
You don't need the add-on to be released to be able to use whatever version or commit you like. See our (new) doc page for more info.
We don't control the add-on release timing anyway
Confirmed: works fine for me. AppDaemon stable with ws_max_msg_size: 0, no disconnects. Setup validated.