TP link binding problems with HS100

As a newbie to OpenHAB, I’m going up a steep learning curve, so thought I’d start with trying to automate a single TP Link HS100 switch.

I’ve installed the switch through Kasa - which works fine, but I can’t discover it in the OpenHAB Paper UI. I’m using the TP Link binding 2.5.1, and running OpenHAB on Windows 10. If I try to manually install with the IP address (fixed in DHCP) then it sometimes works, but frequently experiences communications errors.

Any help or a point in the right direction gratefully appreciated. I’ve seen similar posts in the community, but can’t see an obvious solution.

Thanks

Can you describe what you’re doing in PaperUI to discover your Kasa switch? If the binding is installed, the switch should just be autodiscovered and pop up in your Inbox. If not, you can go to the Inbox and trigger a search on that binding.

I can’t tell if you’ve gotten this far since you’re also talking about manually installing and communication errors.

Russell,

Thanks for the quick response. I’ve installed a number of other consumer devices (TV, squeezebox etc.) in OpenHAB, so fairly confident in the basic approach. As you say - they just appear in the PaperUI Inbox without even pressing search.

For the TPLink switch, the actions I’ve followed are as follows:

  1. Pair the switch with the Kasa software as per instructions. Kasa successfully discovers switch, and can control it (as can Google home)

  2. Install the TP Link Smart Home binding in Paper UI. I’ve tried both the binding in the OpenHAB distribution (2.5.1) as well as the “Beta” in the Eclipse marketplace (not clear which is the more recent?).

  3. Neither cause the switch to appear in the inbox (even after re-starting OpenHAB/computer)

  4. Press “Thing not listed - Search for things” option at the bottom of the inbox, and searched under the TP Link Smart home binding. This doesn’t find it either

  5. Press “Thing not listed - add manually”. Enter switch IP address.

This last step has worked (sometimes) - but then the switch regularly loses communication with the OpenHAB server. Other times I just get an “offline - communication error” in the PaperUI from the start.

It’s rather infuriating - so really appreciate your help to track down where I’m going wrong…

How far away from the wifi access point is your tplink hs100? Because the symptoms are typical for when the device is to far away or has bad reception. In such cases it can regularly loose connection or it can be a problem to get a connection.

Adding to what @hilbrand said, I had issues with a light switch that was only 15ft from my router constantly going offline due to the refrigerator being partially in the path. I upgraded to a mesh router so that I had better coverage throughout my house, and that’s helped a lot.

Your issue doesn’t appear to be with discovery, so deleting/re-adding the thing in PaperUI likely isn’t going to help.

1 Like

Interesting thought…

What does the RSSI channel say that the WiFi signal strength is at the HS100?

My HS100 is less than 3 M away from the router, with a stone wall between it.

The RSSI is showing at -41db

All,

Thanks for your responses. I’d also wondered whether it was a problem with the network strength - although would that not also effect operations of the switch through Kasa (which continues to work OK)? Why would OpenHAB be more sensitive to it?

@hilbrand - in answer to your question, the switch is located about 8m away from the main router (although a few stud walls etc. in the way), and about 5m from a wifi extender (on the same SSID). I’ll try an experiment to see if it will auto-discover tonight, with it right next to the router.

Stuart @MDAR - how do I access the RSSI channel? I normally only see a switch and LED channel… What would a reasonable signal strength be?

Russell’s @rpwong - if I need to, any recommendations on mesh routers that are sufficiently configurable etc. to be good with home automation?

Thanks All !

Hi

For me, the RSSI channel is shown in PaperUi, like this

As for an acceptable signal strength, that’s more of a dark art.

Assuming both transmitters have the same power, IE one device receives -54db and can send back a signal that achieves -54db at its destination.

How often can you hear someone on your mobile, but they can’t copy what you’re saying, because you’re phones transmitter is weaker than the cell site.

All that said, in a domestic environment, all WiFi devices should be on a par with one another.

(Routers often used to use the same WiFi cards)

So, if your HS100 gets an RSSI of better than -70db, it should be okay.

The lower the number, the better.

I’m curious about this statement. As far as I’m aware, wifi extenders should not have the same SSID as your main router, because you would then have two identical SSIDs competing with each other. That could be part of the problem. Can you clarify what your wifi setup is?

Adding to @MDAR’s note about the RSSI channel, I believe you have to click “Show more” in PaperUI to see/enable it.

Assuming you’ve already ruled out a network/wifi issue, I’ve found it necessary to restart openhab from time to time to trigger discovery. Otherwise, I’ve been using about 20 tp link switches via openhab now with no issues.

Thanks again for the responses. As a relative newbie, it’s great to have the help of a community like this.

Think I’m making progress - I still can’t get Paper UI to autodiscover (even with it right next to the router), but I have found the RSSI channel after manually adding with the IP address. Signal strengths vary between -50dBm and -30dBm. I’ll keep an eye on them over the next few days

