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

You can configure them manually by selecting a HS103 and entering the IP address. You should set a static IP for the EP10 on your router if you do this.

With auto-discovery, it uses the device ID to find the device, which will not change if your device gets assigned a new IP.

It would be nice to know how to find the device ID. Maybe it’s written on the device or in the app somewhere, but I couldn’t find it. In any case, it’s a lot of numbers compared to an IP. So, for now, I just reserved an address for my EP10 and manually added it as a HS103. Works fine.

Yup did the same thing and it worked. I left device Id blank but made sure to set the switches to static ip

Hi Daniel.

Thank you for this link. I’ve installed it today and it is working perfectly. I’m using node red on my Raspberry Pi to call the Python code.

Installed a KP115 today. Although listed as supported, it’s not shown on the list in PaperUI when trying to set it up, and Scan did not find it, so did not know device id. As others have said, solved by calling it HS110 in the config and using IP address.



Thing tplinksmarthome:hs110:energymonitorplugb  "KP115/HS110 smartplug"             [ ipAddress="192.168.0.235", refresh=60 ]

and


Switch       KP115      "KP115 Smartplug"                      (GF,gPlugs)   ["Switchable"]        { channel="tplinksmarthome:hs110:energymonitorplugb:switch" }

Number KP115_RSSI "KP115 Signal [%d dBm]"  <signal>  (GF) { channel="tplinksmarthome:hs110:energymonitorplugb:rssi" }
Number KP115_Power "KP115 Power Usage [%.2f W]" (GF,gPlugs) [ "CurrentTemperature" ] { channel="tplinksmarthome:hs110:energymonitorplugb:power" }
Number KP115_Energy "KP115 Energy Usage [%.2f kWh]"  <signal>   (GF,gPlugs) { channel="tplinksmarthome:hs110:energymonitorplugb:energyUsage" }
Number KP115_Current "KP115 Current [%.2f A]"  <signal>  (GF) { channel="tplinksmarthome:hs110:energymonitorplugb:current" }
Number KP115_Voltage "KP115 Voltage [%.2f V]"  <signal> (GF) { channel="tplinksmarthome:hs110:energymonitorplugb:voltage" }

TP-Link recently recently release a new LED Strip (KL400L5) and new RGB bulb (KL125). Looking at the addon documentation it looks like these haven’t been added yet.

update: I can confirm that the KL125 bulbs work perfectly, selecting KL130 when adding to OH.

KL400L5 Led strips can be added as a color changing bulb will display the current status however can’t send commands.

@hilbrand Any chance of getting the KL400L5 added? I am able to get a information from wireshark and the plugin (sample of turning on/off below with IDs removed)…

{"system":{"get_sysinfo":{"sw_ver":"1.0.5 Build 210616 Rel.122727","hw_ver":"1.0","model":"KL400L5(US)","deviceId":"deviceIDhere","oemId":"oemidhere","hwId":"hwIdhere","rssi":-54,"latitude_i":548594,"longitude_i":-787978,"alias":"Led Strip","status":"new","description":"Kasa Smart Light Strip, Multicolor","mic_type":"IOT.SMARTBULB","mic_mac":"11:11:11:11:11:12","dev_state":"normal","is_factory":false,"disco_ver":"1.0","ctrl_protocols":{"name":"Linkie","version":"1.0"},"active_mode":"none","is_dimmable":1,"is_color":1,"is_variable_color_temp":0,"LEF":0,"length":16,"light_state":{"on_off":0,"dft_on_state":{"mode":"normal","hue":230,"saturation":97,"color_temp":0,"brightness":7}},"lighting_effect_state":{"enable":0,"name":"Ocean","custom":0,"id":"oJjUMosgEMrdumfPANKbkFmBcAdEQsPy","brightness":7},"preferred_state":[],"err_code":0}}}
{"smartlife.iot.lightStrip":{"get_light_state":{"on_off":0,"dft_on_state":{"mode":"normal","groups":[[0,15,230,97,7,0]]},"length":16,"transition":0,"err_code":0}}}
{"smartlife.iot.lighting_effect":{"get_lighting_effect":{}},"context":{"source":"46a4d58b-6279-432c-ae23-e115c2db8354"}}
{"smartlife.iot.lighting_effect":{"get_lighting_effect":{"custom":0,"id":"oJjUMosgEMrdumfPANKbkFmBcAdEQsPy","brightness":7,"name":"Ocean","segments":[0],"expansion_strategy":1,"enable":0,"type":"sequence","duration":0,"transition":2000,"direction":3,"spread":16,"repeat_times":0,"sequence":[[198,84,30],[198,70,30],[198,10,30]],"err_code":0}}}
{"smartlife.iot.lightStrip":{"get_all_presets":{}},"context":{"source":"46a4d58b-6279-432c-ae23-e115c2db8354"}}
{"smartlife.iot.lightStrip":{"get_all_presets":{"preferred_state":[],"err_code":0}}}
{"smartlife.iot.lightStrip":{"set_light_state":{"ignore_default":0,"on_off":1,"transition":0}},"context":{"source":"46a4d58b-6279-432c-ae23-e115c2db8354"}}
{"smartlife.iot.lightStrip":{"set_light_state":{"on_off":1,"mode":"normal","groups":[[0,15,230,97,7,0]],"err_code":0}}}
{"smartlife.iot.lightStrip":{"get_light_state":{}},"context":{"source":"46a4d58b-6279-432c-ae23-e115c2db8354"}}
{"smartlife.iot.lightStrip":{"get_light_state":{"on_off":1,"mode":"normal","groups":[[0,15,230,97,7,0]],"length":16,"transition":0,"err_code":0}}}
{"smartlife.iot.lighting_effect":{"get_lighting_effect":{}},"context":{"source":"46a4d58b-6279-432c-ae23-e115c2db8354"}}
{"smartlife.iot.lighting_effect":{"get_lighting_effect":{"custom":0,"id":"oJjUMosgEMrdumfPANKbkFmBcAdEQsPy","brightness":7,"name":"Ocean","segments":[0],"expansion_strategy":1,"enable":0,"type":"sequence","duration":0,"transition":2000,"direction":3,"spread":16,"repeat_times":0,"sequence":[[198,84,30],[198,70,30],[198,10,30]],"err_code":0}}}
{"smartlife.iot.lightStrip":{"set_light_state":{"ignore_default":0,"on_off":0,"transition":0}},"context":{"source":"46a4d58b-6279-432c-ae23-e115c2db8354"}}
{"smartlife.iot.lightStrip":{"set_light_state":{"on_off":0,"dft_on_state":{"mode":"normal","groups":[[0,15,356,100,20,0]]},"err_code":0}}}

