TADO (homekit) fails to set temperature

I have a TADO thermostat configured using homekit. Fairly frequently setting the temperature gives an error saying that it can’t perform the action climate/set_temperature

If this happens when I click in the UI is not a big deal as I can click again until it works. But it does also happen in automations where it doesn’t retry to set the temperature.

When this happens I see the home assistant container displaying this error in the stdout:

025-02-03 12:13:59.608 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140210039587312] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2795, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2838, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1006, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1078, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/scene/__init__.py", line 118, in _async_activate
    await self.async_activate(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/scene.py", line 366, in async_activate
    await async_reproduce_state(
    ...<4 lines>...
    )
  File "/usr/src/homeassistant/homeassistant/helpers/state.py", line 69, in async_reproduce_state
    await asyncio.gather(
        *(worker(domain, data) for domain, data in to_call.items())
    )
  File "/usr/src/homeassistant/homeassistant/helpers/state.py", line 63, in worker
    await platform.async_reproduce_states(
        hass, states_by_domain, context=context, reproduce_options=reproduce_options
    )
  File "/usr/src/homeassistant/homeassistant/components/climate/reproduce_state.py", line 107, in async_reproduce_states
    await asyncio.gather(
    ...<6 lines>...
    )
  File "/usr/src/homeassistant/homeassistant/components/climate/reproduce_state.py", line 57, in _async_reproduce_states
    await call_service(SERVICE_SET_HVAC_MODE, [], {ATTR_HVAC_MODE: state.state})
  File "/usr/src/homeassistant/homeassistant/components/climate/reproduce_state.py", line 52, in call_service
    await hass.services.async_call(
        DOMAIN, service, data, blocking=True, context=context
    )
  File "/usr/src/homeassistant/homeassistant/core.py", line 2795, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2838, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1006, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1078, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 677, in async_handle_set_hvac_mode_service
    await self.async_set_hvac_mode(hvac_mode)
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/climate.py", line 537, in async_set_hvac_mode
    await self.async_put_characteristics(
    ...<5 lines>...
    )
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/entity.py", line 140, in async_put_characteristics
    return await self._accessory.put_characteristics(payload)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 1009, in put_characteristics
    await self.pairing.put_characteristics(characteristics)
  File "/usr/local/lib/python3.13/site-packages/aiohomekit/controller/ip/pairing.py", line 313, in put_characteristics
    response = await self.connection.put_json(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        "/characteristics", {"characteristics": char_payload}
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohomekit/controller/ip/connection.py", line 402, in put_json
    response = await self.put(
               ^^^^^^^^^^^^^^^
    ...<3 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohomekit/controller/ip/connection.py", line 391, in put
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohomekit/controller/ip/connection.py", line 537, in request
    resp = await self.protocol.send_bytes(request_bytes)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohomekit/controller/ip/connection.py", line 207, in send_bytes
    return await self._send_lines(buffer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohomekit/controller/ip/connection.py", line 126, in _send_lines
    return await result
           ^^^^^^^^^^^^
aiohomekit.exceptions.AccessoryDisconnectedError: Connection closed

Any idea how I can fix the problem? Should I create an issue in github for it or might be something of my installation?

Is there any trick to make the automations retry if it has given an error?