Missing entities in deconz intergration

Hi, I have right now 104 devices running via deconz (2.22.00) in HA (2023.6.2). Today I just wanted to add another Aqara door/windows sensor which I’m already using a dozen times in the system.
It was perfectly added to deconz as usual and then also appeard in HA, but unfortunately only the battery entity was created. Besides the temperature entity which I wouldn’t need anyway the OpenClose entity is missing. Also re-adding the sensor and restarting both systems didn’t help in any way.
Therefore I also tried it with a second door/window sensor again with the same results, device is added but entites except battery are missing. Deconz shows the attributes of the sensor correctly, so they’re definitely nor broken and the integration in Deconz is working as usual.
Did anyone have missing entities before and how did you fix it?
Best,
Tobias.

I also spotted a log message related to this:


2023-06-20 16:09:45.421 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up deconz platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 320, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/deconz/binary_sensor.py", line 221, in async_setup_entry
    gateway.register_platform_add_device_callback(
  File "/usr/src/homeassistant/homeassistant/components/deconz/gateway.py", line 183, in register_platform_add_device_callback
    async_add_device(EventType.ADDED, device_id)
  File "/usr/src/homeassistant/homeassistant/components/deconz/gateway.py", line 173, in async_add_device
    add_device_callback(EventType.ADDED, device_id)
  File "/usr/src/homeassistant/homeassistant/components/deconz/binary_sensor.py", line 216, in async_add_sensor
    ) or description.value_fn(sensor) is None:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/deconz/binary_sensor.py", line 129, in <lambda>
    value_fn=lambda device: device.open,
                            ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pydeconz/models/sensor/open_close.py", line 28, in open
    return self.raw["state"]["open"]
           ~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'open'

1 Like

I have exactly the same issue. Have you found a solution to that problem yet?

1 Like

Unfortunately not. Also upgrade deconz to 2.22.02
It doesn’t seem to be a hardware problem as I had to repair one of my old openclose sensors that now has the same issue in HA.

1 Like

FYI I also created a github issue for this Missing entities in deconz intergration for open/close sensors · Issue #94921 · home-assistant/core · GitHub

1 Like

What was successful for me: I uninstalled the deconz add-on. I re-installed the add-on and all the zigbee devices from a backup. When I tried installing a new Aqara window sensor, the missing open/close entity has turned up and worked ever since.
However some other strange behaviour has occured: The Aqara temperature entities now show the humidity and the humidity entities show pressure. And “oe” (like in “oeffnung”) was transformed into “o” (offnung").

Thanks for the hint. Do you also have a Parkside watering timer in your system? In Github it was claimed that this device is causing the issues (which it wasn’t before …)
It really seems to be messed up right now, the issue is still without any solution blaming deconz, but there everything works fine. Also updates of both systems to the latest versions and disabling the parkside watering timer didn’t help in any way.