TPLink Kasa and Tapo - Looking for a developer

I just went through a whole house replacement of WeMo’s to Kasa’s (38 devices) because WeMo’s are dead by 1/1/26.

What I found out is the Kasa HS200 basic light switch requires authentication and the Kasa binding doesn’t support this.

A person found a work around using the TAPO binding because it has the authentication piece built into the binding, but the device model doesn’t match (light bulb vs. light switch).

The binding on the THING bounces every 30 seconds on probing because the device model doesn’t match what the binding has in options. See below . . .

14:32:15.716	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:12b879e536' changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-FA-EC'. Check IP-Address
14:32:15.717	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:12b879e536' changed from OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-FA-EC'. Check IP-Address to ONLINE

14:32:15.719	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:4f12b0e30b' changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-E6-FC'. Check IP-Address
14:32:15.721	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:4f12b0e30b' changed from OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-E6-FC'. Check IP-Address to ONLINE

14:32:15.723	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:04c89d5034' changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'20-23-51-3D-74-15'. Check IP-Address
14:32:15.727	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:04c89d5034' changed from OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'20-23-51-3D-74-15'. Check IP-Address to ONLINE

14:32:15.732	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:4f6b1a7926' changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-E6-CC'. Check IP-Address
14:32:15.734	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:4f6b1a7926' changed from OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-E6-CC'. Check IP-Address to ONLINE

14:32:15.745	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:7803f9b9af' changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-EF-A3'. Check IP-Address
14:32:15.748	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:7803f9b9af' changed from OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-EF-A3'. Check IP-Address to ONLINE

14:32:15.750	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:afec795c05' changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'20-23-51-3D-54-69'. Check IP-Address
14:32:15.760	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:afec795c05' changed from OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'20-23-51-3D-54-69'. Check IP-Address to ONLINE

14:32:15.779	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:4333c74068' changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-E5-F0'. Check IP-Address
14:32:15.781	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:4333c74068' changed from OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-E5-F0'. Check IP-Address to ONLINE

14:32:15.793	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:fc5cff8a64' changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-E7-2E'. Check IP-Address
14:32:15.795	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:L510:e9a2babbc6:fc5cff8a64' changed from OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-E7-2E'. Check IP-Address to ONLINE

This is the thread below talking about how to get Kasa HS200 working in OH using the Tapo binding vs. the Kasa Binding.

TPLink Kasa HS200 Connection Refused - Setup, Configuration and Use / Beginners - openHAB Community

From what I can tell, there is NO code owner for the Kasa or Tapo bindings and this is clearly an issue / hack to allow Kasa HS200 to work with in OH.

The simplest solution would be to add the HS200 as a device option with in the Tapo binding to stop it from cycling the THING every 30 seconds.

Looking for a developer that would help?

Best, Jay

I wish I had the skills to add, but I can offer only to help test. That being said I have a very similar setup and I’m not seeing any cycling in the logs. Using multiple TP-Link HS200 (newer hardware 3.0/firmware 1.0.10) switches via the Tapo binding. Specifically I mapped these HS200’s to the L510 Tapo device. The only effect I do notice is that on restarting OH after clearing cache it can take hours for the devices to be detected by OH even though they are active on my wifi and accessible via the kasa app. However once detected they appear stable.

In fact, what is needed is a merge of the two. Use Python Kasa. Python Kasa support both authentication method and can detect itself which one to use. It is also very actively developped

It’s not the switch type the problem, I have 30 HS200 working with Kasa and 1 that doesn’t. The difference is the hardware version. The new one are using tapo authentication. Home Assistant properly implemented Python Kasa and everything is working flawlessly on their end.

The current problem is we have 2 binding, one for Kasa aka TP Link and one for Tapo. This need to change and be merged.

I know openhab now can use python script, maybe just using python-kasa library would make everything way simpler. Saying that without a clue, I did toy with python kasa but I’m unable to make a binding. I tried and can’t grasp how it work.

edit: What’s worst is my HS200 that require tapo authentication, if I cut connection to the internet, it stop working even on local using kasa app. Support says it’s suppose to work, but it clearly doesn’t. The switch blink red and show offline in the app. And when trying with openhab tapo-control binding, it’s not working (our binding probably connect to the cloud). TP-Link documentation says when third party integration (HA) is enabled in the tapo app, it should be able to use tapo authentication to the switch after it’s been onboarded in the app, but locally without cloud. Doesn’t seems to work

Hey Joe, these entries are NOT in the logs per se, they are in the streaming logs behind the scenes of OH.

Use this URL → http://openhabian:8080/developer/log-viewer

Swap out the “openhabian” with your IP address.

Best, Jay

Correct, that is exactly the log I’m referring to.

Did you put the local IP into the thing?

Not sure why your not getting what I am in this log area?

Please post a screen shot of your thing details?

Best, Jay

Correct, harcoded IP, secured klap using L510 Tapo thing. That’s it.

Exactly like mine but I get the errors every 30 secs.

Best, Jay

