Jc2k/aiohomekit

Connection refused

Drealine opened this issue · 2 comments

Hi
I've a Tahoma Switch wich is get a connection refused by HomeKit integration in HA v2023.6.1
Try to reset Tahoma. At the first installation, HomeKit it's ok but when restart Somfy Thaoma, i've got a connection refused an I don't kown why.

Last logs before don't work :

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohomekit/utils.py", line 35, in _handle_task_result
task.result()
File "/usr/local/lib/python3.11/site-packages/aiohomekit/controller/ip/connection.py", line 546, in _reconnect
return await self._connect_once()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohomekit/controller/ip/connection.py", line 654, in _connect_once
request, expected = state_machine.send(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohomekit/protocol/init.py", line 590, in get_session_keys
handle_state_step(response_tlv, TLV.M4)
File "/usr/local/lib/python3.11/site-packages/aiohomekit/protocol/init.py", line 88, in handle_state_step
error_handler(tlv_dict[TLV.kTLVType_Error], f"step {expected_state}")
File "/usr/local/lib/python3.11/site-packages/aiohomekit/protocol/init.py", line 62, in error_handler
raise AuthenticationError(stage)
aiohomekit.exceptions.AuthenticationError: step bytearray(b'\x04')

Jc2k commented

I don't have much insight for you beyond the other GitHub issue where we talked about this.

Connection refused means that the HomeKit code in your tahoma crashed. Nothing HA can do to fix that. Restarting the device will get rid of the connection refused.

Please confirm that you are running 2023.6.1 or later.

I finished to work on it. I think is a bug regarding the Thaoma. Perform a new reset with another email account. Do the work.
Simply just wait 5 minutes after Thaoma restart. Maybe internal OS take too time to publish port of HomeKit with internal process.

Tk a lot for your answer.