TP-Link Tapo P100

Hi! I have a tapo P110 plug and someone know how the plug receive wifi credential from the tapo app ?
Thanks!

Have you installed the Tapo_p100 integration? I followed all instructions in https://github.com/petretiandrea/home-assistant-tapo-p100 and have had my P110 working flawlessly for several months.

Pretty sure it remains cloud based, so you need to add the device to the Tapo app and then add the config to the HA Tapo integration.

1 Like

I might have noticed that if you hit the eye to show the password, then submit, it seems to work, else same error?

Can confirm this has been working well with my P100s

Update: This question has been withdrawn. I used a different way to get it working. Please see my second post.

======
I followed the guide from @jon.g from above.
Password is changed to 8 chars with one number and one capital letter.
Both devices are switched on, both are getting the fixed IP as intended from the router.
In the ā€˜Tapoā€™ App on the phone I can switch them on/off as desired.

However, something is wrong and not working for the two P100 that I have (HW Version 1.20.0, Firmware 1.2.10 Build 20210207 Rel 67438)

The devices are not showing up in HA in Device or Entities (no hit fro search of ā€˜p100ā€™).

Any ideas, what I need to change?

Here is the log from HA:

Logger: homeassistant.components.switch
Source: custom_components/tapo_p100_control/switch.py:83 
Integration: Schalter (documentation, issues) 
First occurred: 22:31:33 (2 occurrences) 
Last logged: 22:31:33

Error while setting up tapo_p100_control platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/tapo_p100_control/switch.py", line 44, in setup_platform
    add_entities([P100Plug(p100)])
  File "/config/custom_components/tapo_p100_control/switch.py", line 53, in __init__
    self.update()
  File "/config/custom_components/tapo_p100_control/switch.py", line 83, in update
    self._p100.handshake()
  File "/usr/local/lib/python3.10/site-packages/PyP100/PyP100.py", line 124, in handshake
    encryptedKey = r.json()["result"]["key"]
KeyError: 'result'

Ok, I followed the hints from @Britespark above and used the UI configuration in the linked video.
Now both P100 are recognized, and I can switch them by HA.

I happened to have the same issue. Have you resolved yours?
Cheers!

Same problemā€¦ invalid authentication ā€¦

Hi All - Sorry in advance that this comment is going to be a bit useless in terms of collected info - Last night I updated the Tapo integration in HACS - Iā€™m confused as to how I was about 5 versions behind, as I update everything in Home Assistant all the time - Itā€™s possible that whatever HACS uses to generate a notification in the HA UI, wasnā€™t working though, although I had updated some other integrations within the last week. I did the update for Tapo, and for another number of HACS integrations, and following this, I lost all energy monitoring of my P110 sockets. At least two of my Tapo bulbs are not responding quite correctly either - I can sometimes control them directly (via HA) , but when used in a Scene, they are now not working as before. I have four Tapo bulbs in my living room, and have a number of scenes set for these - two bulbs are still working, but two are now not. Sorry Iā€™ve not compiled any bulb model/version debug info etc. but posting up in case anyone else has had this issue since the last update. Iā€™m fighting a bad flu/cold at the moment, so will try and share some actual useful info as soon as I can. I did have something like this before, at least 6 months ago, and I think it cleared on the next update. Iā€™m running around 11 Tapo bulbs, 4 P100 sockets and maybe 13 P110 sockets - the sockets (both P100 and P110) are operating in terms of switching on and off, but the power monitoring has gone.

1 Like

The 5 versions came out in rapid succession as the first was a bit buggy.
For the power monitoring, the update has created a new entity and is using that.

Note the name of your current entity, delete it and use the old name for the new entity.
This way you should have to change any automations or cards.

I donā€™t have any of the bulbs or P100ā€™s so canā€™t help there sorry.

2 Likes

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)]