HomeKit Controller Cover Domain not working in 2023.6

Ever since the update to 2023.6 (even the beta versions) my covers I integrate into Home Assistant through the HomeKit Controller Integration have not shown up. After reverting to 2023.5 they work just fine. The other entities brought in (battery, identify button) show up just fine, but the cover returns errors in the log. I am using Homebridge with a child bridge set up to bring my Sunsa Wand blind controllers into HA and it worked very well previous to 2023.6.

Here are the errors:

Logger: homeassistant.components.cover
Source: components/homekit_controller/cover.py:232
Integration: Cover (documentation, issues)
First occurred: 12:53:52 PM (7 occurrences)
Last logged: 12:53:52 PM

Error adding entities for domain cover with platform homekit_controller
Error while setting up homekit_controller platform for cover
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 471, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 749, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 850, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 656, in _async_write_ha_state
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 288, in state_attributes
    if (current_tilt := self.current_cover_tilt_position) is not None:
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/cover.py", line 232, in current_cover_tilt_position
    self.service[CharacteristicsTypes.HORIZONTAL_TILT_TARGET].minValue
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohomekit/model/services/service.py", line 111, in __getitem__
    return self.characteristics_by_type[key]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
KeyError: '0000007B-0000-1000-8000-0026BB765291'
Logger: homeassistant
Source: components/homekit_controller/cover.py:232
First occurred: 12:53:52 PM (6 occurrences)
Last logged: 12:53:52 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 970, in _async_registry_updated
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 656, in _async_write_ha_state
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 288, in state_attributes
    if (current_tilt := self.current_cover_tilt_position) is not None:
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/cover.py", line 232, in current_cover_tilt_position
    self.service[CharacteristicsTypes.HORIZONTAL_TILT_TARGET].minValue
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohomekit/model/services/service.py", line 111, in __getitem__
    return self.characteristics_by_type[key]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
KeyError: '0000007B-0000-1000-8000-0026BB765291'
Logger: homeassistant.util.logging
Source: util/logging.py:168
First occurred: 12:53:52 PM (7 occurrences)
Last logged: 12:53:53 PM

Exception in async_write_ha_state when dispatching 'homekit_controller_0E:C0:CB:8A:15:21_state_updated': () Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 656, in _async_write_ha_state attr.update(self.state_attributes or {}) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 288, in state_attributes if (current_tilt := self.current_cover_tilt_position) is not None: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/homekit_controller/cover.py", line 232, in current_cover_tilt_position self.service[CharacteristicsTypes.HORIZONTAL_TILT_TARGET].minValue ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohomekit/model/services/service.py", line 111, in __getitem__ return self.characteristics_by_type[key] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^ KeyError: '0000007B-0000-1000-8000-0026BB765291'

Can anyone see anything that can help fix this? Thanks!

How is your HA installed?

HAOS. Seems like a python 3.11 issue. I submitted an issue on GitHub here for anyone else that might be running into this and wants to follow Cover Domain not working in HomeKit Controller in 2023.6 · Issue #94775 · home-assistant/core · GitHub

1 Like

Hi mate, did you find a fix for this? It’s been happening to me on and off for sometime

Just found the homebridge plugin for my sunsa wands and having the same issue running 2024.3 in Docker.

@tim.home.assist @mjanofsky unfortunately I did not. I was disappointed in Sunsa’s lack of support to deliver promised local control and they were notoriously unreliable. I sold mine and I have switched over to SwitchBot Blind Tilts. They still have their fair share of issues but are largely better.