Bad news I am afraid, it does not seem to work out of the box. I tried with discovery: true
and with an explicit switch and IP address. No, luck.
I dug into it a bit, it seems that the HA tp-link component(1) uses pyHS100(2) as a dependency. pyHS100 seems to have been based of the great work done by a security researcher(3) and a set of libraries(4). The security research noted that ports 80/tcp
, 9999/tcp
and 1040/udp
were open, this does not seem to be the case with the tapo device. Port 80/tcp looks to be open but it has a different API.
At first glance it appears to use requests to an /app
endpoint with a token. The request and response looks like JSON enveloping around encrypted payloads.
{
"method": "securePassthrough",
"params": {
"request": "..."
}
}
{
"error_code": 0,
"result": {
"response": "..."
}
}
I only got it in the post an hour ago so I will dig into it more later.
1 - github/home-assistant/home-assistant/blob/d96cd4c4ea1999f87db5b660ec225ad26cb3d471/tests/components/tplink/test_init.py
2 - github/GadgetReactor/pyHS100
3 - https://www.softscheck.com/en/reverse-engineering-tp-link-hs110/
4 - github/softScheck/tplink-smartplug/
Sorry for making the github links non-clickable. As a new user I am limited to 2 links per post