TP-LINK HS100 Smart Plug (WiFi)?

Thank you!!! That’s exactly what I needed to get started with my first Thing after getting openHABian up and running. The next project is going to be more interesting (difficult) than these HS100 switches. Adding a Z-Stick Gen 5 and trying to interface with my Schalge BE469 lock, so time for more digging through the forum.

seeing how its summer, this is one of the rules i wrote for the swtch, with a fan attached

  1 rule "kids room fan"
  2 when
  3 Time cron "0 0 20-4 1/1 * ? *"
  4 then
  5 if (tp_linksmarthome_hs110_a0abbec6_switch.state == ON)
  6 {
  7 tp_linksmarthome_hs110_a0abbec6_switch.sendCommand(OFF)
  8 return;
  9 }
 10 if (tp_linksmarthome_hs110_a0abbec6_switch.state == OFF)
 11 {
 12 tp_linksmarthome_hs110_a0abbec6_switch.sendCommand(ON)
 13 }
 14 end
1 Like

additionally instead of restarting rasbian as in step 4 on my debian based system i used

sudo systemctl restart openhab2.service

I installed the binding manually as follows:
1) Logged in to the raspberry pi
2) Go to the addons folder: cd /usr/share/openhab2/addons
3) Get the jar directly from github with wget: wget https://github.com/Hilbrand/openhab2-addons/releases/download/2.1.0-SNAPSHOT-TP-Link/org.openhab.binding.tplinksmarthome-2.1.0-SNAPSHOT.jar
4) Restart the raspberry pi (I don’t know if that’s needed, just to be sure).

Trying to create manual things using your binding - I know this is still not officially included in the OpenHab binding list, but I had to dig through your source to find the binding ID

<?xml version="1.0" encoding="UTF-8"?>

<binding:binding id="tp-linksmarthome"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0"
xsi:schemaLocation=“http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd”>

<name>TP-Link Smart Home Devices Binding</name>
<description>This binding integrates the TP-Link Wi-Fi Smart Home devices.</description>
<author>Hilbrand Bouwkamp, Christian Fischer</author>

</binding:binding>

Given your ability to create awesome things - do you have any doco on how to associate things manually with this binding?
im slowly getting through the doco to follow this pattern…

Thing <binding_id>:<type_id>:<thing_id> “Label” @ “Location” [ ]
Thing tplinksmarthome:device:plug “tp_linksmarthome_hs110_a0abbec6” @ “KIDS ROOM” [ipAddress=“192.168.X.X”, refresh=“30”]

does this look right?

Did you look in the README.md of the addon? It’s in the pull request and
contains examples for manual configuration.

tbh i didnt… I should know better…

thanks

Greetings, and thanks for creating this binding!

Any chance you can add support for the LB130 color changing bulb? This project may provide clues on the commands that control the bulb as it looks like they’ve implemented support for the LB120 and LB130. I’d be happy to test any changes you make to support the the bulb.

Cheers

I’ve added the binding to the Eclipse marketplace. The version of the binding is created for openHAB version 2.2.0-SNAPSHOT and supports HS100, HS105, HS110 and HS200 out-of-the-box. As well as smart range extenders R270K en R370K (although i haven’t tested those, so they might not work) Also I’m not sure if this binding works with earlier versions of openHAB.

Regarding TP-link bulb support. It should not be that difficult to add the bulbs (only time effort). I already did some research. I’m familiar with the project suggested However, I don’t have any of those bulbs. Currently I’m working on a bulb binding for another product, which give me some knowledge on how bulb related items work, which would make it easier to implement a TP-link version. But adding bulbs will still be a purely theoretical implementation for me. I might plan to implement it anyway, but it would be nice to have a number of users willing to test the binding preferable such that it covers the 4 available bulb types. So if anyone else is interested to test let me know.

Thanks Hilbrand. As I mentioned before I’m happy to help.

-m

Update on the TP-Link Binding regarding Smart Bulb support. I’ve added support for the Smart Bulbs and updated the pull request. The binding is available in the Eclipse Marketplace or download the binding jar directly: org.openhab.binding.tplinksmarthome-2.2.0-SNAPSHOT.jar Edit: old link: binding is part of openHAB or new beta version in Eclipse Marketplace (This is the jar build by the openHAB pull-request builder on GitHub, and thus should be in sync with the source code) Installation can be done as described in post #58 in this thread. (Use the link to new jar file instead of the one described in the post).

The new binding adds support for Smart Bulbs LB100, LB110, LB120 and LB130. However, since I don’t own any of those bulbs the implementation is purely based on what I could derive from other sources. So it might work or not :wink: So I would be grateful if you want to test this bindiing if you own any of these devices and to provide feedback. If you want to test. Here are some guidelines what will help determining if it works:

  • What model did you test?
  • Does switching on/off work?
  • Does changing the brightness work?
  • Does changing the color temperature work (if supported)?
  • Does changing the color work (if supported)?
  • Does setting a transitionPeriod work (this is a property)?

If anything doesn’t work please let me know what doesn’t. Also in debug log mode the response from the device is logged. Providing this in your report can help fixing an issue.

Feel free to review the code: https://github.com/openhab/openhab2-addons/pull/2348 Edit: merged. It also contains the README with more information.
As an extra the binding adds support for switching the led light of Smart Plugs on or off.

1 Like

I just installed the binding and it appears most things are working.

Model: LB130
ON/OFF: works
Changing Brightness: works
Color Temp: works
Changing Color: works
Transition period: not sure yet, need more testing.

I plan on doing more testing in the next couple of days and will report back. Thanks for updating the binding to support these bulbs.

momanz

Has anybody else tried the binding? As I didn’t receive a lot of feedback, I’m assuming it all works or nobody uses TP-Link light bulbs…

I just tried the binding, and it’s working for me with an HS100 smart plug. That’s the only TP-link device I own to test.

Works fine for me with HS200 wall mount plug. Thanks for the binding!

How to manually add a device by IP ?

I’m running OpenHAB in Docker, so there’s no auto-discovery available.

/Got it: https://github.com/Hilbrand/openhab2-addons/blob/316e3911d14144023d3574c23a49733af3585898/addons/binding/org.openhab.binding.tplinksmarthome/README.md

I am using it with several HS100 plugs without any problems for quite a few months; thanks for the binding and apologies for not reporting it earlier

just bought a couple of HS110 plugs to use with this binding, and they work a dream.
Thanks Hilbrand.

hi Hilbrand,

it looks like there might be a formatting error in the binding for the voltage channel for the HS110. The error in the logfile says

Exception while formatting value '244.449356' of item Plug_TPLK_1_Voltage with format '%d V':

If i set a format for the channel item the error goes away, but as the other channels are preformatted I thought i’d bring this to your attention.

@anthonygillet @Smartelli @dersimn @lipp_markus and @DSTM thanks for using the binding and reporting your experiences. If you have been using the binding for some time, you have an older version. I advice to install the latest version. You can install this version via the eclipse market place.

@DSTM Thanks for reporting the issue. I’ve fixed the problem. If you have in stalled it via eclipse marketplace I think by uninstalling and re-installing it you should get the new version.

@hilbrand thanks much!! I know that there is one in the marketplace, but the HS100 are supported by the older binding already. AND if I understood everything well enough, the marketplace bindings need to be installed manually after every update, which does not work so well for me as I am using the latest snapshots and update at least weekly. I just hope that after months of waiting your binding will be merged into openHAB eventually.