deCONZ Integration not working after Setup (non-Addon): [pydeconz.websocket] Client connection error

My initial Setup is a Windows Desktop (before a Raspi4) with VirtualBox and HassOS + deCONZ Addon and Conbee II Stick, but with that Setup I had Problems for a longer time:

  • from time to time the the Connection failed (cbc_acm errors, like here) and I had to restart the VM
  • after Restarting I had to Restart the VM and Homeassistant sometimes to get the a Connection to deCONZs
  • I had to wait ~30min before I can use the deCONZ Web/VNC Interface, it seems the the System had to wait till the Conbee II Stick (Configuration tool) is discovered
  • I couldn’t add any more Lights (but Sensors), then the System would get stuck and couldn’t be used anymore.
  • I couldn’t rename anything the deCONZ Webapp, nothing is saved

Looks like most of the Problems are not present when using the Windows Dezconz Program, directly on the Host. So I tired to use the deCONZ Integration with the Host, Setup works fine and all Device are synced in HA

2021-02-06 22:43:09 DEBUG (MainThread) [homeassistant.components.deconz] Preparing linking with deCONZ gateway {'host': '192.168.1.253', 'port': 80}

2021-02-06 22:43:09 INFO (MainThread) [pydeconz.utils] API key: xxx

2021-02-06 22:43:10 INFO (MainThread) [pydeconz.utils] Bridge id: xxx

2021-02-06 22:43:10 DEBUG (MainThread) [homeassistant.components.deconz] deCONZ event created: s1

2021-02-06 22:43:10 DEBUG (MainThread) [homeassistant.components.deconz] deCONZ event created: s2

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.deconz

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.components.climate] Setting up climate.deconz

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.components.cover] Setting up cover.deconz

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.components.fan] Setting up fan.deconz

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.components.light] Setting up light.deconz

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.components.lock] Setting up lock.deconz

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.components.scene] Setting up scene.deconz

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.deconz

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.components.switch] Setting up switch.deconz

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.deconz entity: binary_sensor.lumi_sensor_magnet_aq2

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new light.deconz entity: light.extended_color_light_12

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new light.deconz entity: light.color_light_13

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new light.deconz entity: light.extended_color_light_14

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new light.deconz entity: light.color_temperature_light_3

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new light.deconz entity: light.tvlight2

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new light.deconz entity: light.extended_color_light_9

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new light.deconz entity: light.group_5

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.deconz entity: sensor.daylight

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.components.sensor] Not adding entity Daylight because it's disabled

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.deconz entity: sensor.s1_battery_level

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.deconz entity: sensor.s2_battery_level

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.deconz entity: switch.on_off_plug_in_unit_10

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.deconz entity: switch.test

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.deconz entity: switch.t1

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.deconz entity: switch.t2

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.deconz entity: switch.powerpc

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.deconz entity: switch.on_off_plug_in_unit_7

2021-02-06 22:43:10 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.deconz entity: switch.on_off_plug_in_unit_8

After that every Device is immediately Unavailable, Log (set to debug) only says “Client connection error”

2021-02-07 10:11:42 ERROR (MainThread) [pydeconz.websocket] Client connection error
2021-02-07 10:11:42 DEBUG (MainThread) [pydeconz.websocket] Websocket starting
2021-02-07 10:11:42 DEBUG (MainThread) [pydeconz.websocket] Reconnecting to deCONZ in 15.

Connection seems fine:
image

Removing the Integration and adding it again also works without a Problem

In the Debug View from the DeCONZ Program I can’t see any Connections from HA (beside my curl Request and the initial setup from HA)
image

If they go unavailable you have an issue getting the integration talking with deconz over websocket. Check you have set up hass correctly and that no firewall is blocking the expected ports

1 Like

Thanks, if anyone has the same problem and don’t know the websocket port, check the deconz debug view after you connected to home assistant.

3 Likes

You just saved my bacon with this.

1 Like

Feels so obvious in retrospect. Port 80 was open, but not 443 -_-