[SOLVED] Channel to control the LED status light on TP-Link HS200 light switch

Hi all,

I started setting up OpenHAB 2.4 on a RasPi last week, and have been mostly successful due in large part to the many helpful discussions I’ve found here. Thanks to everyone who contributes to the OpenHAB community!

I see that there’s a channel to control the LED light on the TP-Link HS105 smart plug, and I’m wondering if this can also be done for the HS200 light switch. When the HS200 is turned off, there’s an LED light embedded in the switch that helps you to find it in the dark. In most cases that’s great…but not so much in my bedroom at night. The low-tech solution of “cover it with tape”, is perfectly fine, but it would be even better if I could disable the LED only when I go to bed.

I’m guessing that it’s not possible, or else the channel would have already been added to the existing binding. I tried manually binding the “tplinksmarthome:hsxxx:xxxxxx:led” channel to a switch, but nothing happened when I toggled it.

I didn’t find any mention of this topic when searching the forums, but I’m still figuring out my way around so I apologize if it was already discussed and I missed it.

Cheers!

Russ

The HS200 uses a similar data format to communicate as the smart plugs. This could mean it could theoretically work with the HS200. In the binding there is no led channel defined for the HS200. But there is no specific reason why it was not added. I guess you tried creating a channel tplinksmarthome:hs200:xxxxxx:led? on a HS200 thing? and that didn’t work. Did you also tried connecting to the device by creating a thing configured as using a plug, like the hs105? and create a channel like: tplinksmarthome:hs105:xxxxxx:led?
And in any of these cases did you see anything in the log? Because if the command was send to the hs200, but the hs200 would not support it, it would give an error message back and that would be logged. If no such message was given. Than the command might not be send to the hs200.

As a last resort you could enable TRACE log level in karaf console (log:set TRACE org.openhab.binding.tplinksmarthome) (and afterwards disable by setting to DEFAULT). This will log the commands send and results received and could give more information on why it doesn’t work.

Yes, I created a channel for the HS200, and bound it to an item. The command was definitely sent, but there was no response from the device. I don’t recall seeing an error in the log.

I didn’t try configuring it like a plug, so I’ll try that and see what happens and let you know. Thanks!

It worked! As you suggested, I manually added a thing and identified it as an HS105 instead of an HS200:

tplinksmarthome:hs105:bedroom "Bedroom LED Test" [ deviceId="____", refresh=60 ]

I inserted the 40-character device ID from Paper-UI, and then created an item:

Switch Switch_Bedroom_LED "Bedroom LED" <switch> {channel="tplinksmarthome:hs105:bedroom:led"}

I was then able to add it to my sitemap and control the LED.

Thanks very much! Hopefully this can be added natively to the next version of the binding.

Hi Guys, I am having this same issue and would love a fix. I however am just finding his thread and dont quite understand what needs to be done. Is there an EXPLAIN LIKE I’M 5 option?

Any help would be appreciated.

Install the binding from the eclipse marketplace.

Welcome to the OpenHAB community! Are you at all familiar with OpenHAB? If you are just starting out, this might not be the greatest task to take on first as it involves creating a ‘Thing’ from a text file. Things can also be created for you in the Paper UI interface with out the need to do so manually by created a text file.
As Hilbrand said, you need to install his terrific TP-Link binding. If all this talk of bindings and things is over your head, go check this out

Hi Gaetano,

The original fix that Hilbrand gave me for controlling the LED status light on an HS200 switch was to manually add things via the configuration files in openHAB. Normally, you would identify the thing by its device type, so it would be:

tplinksmarthome:hs200:bedroom "Bedroom LED Test" [ deviceId="____", refresh=60 ]

However, at that time the LED status light was not controllable for the HS200 switch. So, when I wrote the thing definition, I told openHAB that the device was an HS105 plug.

tplinksmarthome:hs105:bedroom "Bedroom LED Test" [ deviceId="____", refresh=60 ]

This enabled me to create an item to control the LED status light (see above).

However, this is now unnecessary if Hilbrand subsequently added the LED status light to the HS200 in the binding, which is probably why he instructed you to just install the binding from the Eclipse marketplace. @hilbrand, am I correct in thinking that’s the case?

If you search the community, you’ll find instructions for adding the Eclipse marketplace to PaperUI, so that you can get the newest TP-Link binding.

Super thank you Russell because I knew that was a required step but …

1 Like

Yes that right. It’s available in the binding version available in the market place as well as in the 2.5M2 release.

1 Like