Did you add it to the tapo control app and enable third party authentication? see TP-Link Smart Home - Home Assistant

Yes with Alexa and everything works with them.

Its just the THING errors in the logs that are concerning.

I’m not using HA.

Best, Jay

I know you aren’t on HA, we are on openhab forum. I linked it for the information on how to enable third party. Alexa and Google don’t count, they are direct integration though their own cloud service. To have local authentication working, you must follow the procedure to onboard the device with Tapo Control and enable Third Party (like HA). There is instance where you must reset the device and rejoin for it to work. I simply linked the HA articles cause they outline all possibility.

The thing error but is it working? I have no error on mine

Works fine, want to stop THING from flipping up/down every 30 seconds.

Best, Jay

Hi,

I am experienced with OpenHAB bindings and the quirks around TP Link device authentication. Getting the HS200 to play nice with the Tapo binding is doable with a few targeted updates.

You can reach out to me on my email here

Colin

An attempt to add support for the HS200 is at https://smedley.id.au/tmp/org.openhab.binding.tapocontrol-5.1.0-SNAPSHOT.jar - I can’t test as I don’t have a device here.

Source at GitHub - psmedley/openhab-addons at tapo-hs200

I’m running OH 4.3.7 which this version won’t work.

I’ll see if I can build it for 4.3.x this evening

https://smedley.id.au/tmp/org.openhab.binding.tapocontrol-4.3.7-SNAPSHOT.jar

Recreated each THING with the proper HS200 Thing now. Still getting these which is strange based on HS200 is found and is setup as.

19:25:42.440 INFO openhab.event.ThingStatusInfoChangedEvent Thing ‘tapocontrol:HS200:e9a2babbc6:be91c80ca6’ changed from OFFLINE (CONFIGURATION_ERROR): found type:‘HS200’ with mac:‘60-83-E7-C1-EF-D1’. Check IP-Address to ONLINE
19:25:42.468 INFO openhab.event.ThingStatusInfoChangedEvent Thing ‘tapocontrol:HS200:e9a2babbc6:d427645749’ changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): found type:‘HS200’ with mac:‘60-83-E7-C1-FA-EC’. Check IP-Address
19:25:42.471 INFO openhab.event.ThingStatusInfoChangedEvent Thing ‘tapocontrol:HS200:e9a2babbc6:d427645749’ changed from OFFLINE (CONFIGURATION_ERROR): found type:‘HS200’ with mac:‘60-83-E7-C1-FA-EC’. Check IP-Address to ONLINE
19:25:42.499 INFO openhab.event.ThingStatusInfoChangedEvent Thing ‘tapocontrol:HS200:e9a2babbc6:7f82f24a36’ changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): found type:‘HS200’ with mac:‘60-83-E7-C1-E6-CC’. Check IP-Address
19:25:42.501 INFO openhab.event.ThingStatusInfoChangedEvent Thing ‘tapocontrol:HS200:e9a2babbc6:7f82f24a36’ changed from OFFLINE (CONFIGURATION_ERROR): found type:‘HS200’ with mac:‘60-83-E7-C1-E6-CC’. Check IP-Address to ONLINE
19:25:42.649 INFO openhab.event.ThingStatusInfoChangedEvent Thing ‘tapocontrol:HS200:e9a2babbc6:fe743291bf’ changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): found type:‘HS200’ with mac:‘60-83-E7-C1-E5-F0’. Check IP-Address
19:25:42.652 INFO openhab.event.ThingStatusInfoChangedEvent Thing ‘tapocontrol:HS200:e9a2babbc6:fe743291bf’ changed from OFFLINE (CONFIGURATION_ERROR): found type:‘HS200’ with mac:‘60-83-E7-C1-E5-F0’. Check IP-Address to ONLINE

Best, Jay

Trace log?

Here’s the debugging I did this morning.

The original OH Tapo binding, trace on with HS200’s devices setup as L510’s (works)

TAPO Orig Binding using L510 Thing.log (257.5 KB)

Your Tapo binding, trace on with HS200’s devices setup as L510’s (works)

TAPO Your Binding using L510 Thing.log (182.6 KB)

Your Tapo binding, trace on with ONE HS200 setup (device → a583090fcf) (does NOT work)
tapocontrol:HS200:e9a2babbc6:a583090fcf

TAPO Your Binding using HS200 Thing.log (196.6 KB)

Still with the ONE added HS200 Thing, still getting these in the OH Log Viewer every 30 seconds.

09:22:02.548	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:HS200:e9a2babbc6:**a583090fcf**' changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-EF-A3'. Check IP-Address
09:22:02.571	INFO	openhab.event.ThingStatusInfoChangedEvent	Thing 'tapocontrol:HS200:e9a2babbc6:**a583090fcf**' changed from OFFLINE (CONFIGURATION_ERROR): found type:'HS200' with mac:'60-83-E7-C1-EF-A3'. Check IP-Address to ONLINE

Best, Jay

This log seems to contain ONLY the trace messages which makes it impossible to determine what’s going on.