Hello I’m looking for some help with my TP-link Tapo plugs (P110/100)
They were all working ok with HA.
But since this morning, it’s not working anymore. I have some working ok, and some not recognized.
I checked the logs I have this error:
2024-07-17 13:24:58.023 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry deshumidificateur P110 for tplink Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tplink/__init__.py", line 165, in async_setup_entry device: Device = await Device.connect(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/kasa/device.py", line 233, in connect return await connect(host=host, config=config) # type: ignore[arg-type] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/kasa/device_factory.py", line 71, in connect return await _connect(config, protocol) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/kasa/device_factory.py", line 110, in _connect await device.update() File "/usr/local/lib/python3.12/site-packages/kasa/smart/smartdevice.py", line 156, in update await self._negotiate() File "/usr/local/lib/python3.12/site-packages/kasa/smart/smartdevice.py", line 132, in _negotiate resp = await self.protocol.query(initial_query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 68, in query return await self._query(request, retry_count) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 73, in _query return await self._execute_query( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 202, in _execute_query return await self._execute_multiple_query(request, retry_count) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 145, in _execute_multiple_query response_step = await self._transport.send(smart_request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/kasa/klaptransport.py", line 356, in send decrypted_response = self._encryption_session.decrypt(response_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/kasa/klaptransport.py", line 491, in decrypt dp = decryptor.update(msg[32:]) + decryptor.finalize() ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 184, in finalize data = self._ctx.finalize() ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 223, in finalize raise ValueError( ValueError: The length of the provided data is not a multiple of the block length.
the init sequence looks good:
2024-07-17 13:24:57.700 DEBUG (MainThread) [kasa.klaptransport] Created KLAP transport for 192.168.4.119
2024-07-17 13:24:57.700 DEBUG (MainThread) [kasa.device] Initializing 192.168.4.119 of type <class ‘kasa.smart.smartdevice.SmartDevice’>
2024-07-17 13:24:57.700 DEBUG (MainThread) [kasa.smartprotocol] 192.168.4.119 multi-request-batch-1 >> ‘{“method”:“multipleRequest”,“params”:{“requests”:[{“method”:“component_nego”,“params”:null},{“method”:“get_device_info”,“params”:null},{“method”:“get_connect_cloud_state”,“params”:null}]},“requestID”:1263214883823030272,“request_time_milis”:1721215497701,“terminal_uuid”:“t4VULJgtCk3Zh8eDqaVghQ==”}’
2024-07-17 13:24:57.701 DEBUG (MainThread) [kasa.klaptransport] Starting handshake with 192.168.4.119
2024-07-17 13:24:57.701 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.4.119:80/app/handshake1
2024-07-17 13:24:57.931 DEBUG (MainThread) [kasa.klaptransport] Handshake1 posted at 2024-07-17 13:24:57.930948. Host is 192.168.4.119, Responsestatus is 200, Request was c948328d79272d8d7721b34fb1fcc632
2024-07-17 13:24:57.931 DEBUG (MainThread) [kasa.klaptransport] Handshake1 success at 2024-07-17 13:24:57.931238. Host is 192.168.4.119, Server remote_seed is: 347704a5ed7084a46a9c85a406df05a4, server hash is: 263f1c05535b62cef8a3e01cc3f532fcb329fd1cd61f95983812a2d926b84dbe
2024-07-17 13:24:57.931 DEBUG (MainThread) [kasa.klaptransport] handshake1 hashes match with expected credentials
2024-07-17 13:24:57.932 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.4.119:80/app/handshake2
2024-07-17 13:24:57.967 DEBUG (MainThread) [kasa.klaptransport] Handshake2 posted 2024-07-17 13:24:57.967118. Host is 192.168.4.119, Response status is 200, Request was 8bafb11a4e86dedef052df1976c13cd2478f4d6c00f0364cdf67118b7ca1eb11
2024-07-17 13:24:57.967 DEBUG (MainThread) [kasa.klaptransport] Handshake with 192.168.4.119 complete
2024-07-17 13:24:57.973 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.4.119:80/app/request
2024-07-17 13:24:58.011 DEBUG (MainThread) [kasa.klaptransport] Query posted Host is 192.168.4.119, Sequence is -1781590638, Response status is 200, Request was {“method”:“multipleRequest”,“params”:{“requests”:[{“method”:“component_nego”,“params”:null},{“method”:“get_device_info”,“params”:null},{“method”:“get_connect_cloud_state”,“params”:null}]},“requestID”:1263214883823030272,“request_time_milis”:1721215497701,“terminal_uuid”:“t4VULJgtCk3Zh8eDqaVghQ==”}
What could be wrong?
the problem is that when I’m removing a device and adding it again to HA I have the following problem:
your help is more than welcome thanks