New TP-Link Smart Home binding with Bulb, Plug and Switch Support

Cool. I agree that this makes more intuitive sense for how most people would use it. Thanks!

Hey guys,

my HS100 keeps losing the connection and then picking it up again. It happened before every now and then, but now itā€™s sometimes twice an hour.
Debug log gives me the following:

2020-04-20 15:30:57.261 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - Start scan for TP-Link Smart devices.
2020-04-20 15:30:57.362 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - TP-Link Smart device discovery returned package with length 568
2020-04-20 15:30:57.367 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - TP-Link Smart Home device 'KĆ¼chenlampe' with id 123 found on 192.168.178.20 
2020-04-20 15:31:04.387 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - Discovering poller timeout...
2020-04-20 15:32:04.444 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - Start scan for TP-Link Smart devices.
2020-04-20 15:32:05.765 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - TP-Link Smart device discovery returned package with length 568
2020-04-20 15:32:05.770 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - TP-Link Smart Home device 'KĆ¼chenlampe' with id 123 found on 192.168.178.20 
2020-04-20 15:32:12.788 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - Discovering poller timeout...
2020-04-20 15:33:12.822 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - Start scan for TP-Link Smart devices.
2020-04-20 15:33:19.832 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - Discovering poller timeout...
2020-04-20 15:33:28.397 [hingStatusInfoChangedEvent] - 'tplinksmarthome:hs100:kueche' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Network is unreachable (connect failed)
2020-04-20 15:33:58.948 [hingStatusInfoChangedEvent] - 'tplinksmarthome:hs100:kueche' changed from OFFLINE (COMMUNICATION_ERROR): Network is unreachable (connect failed) to ONLINE
2020-04-20 15:33:28.397 [hingStatusInfoChangedEvent] - 'tplinksmarthome:hs100:kueche' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Network is unreachable (connect failed)
2020-04-20 15:33:58.948 [hingStatusInfoChangedEvent] - 'tplinksmarthome:hs100:kueche' changed from OFFLINE (COMMUNICATION_ERROR): Network is unreachable (connect failed) to ONLINE
2020-04-20 15:34:19.902 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - Start scan for TP-Link Smart devices.
2020-04-20 15:34:26.909 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - Discovering poller timeout...
2020-04-20 15:34:41.606 [hingStatusInfoChangedEvent] - 'tplinksmarthome:hs100:kueche' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Read timed out
2020-04-20 15:35:30.457 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - Start scan for TP-Link Smart devices.
2020-04-20 15:35:37.470 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - Discovering poller timeout...
2020-04-20 15:36:20.873 [hingStatusInfoChangedEvent] - 'tplinksmarthome:hs100:kueche' changed from OFFLINE (COMMUNICATION_ERROR): Read timed out to OFFLINE (COMMUNICATION_ERROR): Connection timed out (Connection timed out)
2020-04-20 15:36:23.992 [hingStatusInfoChangedEvent] - 'tplinksmarthome:hs100:kueche' changed from OFFLINE (COMMUNICATION_ERROR): Connection timed out (Connection timed out) to OFFLINE (COMMUNICATION_ERROR): No route to host (Host unreachable)
2020-04-20 15:36:37.505 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - Start scan for TP-Link Smart devices.
2020-04-20 15:37:05.763 [DEBUG] [rnal.TPLinkSmartHomeDiscoveryService] - Discovering poller timeout...
2020-04-20 15:37:17.323 [hingStatusInfoChangedEvent] - 'tplinksmarthome:hs100:kueche' changed from OFFLINE (COMMUNICATION_ERROR): No route to host (Host unreachable) to OFFLINE (COMMUNICATION_ERROR): Connection timed out (Connection timed out)
2020-04-20 15:37:22.599 [hingStatusInfoChangedEvent] - 'tplinksmarthome:hs100:kueche' changed from OFFLINE (COMMUNICATION_ERROR): Connection timed out (Connection timed out) to ONLINE

Did you ever come across this? Do you have an idea what could be leading to this?

Thanks
Alex

I have a HS110ā€¦ I dont have that issueā€¦ Could be a faulty piece you have. Check you Wifi though.

Weird thing is that everytime this happens, I also get the following errors from the http and Energenie (LAN powersockets) bindings:

2020-04-22 17:40:08.917 [ERROR] [org.openhab.io.net.http.HttpUtil    ] - Fatal transport error: java.net.SocketTimeoutException: Read timed out
2020-04-22 17:40:08.921 [ERROR] [.energenie.internal.EnergenieBinding] - Failed to connect to ip 192.168.178.45