There is an issue on GitHub to track the KL400 feature request. I’ve put your command in there for reference: https://github.com/openhab/openhab-addons/issues/8709. It will require more work to add the ledstrip as it’s a new type with different command, and I’m not sure if I’ve all information to make it work (besides limited time to implement it).

@hilbrand I appreciate your effort for integration in advance! I’ve gotten command line instructions to adjust the strip successfully and updated github.

In the meantime I’m going to control through rules. But if you need any additional information or logging please let me know.

Also when you do have time to play with it, I would suggest just implementing on/off, color, brightness just like the bulbs for first iteration and only if you have extra time, the effects.

I have an HS105 (firmware version 1.5.6) with version 3.2.0 of the TP-Link binding. It works fine with OH except when I turn it on or off locally or with the Kasa app. In this case OH doesn’t see the status change. Any ideas what the problem might be?

Update: Upgrading to 3.3.0 M1 and reloading the TP-Link binding fixed the problem.

Hello,

I just got the new KS240 Kasa Smart Ceiling Fan Control and Dimmer Switch. I see the binding doesn’t find it. I was wondering if it’s possible to add the support for it?

Thank you!

This doesn’t appear to use Matter, so it should be possible. TP-Link is kind of all over the map right now with Matter and non-Matter devices.

I’d suggest opening a feature request on GitHub, but I’ve no idea what Hilbrand’s time is like now. I haven’t talked to him in a long time.

It’s sometimes possible to manually define the device type and choose an existing one. Try doing that and identifying it as an HS220. If it works, you’ll likely gain control over the light, but not the fan.

That’s not the end of the world, though. There’s an action command in the binding that can be used in a rule to retrieve data and send commands. So, if we can get your switch in as an HS220 (or another dimmer type), we should be able to gain control over the fan. It’ll just be a little more complex than linking an item to a channel.

Thqbsk for the input. I did put the binding on debug to see if it would discover it as an unsupported one and it doesn’t find it. Which scare me a bit.

I’ll try what you suggest. At least light command is a start.

Thanks!

The binding won’t find unsupported devices. If you can add it as an HS220 or another dimmer type, start a new topic and @ me in it to show you how to retrieve data and send commands. I’ll need to look at my rules to refresh my memory on how that works.

Ah I was checking in the log in debug cause in the code (and in the log in debug), it says “found unsupported device at x.x.x.x model y” like my KS220M. But unfortunately, it didn’t find the KS240. I tried manually creating a HS220 at the ip and it didn’t work. I think TP-Link changed something. This device was set using bluetooth and not wifi direct like the other one.

Ah, darn. Yeah, devices added with Bluetooth function differently, so I suspect that won’t work any time in the near future.

Oh :frowning: I would be happy to help but I really know nothing about how to contact these device or openhab bindings. I tried to learn how to do a bindings but I got lost.

At worst I would use api call in http mode if it was documented somewhere but tp-links doesn’t release any info on their local control.

Looks like Python-Kasa recently added the KS240, so you could install that and mqtt2kasa.

Oh, hmmm… how do I use that?

I’d start by reading the GitHub pages to see what’s required.

I manage to have python-kasa working in a lxc container. I can control the child device of ks240 no problem. mqtt2kasa is not compatible with it right now.

First thing I notice, this device require authentication. By what I’m reading, it’s discovery port is now 20002 on the new tapo protocol.