Homekit Thread Devices not working after upgrade to home assistant 17.1

HI,

all my homekit thread devices fail to connect in home assistant since I did the upgrade to home assistant 17.1 (from 16.1) and Operating System 16.0.

I still see in the OpenThread Border Router that all the device are connected via Thread. And all Matter over Thread devices are still working.

I could not find any useful logs only some related to Bluetooth which is not used anymore for these Homekit Thread devices.

Was there any change done regarding Homekit over Thread devices?
Could it be that the devices lost the Thread binding?
I also enabled Debug logs for Homekit Device Integration but can’t see any related logs.

BR,
Martin

Thanks, does this mean you are investigating the issue?

Do you have any other Thread devices that aren’t through then HomeKit Device integration?

Like Matter over Thread devices that aren’t associated with HK Device integration. Are those working?

What is your OBTR? Do you try restarting it? Or all of them if you have multiple? Do you have Thread devices just in Apple Home? And if so, are they communicating ok?

Also, did you try restarting your router? Thread uses ipv6 so your routers handle that, so a restart never hurts.

Were they working fine on previous Supervision version? If so I’d go to my latest backup with the old supervision version.

Yes as written all Matter over Thread device are still working.
I use the home assistant AddOn for OTBR. Restarted it and also the whole server and router without success.
Yes they all worked on 16.1. I check how i could downgrade.

Downgraded now to 16.1 and all Homekit over Thread Devices are now working again. So there is definitely something wrong in the versions after 16.1 till 17.1.

Should I create an issue on the home assistant core?

With HA 17.1, I think you are referring to the HA IOS App ? In that case, you need to file an issue on the IOS App github.

No has nothing to do with iOS. I have an Android App but it is not related to the APP at all. It is an issue of the Home Assistance Homekit Integration.

Created now a Github issue: Homekit Thread Devices not working after upgrade to home assistant 17.1 · Issue #149128 · home-assistant/core · GitHub

What is HA 16.1 and 17.1? Latest release of HA is 2025.7.2, the one before was 2025.7.1. And last month release was 2025.6.x

Sorry it is 2025.6.1 and 2025.7.1

Upgrad from 2025.6.1 to 2025.8.1 worked fine and all homekit Thread devices are still working. Issue was fixed somewhere.

I’m have 4 Onvis Smart Buttons (Homekit over Thread). They’ve alway been sensible to HA-restarts, and sometimes became unavailable for hours. But since the last update they cannot even be connected to my thread network. I pair them with bluetooth and when I hit the “Tread” Button they become unavailable and never come back.

Logger: homeassistant.config_entries
Quelle: config_entries.py:751
Erstmals aufgetreten: 19:56:17 (1 Vorkommnis)
Zuletzt protokolliert: 19:56:17

Error setting up entry Onvis-HS2-7668BC for homekit_controller
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 751, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/__init__.py", line 60, in async_setup_entry
    await conn.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 338, in async_setup
    await self.async_update(poll_all=True)
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 957, in async_update
    self.process_new_events(new_values_dict)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 971, in process_new_events
    for aid_iid in self.entity_map.process_changes(new_values_dict):
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohomekit/model/__init__.py", line 410, in process_changes
    char.status = to_status_code(value.get("status", 0))
                  ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohomekit/protocol/statuscodes.py", line 44, in to_status_code
    return HapStatusCode(abs(status_code) * -1)
  File "/usr/local/lib/python3.13/enum.py", line 726, in __call__
    return cls.__new__(cls, value)
           ~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/enum.py", line 1203, in __new__
    raise ve_exc
ValueError: -6 is not a valid HapStatusCode

Can someone help me? I installed all available updates…

I already mentioned it here, but no progress…

Hi everyone
Since nothing happened I tried to solve the problem myself
ChatGPT helped me to create a patch

1st: NO GUARANTEES! Make a complete backup before use! Use at own risk!
2nd: Patch needs to be reinstalled after every core update. Thats intended, since I hope for a official solution soon.

Steps to reproduce (Hass OS):

  1. open SSH (security mode disabled)
  2. write docker exec -it homeassistant bash and press enter
  3. make backup of file, we’re going to change:
