TP-Link Tapo P100

Hiya Darren - thanks very very much for this :slight_smile: that’s unlocked it for me - it looks like the old entity was “current energy” and it is now “current power” (albeit with some underscores and dots etc. ) :slight_smile: In my case, I’m using the Grafana plugin with innodb , so I’ll go look for the new entities there - I can see them now (new and old (old being “unavailable”)) in the main lovelace interface too - I might have worked it out myself, given a few weeks :wink: Really appreciate your help, thanks :slight_smile: - I’ll have to come back to the bulb issue, but it’s restricted to one room at the moment, and where I’m in the house by myself for a few days, I’ll hopefully be feeling back to normal and try and work that one out, and post up here what I find :slight_smile:

1 Like

Hi all, unfortunately I still have all the TAPO devices with errors, and I can’t add new ones, even after the update:

old device:
2023-01-03 15:07:00.216 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Server' for tapo integration not ready yet: Unexpected exception: unexpected character: line 1 column 1 (char 0); Retrying in background
2023-01-03 15:07:00.218 ERROR (MainThread) [custom_components.tapo.common_setup] Failed to setup Unexpected exception: unexpected character: line 1 column 1 (char 0)

when i try to add a new device:
2023-01-03 22:25:01.959 ERROR (MainThread) [custom_components.tapo.config_flow] Failed to setup cannot connect

all my notifications are based on P100s or lights, so HA is unusable for me unfortunately :sleepy:

Hi All, a bit more info, this only seems to be affecting the following combination for me:

Model: Tapo L530B (B22/Bayonet Lightbulb)
Hardware Version: 2.0
Firmware Version: Build 220526 Rel.203202

It does seem to work if you control the bulbs separately via the default HA controls, but they default to being “red” in the controls, but actually light up in a lower brightness than normal.

I control all my bulbs with scenes, but when you set them in a scene, save the scene, and return to the scenes menu, the lights listed above, turn off.

I need to work through the other bulbs to see if these are still working normally.

I’m waiting for some more power monitoring P110 plugs to arrive, and if they do in time, I’ll try and add them as a new device, to see if I can replicate milleniumy2k’s issues .

Even with the latest version released yesterday, the integration always presents the same errors:

2023-01-09 10:21:46 2023-01-09 10:21:46.965 ERROR (MainThread) [custom_components.tapo.common_setup] Failed to setup Unexpected exception: unexpected character: line 1 column 1 (char 0)

Hi All, the latest updates have resolved my issues, so all bulbs and power sockets (in versions and hardware models that I have) are all working correctly now. I did have two updates to home assistant core though, and I think one of the release notes in that mentioned about fixing an issue which may have actually been the problem, so not specifically the Tapo integration (apologies if this was the case) - I should have tried the updates a bit more methodically, to see which one actually resolved it, but have been rushing with work :confused: Am still waiting on my latest batch of Tapo plugs to arrive, but will report what happens when I try to add new devices when I do :slight_smile:

Hi All, the latest update (jan 17) seemed to have caused the reverse of my previous issues - following the update, when a bulb is triggered by an automation to go on, I set the brightness in the scene to be maximum - when the older of my L530 bulbs now go on (hardware version 1) the go bright (expected) then within a second, drop down to a half or third brightness. The newer bulbs (hardware version 2) do not seem to be affected so far. sorry for the lack of info again, it’s been a long day :slight_smile:

i have one P100 and yes, it works. Look for Tapo Controller integration in HACS.
You also should assign a static ip to your plug

Installed the integration through HACS and it worked perfectly with my p100. Thank you!

1 Like

How did you end up fixing the 1003 error?

Does anyone know how to fix “migration error” on P100?

How I got here:

  1. P100 switches were unavailable
  2. I upgraded the integration to the latest version
  3. all but one switch is reporting “migration error”

Error:

Logger: homeassistant.config_entries
Source: config_entries.py:650
First occurred: 11:16:13 (5 occurrences)
Last logged: 11:16:13

Error migrating entry Stekkerblok kantoor for tapo
Error migrating entry Aanrecht for tapo
Error migrating entry Koelkast for tapo
Error migrating entry TV en aanverwanten for tapo
Error migrating entry Vaatwasser for tapo
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1085, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 628, in sock_connect
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 668, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('192.168.2.137', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 650, in async_migrate
    result = await component.async_migrate_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tapo/__init__.py", line 59, in async_migrate_entry
    await migrate_entry_to_v6(hass, config_entry)
  File "/config/custom_components/tapo/migrations.py", line 18, in migrate_entry_to_v6
    api = await connect_tapo_client(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tapo/setup_helpers.py", line 99, in connect_tapo_client
    await api.initialize()
  File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 62, in initialize
    await self._guess_protocol()
  File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 218, in _guess_protocol
    response = await self.execute_raw_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 71, in execute_raw_request
    return (await self._protocol.send_request(request)).map(lambda x: x.result)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 42, in send_request
    response = await self._send_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 62, in _send_request
    await self._login_with_version(self._credential)
  File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 81, in _login_with_version
    session_or_error = await self._passthrough.handshake(self._url)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/securepassthrough_transport.py", line 70, in handshake
    response = await self._http.async_make_post(url, json=request_body)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/plugp100/common/utils/http_client.py", line 18, in async_make_post
    async with self.session.post(
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1209, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1178, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 988, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.2.137:80 ssl:default [Connect call failed ('192.168.2.137', 80)]

Hi all.
I have the problem that in HA in the log for the tapo plug P115 the message not available appears.
It has not been a big problem up until now.
I read I should set a static IP adress but that is my problem.
My provider (Telenet from Belgium) doesn’t allow me to set static adresses in the router and after contacting tp-link they say that the plug also can’t be configured with a static ip.
Is there a way to work around this?

Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.tapo.coordinators
Source: helpers/update_coordinator.py:332
Integration: TP-Link Tapo (documentation, issues)
First occurred: 17:50:10 (19 occurrences)
Last logged: 19:07:47

Error fetching tapo data: Unexpected exception:

Has anyone solved authentication errors?

I’ve started getting it with all my P110s; all have pre-assigned IP addresses with DHCP server.

1 Like

Invalid authentication: Unable to complete handshake: 192.168.2.12: TRANSPORT_UNKNOWN_CREDENTIALS_ERROR(1003)

I have just purchased 2 P110 sockets and I’m not able to authenticate. Are there any known issues (I’ve checked the repo).

Cheers

I have 4 of those. No issues. They work fine.

Which app did you register them with please?

Also, I’m getting this error message.
I changed the image as I was pointing at the wrong IP.

Screenshot 2024-03-23 220612

I use this: GitHub - petretiandrea/home-assistant-tapo-p100: A custom integration to control Tapo devices from home assistant.

1 Like

I’m using the official integration.

I’ll give that other one a shot then.

It seems that you must put your email address in exactly (Capitals and lowercase), both integrations work fine if you do.

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:

image

your help is more than welcome thanks