Device loss and reconnection

Hello everyone, it has been 1 day that all TAPO devices have power sockets, they work very badly, are disconnected from homeassistant and the items of power consumption are not shown. The connection is stable and I can’t understand what’s going on .


1 Like

What kind of power sockets do you use?

Did the devices had an firmware update recently?

What do the HA logs show?

Do the sockets respond in the OEM app when they are offline in HA?

Hello and thank you for replying. What happens to me is identical to this link I just saw.

What happens if you request the data manually?

service: homeassistant.update_entity
data: {}
target:
  entity_id:
    - sensor.yourdevice_current_consumption

Excuse me, how do I request the data manually?

In the left pane, go the Developer Tools. Than go to Services. Here you can manually call a service.

Please feel free to let me know if you can’t find it :slight_smile:

I did and he gave me the green visa. Also I saw the yaml file

Did it restore the value’s that where lost?

Also when everything is working it looks like the picture.

Tim, I don’t think I’ve lost any value for these disconnections. The only thing is that what you saw in the photos has always worked perfectly for months. Also, even though my English is painful, the flaw as I wrote to you is identical to the link on GitHub that I posted to you. For example, for a few minutes now it seems to work…but I expect it to enter a state of instability again. I don’t understand what’s going on. The command you made me run is a query to detect Tapo’s data or does it initialize the device?

The command I provided is intended to update the sensor data in Home Assistant with the current data from the target device. I hoped it would trigger a reconnection.

What do the Home Assistant logs indicate? Is there a connection timeout with the device? If one of my TP-Link devices loss connection I can find some details in the Home Assistant logs.

Are multiple TP-Link devices becoming unavailable simultaneously, or does this issue affect random devices at different times?

So, some go others don’t.


Also I wanted to point out that from the tplink app example the p115 is active and shows me the consumption, while from the home assistant it is not connected.


I’m noticing that they go intermittently.

Never happened …

I also confirm that with tapo app the devices are all reachable and give me all the information, consumption, status, etc.

What do the Home Assistant logs indicate? Is there a connection timeout with the device? If one of my TP-Link devices loss connection I can find some details in the Home Assistant logs.

Settings → system → logs

Registratore: homeassistant.config_entries
Fonte: config_entries.py:586
Prima occorrenza: 18:09:44 (4 occorrenze)
Ultima registrazione: 18:21:42

Error setting up entry P115 P115 for tplink
Error setting up entry P115_2 P115 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.

I have the same issue. It started in the last 24 hours or so, and only affects my P115 devices. The HS100 devices are working just fine.

Please let me know if you need further details.

Hello and thanks for your feedback. I had seen the same problem on github, however if you completely turn off the device it works. I have the p110 and p115, they have always worked well, very well indeed.
Like you, all the tapos seem to have gone crazy since this morning!