cp /usr/local/lib/python3.13/site-packages/aiohomekit/protocol/statuscodes.py \
/usr/local/lib/python3.13/site-packages/aiohomekit/protocol/statuscodes.py.bak
  1. insert patch:
cat > /usr/local/lib/python3.13/site-packages/aiohomekit/protocol/statuscodes.py <<'PYCODE'
#
# Copyright 2019 aiohomekit team
#
# Licensed under the Apache License, Version 2.0 (the "License");
#
import logging
from aiohomekit.enum import EnumWithDescription
from types import SimpleNamespace

logger = logging.getLogger(__name__)

class HapStatusCode(EnumWithDescription):
    SUCCESS = 0, "This specifies a success for the request."
    INSUFFICIENT_PRIVILEGES = -70401, "Request denied due to insufficient privileges."
    UNABLE_TO_COMMUNICATE = (
        -70402,
        "Unable to communicate with requested service, e.g. the power to the accessory was turned off.",
    )
    RESOURCE_BUSY = -70403, "Resource is busy, try again."
    CANT_WRITE_READ_ONLY = -70404, "Cannot write to read only characteristic."
    CANT_READ_WRITE_ONLY = -70405, "Cannot read from a write only characteristic."
    NOTIFICATION_NOT_SUPPORTED = (
        -70406,
        "Notification is not supported for characteristic.",
    )
    OUT_OF_RESOURCES = -70407, "Out of resources to process request."
    TIMED_OUT = -70408, "Operation timed out."
    RESOURCE_NOT_EXIST = -70409, "Resource does not exist."
    INVALID_VALUE = -70410, "Accessory received an invalid value in a write request."
    INSUFFICIENT_AUTH = -70411, "Insufficient Authorization."
    NOT_ALLOWED_IN_CURRENT_STATE = -70412, "Not allowed in current state"
    UNKNOWN = -1, "Unknown or undefined status code"

def to_status_code(status_code: int):
    normalized = abs(status_code) * -1
    try:
        return HapStatusCode(normalized)
    except ValueError as exc:
        mapping = {
            -6: "INVALID_REQUEST",
        }
        label = mapping.get(status_code, "UNKNOWN")
        logger.warning(
            "aiohomekit_patch: Unbekannter HapStatusCode %r (%s), benutze Platzhalter %s",
            status_code, exc, label
        )
        return HapStatusCode.UNKNOWN

class _HapBleStatusCodes:
    SUCCESS = 0x00
    UNSUPPORTED_PDU = 0x01
    MAX_PROCEDURES = 0x02
    INSUFFICIENT_AUTHORIZATION = 0x03
    INVALID_INSTANCE_ID = 0x04
    INSUFFICIENT_AUTHENTICATION = 0x05
    INVALID_REQUEST = 0x06

    def __init__(self) -> None:
        self._codes = {
            _HapBleStatusCodes.SUCCESS: "The request was successful.",
            _HapBleStatusCodes.UNSUPPORTED_PDU: "The request failed as the HAP PDU was not recognized or supported.",
            _HapBleStatusCodes.MAX_PROCEDURES: "The request failed as the accessory has reached the limit on the simultaneous procedures it can handle.",
            _HapBleStatusCodes.INSUFFICIENT_AUTHORIZATION: "Characteristic requires additional authorization data.",
            _HapBleStatusCodes.INVALID_INSTANCE_ID: "The HAP Request's characteristic Instance Id did not match the addressed characteristic's instance Id",
            _HapBleStatusCodes.INSUFFICIENT_AUTHENTICATION: "Characteristic access required a secure session to be established.",
            _HapBleStatusCodes.INVALID_REQUEST: "Accessory was not able to perform the requested operation",
        }

        self._categories_rev = {self._codes[k]: k for k in self._codes.keys()}

    def __getitem__(self, item):
        if item in self._codes:
            return self._codes[item]
        raise KeyError(f"Item {item} not found")
PYCODE
  1. Restart HA
  2. Readd Buttons using bluetooth and then migrate them to thread

This worked for me and my buttons finally stay available and responsive after migrating to thread again :tada:
Might work for other thread-devices with issues too, can’t test that.