Iā€™m still connected to OH via Wifi though - the logviewer keeps updating, so OH isnā€™t disconnected. Other data like Xiaomi sensors or item updates come through as wellā€¦
I already set the bindings log levels to Debug, but that doesnā€™t help meā€¦ Do you have any ideas on how I could investigate?

I am supporting that request. Would be great to see an implementation of TP-Link Tapo products, especially Tapo P100. Thanks the creator for the great binding!

3 Likes

Is anybody working on a binding for Tapo devices? When it comes to OpenHAB Iā€™m always keen to push the envelope, but itā€™s also nice to know when its stuck shut with superglue.

This is the app used:


This is an apk download website:
https://apps.evozi.com/apk-downloader/?id=com.tplink.iot

This is an apk / java de compiler:
http://www.javadecompilers.com/

Now we need someone who understands java and can figure out how the protocol works

At the moment only Alexa (and Google Home) communicates with Tapo devices. If you have an Echo or other Alexa device, you can use Amazon Echo Control Binding to address the Tapo devices as a work around.

2 Likes

Thatā€™s a good workaround. I didnā€™t know it was possible to control other devices through the Echo binding. The 10-minute polling interval could be annoying, though.

I donā€™t need it, but it would be amusing to have Google controlling devices attached via Echo. I imagine the routing would look like this:

  1. Google Assistant talks to openHAB Cloud
  2. openHAB Cloud talks to openHAB
  3. openHAB talks to Amazon
  4. Amazon talks to TP-Link Tapo cloud
  5. TP-Link Tapo cloud talks to your Tapo device.

Although itā€™s possible that the Tapos can be locally controlled by Echo, in which case itā€™s only four steps. :wink:

Hello Hilbrand,
IĀ“m usig TC120 Cam und want to add it to openhab.
At the app it is shown, that the cam is connected to my wlan and the MAC-adress is shown.
After starting advanced IP-scanner at my PC I also see the IP-Adress

Hi apparently someone recently reversed engineered the access to these cameras, at least seems to work with KC100 (which I own) and KC105, probably KC120 too.

Here is a link to a step by step process of how to access the camera, hope this helps.

I would be more than willing to test the binding

Cheers

Nuno

At this time, the TP-Link Smart Home binding only supports plugs, switches and lights. I canā€™t speak for Hilbrand, but since cameras havenā€™t been added before I would guess that thereā€™s no intention to do so in the future.

You might have more success discussing this in the thread for the IP Camera binding. @matt1 is always looking for people to test and add new cameras.

Well, I assumed that since this was a generic TP-link Smart Home binding, that the objective here was to eventually include all line of products, and also Hilbrand previously answered that what was keeping him from including the cameras was the fact he didnt had one and the access to the camera was obscure and someone would have to reverse engineer the process for him to consider including it in the binding.

The reason I didnt tried reaching the IP camera binding was simply because the Kasa cameras dont work as a regular IP camera, but I can also try him, just not sure if he would be interested in supporting a camera that works quite differently from the majority of ip cams

Thanks for the clarification. Iā€™ve never read back as far as Jan 2018, and didnā€™t look at which of his posts you were replying to.

Tha makes sense, but I had no reason to assume youā€™ve thought through it this far. Hence my suggestion to ask now that thereā€™s more information available. :wink:

From a quick glance it will probably already work in the ipcamera binding you would just need to give it the https URL with the encoded password to the ffmpeg input config of the binding.

1 Like

Well I tried using his method but somehow I got stuck with the authentication process.
Its not very clear to me where/how he is putting his credentials, also tried encoding using the process on his pseudo-code and didnt work, although someone managed to make it work so im assuming im doing something wrong, just havent figured it out yet.
I droped the author a message asking for clarification

1 Like

Yep I still donā€™t own a TP-Link camera :wink: So I have no direct plans to add them.

Looking at the reversed engineerd information it looks similar communication as other TP-Link devices. So if you manually configure a HS100 you might be able to see the status and even might be able to switch the camera led on and off. I donā€™t know what actually switching on or off might do or if there are any other commands possible. Basic device status or maybe some other commands might be something to add to the binding. But streaming would be much more complex I would guess and might be better serviced by the ipcamera binding. Maybe extending that binding with specific support for tplink to be able to easier get the correct url or let the tplink binding provide the url in some way to the ipcamera binding.

1 Like

Open a new thread and mention my name in it and if your willing to post debug log output and try a few things I will take a look in a new dedicated thread.

1 Like

any progress on the p100 plugs?