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

Hi All. I am very new to this openhab and appreciate your support. I want to add power and switch for TP-LINK lb120.

My item config is:-

Switch TPL1_Switch “Smart Bulb 1 Switch” (gLivingRoom) { channel=“tplinksmarthome:lb120:Dev_Bulb_1:switch” }
Number TPL1_Power “Smart Bulb 1 Power” (gLivingRoom) { channel=“tplinksmarthome:lb120:Dev_Bulb_1:power” }

However, i am unable to see them in my Paper UI Control except for the below which is working fine.

Number TPL1_Signal “Smart Bulb 1 Signal” (gLivingRoom) { channel=“tplinksmarthome:lb120:Dev_Bulb_1:rssi” }
Dimmer TPL1_Brightness “Smart Bulb 1 Bright” (gLivingRoom) { channel=“tplinksmarthome:lb120:Dev_Bulb_1:brightness” }
Dimmer TPL1_Temperature “Smart Bulb 1 Temperature” (gLivingRoom) { channel=“tplinksmarthome:lb120:Dev_Bulb_1:colorTemperature” }

I am using openhab 2.2 and tplinksmarthome binding and running on windows 10

Appreciate any help for beginners.

thanks in advance.

The Switch is available using the brightness channel. The power channel was introduced in openHAB version 2.3. You could try the market place version of the binding, but I’m not sure if it will work with openHAB version 2.2.

Much appreciated @hilbrad

  1. Updated the control for switch using bright which makes the switch control works
  2. reinstalled openhab 2.3 as upgrading openhab 2.2 using chocolatey caused tinylb issue. The power now working.

Next step is to get the Usage, current and voltage works. Below is my items. Not sure lb120 able to provide these details or i have to do more. Appreciate the guide here.

Number TPL1_EnergyUsage “Smart Bulb 1 Usage” (gLivingRoom) { channel=“tplinksmarthome:lb120:Dev_Bulb_1:energyUsage” }
Number TPL1_Current “Smart Bulb 1 Current” (gLivingRoom) { channel=“tplinksmarthome:lb120:Dev_Bulb_1:current” }
Number TPL1_Voltage “Smart Bulb 1 Voltage” (gLivingRoom) { channel=“tplinksmarthome:lb120:Dev_Bulb_1:voltage” }

The lb120 doesn’t provide that data. So it’s not possible to show the information.

Hi. Thanks for the quick reply. Appreciate it.

I notice there is a segment in the KASA app that shows the energy usage for the LB120.

I will upload the image shortly.

These energy usages stats are available via a different api call to the device but not supported by the binding. It’s not completely trivial to get an implementation right, for example if you reset the device it will start over again. Similar functionality could be obtained via openHAB persistent services.

thanks hilbrand.

I just installed a HS110 (plug with metering). When I installed the binding 2.3.0 and searched for devices, it found one device. But it´s the HS100 it found? Shouldn´t it have found HS110?

EDIT… Just ignore… Just discovered its the wrong plug the supplier have send. I´d order the HS110, but got the HS100…
Sorry!

Hi, new user here. Did you manage to solve your problem? I just received my RE270K am facing the same issues (and dissapointment) as you. Has there been any news on this issue?
Thanks!

I think you should be able to get the status of you device. Is that correct? But it’s not possible to control the device as I don’t know what the command is to send to the device. I don’t know how your Wireshark experience is, but that is needed to monitor the network and see what commands are send. If I have those command I add it to the binding. See also my other related comment:

exactly. Status “online” works. Switching doesn’t. After installing the newest add-on from the market, auto discovery is working as well.
I know only the barest of minimum basics in wireshark. After setting a filter for the ip address of the re270, no packages are detected anymore.
What would be the correct way to find the frames in question to get the commands?
Cheers.

I would expect it to send at least some packages :wink: The device talks via TCP port 9999. There is a plugin for Wireshark to decrypt the TP-link messages. If you see some messages then control the device from within Kasa (need to be local control) and see what commands are send to the device and what is returned. See the following github page with more details on monitoring the tp-link devices and information about the wireshark plugin:

Thanks, I had already installed the dissector plug in but sadly wasn’t able to catch any tcp frames on port 9999 (or identified as tp-link protocol by the plug in). I will return the repeater plug and go for one that is confirmed working with openhab. Sorry that I can’t be of more assistance to the community at this point.
Cheers and thanks again for your help!

Hello,
I have the same problem with the RE270K device. Is it already fixed or are there any tipps? Autodiscovery doesn‘t work with this device.

Auto discovery is working with the market place version of the binding and in 2.4 snapshot. For controlling the device I need the json that is used to communicate to implement support.

Cheers

I have HS110 and trying to use it with OH 2.3. I’ve installed TPLINK binding 2.3. through paperUI
I tried to implement the simple example on this page: TP-Link Smart Home - Bindings | openHAB

Here are my files:

tplinksmarthome.things
tplinksmarthome:hs110:home “Living Room” [ ipAddress=“192.168.99.222”, refresh=30 ]

BTW the example has “home” as the link. Do I have to create a link named “home” somehow?

tplinksmarthome.items
Switch TP_Switch “Switch” { channel=“tplinksmarthome:hs110:home:switch” }

home.sitemap
Switch item=TP_Switch label=“Switch”

I understand this setup should be ONLINE now?
Instead things configuration page shows the “Living room” as:

OFFLINE - COMMUNICATION_ERROR No route to host (Host unreachable)

What am I missing?

This means it can’t find the device at the given ip address. Can you connect to it from the kasa app? Or does Paper UI find it if you use discovery?

‘Home’ is an example name. You can use anything here, as long as you use the same in things file and items file.

Hello,

Sorry for late reply. Yes I can connect the device to the Kasa app and use it normally.

I did find the plug IP by scanning the local network with SSL capture. I am fairly sure that the one I found is the right IP address. Is there any more certain way to get the address?

Paper UI didn’t find it automatically. How do I use discovery? I needed to add the device manually like the example showed.

Btw the error message has changed into this:

OFFLINE - COMMUNICATION_ERROR Connection refused (Connection refused)`

Hmm strange? Can you ping the device from your openHAB server? It’s possible the ip address was changed in the mean time because of dynamic dchp? It’s still strange discovery didn’t find it. It’s not on a different subnet? of your router is blocking certain ports?

Hi,

I have two HS110, for one I did software update trough the Kasa app (1.2.5), for one I didn’t (1.0.8). The updated device was found automatically and appeared in the Inbox of the Paper UI, but the status was shown as: OFFLINE (COMMUNICATION_ERROR): Connection timed out (Connection timed out).

The device for which I didn’t do the software update all is fine. I can connect and use it without problems in OH2. It seems that the new software update has changed the protocol.