Russell @rpwong - I was careless with my language about the Wifi extender. It’s an access point (TP link ironically), hard-wired to a unmanaged switch. Having logged into it, the HS100 is currently connecting through it rather than the main router.

If you continue having issues, I would test what happens if you remove the AP and ensure your openHAB machine and Kasa switch are both going through the main router. I don’t know for sure that that’s the problem, but it would cut down on the variables.

1 Like

Russel, it is really great to see you participating in the forum again and chipping in to help folks, thank you

2 Likes

Thanks, Andrew, I appreciate you saying so. I just got really busy in the fall with other things and stopped checking in. I’m not sure that I’m any less busy now, but I enjoy being part of this community.

2 Likes

To expand a tiny bit on Russell’s advice.

I’ve been having a small issue with my AVM Fritz WiFi mesh setup recently, where it turns out that one of the Mesh access points was in WiFi Bridge mode, rather than LAN Bridge.

(Like you I have a hardwired infrastructure, with Mesh APs for expanding the WiFi coverage)

In effect if it couldn’t get a stable WiFi connection back to the router, it’s own DHCP server would kick in, so that a client would get an IP and be able to access the Mesh AP to edit the configuration etc.

But what they really meant was that the affected clients would lose any internet access.

Now that I’ve set it back to LAN Bridge mode, everything is working well.

I’m just wondering if something similar is happening with your HS100 ?

1 Like

Once I had a problem exactly with TPLink HS100 and wifi extender (although on openHAB 2.4).

I got “offline - communication error” as well as you get.

The problem was really tricky.

In simple words,
IP address of the HS100 changed sometimes. Thus OpenHAB could not find the device on the known address.

Under the hood,
I had configured the static IP lease for HS100 in routers DHCP server configuration, so could not get why the IP can ever change!

But a combination of

  1. WiFi Extender which during its operation relays the WiFi packet and places extender’s MAC address in the Ethernet frame instead of HS100 original address. (Indeed, it is a relay, so it asks to send the packets back to the HS100 via the extender, the extenders MAC needs to be a communication point for the extended Wifi router, not HS100 direct address)

AND

  1. Router leased IP addresses based not on declared MAC address in “DHCP - Discover” IP level packet, but based on source MAC address of Ethernet frame (in fact Extender MAC, not HS100 MAC).

Thus static IP configuration did not work all of the times.
The HS100 either connected directly to the router and got valid static IP address, or it connected to the extender and got different IP.

My solution was to disable DHCP server on router and enable it on RaspberyPI (which hosts OpenHAB in my network). DHCP server on RPi leased static IP based on MAC declared in DHCP - Discover" IP level packet. And it always holds HS100 address. thus static IP leased worked both for direct Wifi connection and for connection via extender.

After that OpenHAB Tp-Link binding started to work stable.

1 Like

The current version of the binding can be configured (and will do automatically when using discovery) with the id of the device. If the ip address than changes the openHAB binding will update the ip address and be able to continue working.

4 Likes

Does that work even if you manually enter the IP address for the initial connection?

Hi,

only my 5cents.

installed this hs100 a couple of days ago as well for the first time.

i installed the mykasa app, (without a cloud account) connected the hs100 to it.
You can see the WiFi strenght via the app easely as well btw. (lower is better)
If you would use openhab to readwifi strenght… my guess is that the signal is good at that particular moment anyway, else it would not be connected.
My brain says that if you can add it and its only sometimes available… it could indeed be a wifi issue, but then your google would not work either, right? :stuck_out_tongue:

So after the Mykasa app…
I logged in to my router to add static IP to my device (as i do with any device that needs to connect to openhab (phones, camera’s, tv, yeelight bulbs,…)

Then via paperui i installed the default TP-LINK binding.
By then it had put my smartplug in the the inbox to use.
The rest was straight forward.

I can you give items example and such if needed.

only difference is that i run my openhab on a RPI 3
openhab version 2.5.0 (i dont think i have seen the version you use?)
tp link binding 2.5.1

i am also very curious what the results are form connecting to a different device.

Bjorn,

Thanks for the 5 cents :slight_smile: I’m running OH 2.5.1 on Windows 10. I hope to migrate to a Pi4 in due course - once I’ve built confidence that I can more or less work my way up the learning curve!

Not sure what’s changed, but the HS100 has been pretty stable over the last few days - in fact since I added the RSSI channel suggested by @MDAR I tried both static & dynamic IP addresses - but it didn’t make any difference to the auto discovery. I suspect the root cause of the problems is my WiFi set-up (Huawei router plus TP Link AP). Still thinking about upgrading to a mesh.

@hilbrand - given the IP problems, I too am interested in @rpwong 's question about device ID. Is this fixed for a given switch? (like the MAC?) If I remove the Thing (having originally entered the IP address), and then re-add with the Device ID, does it make any difference?