TP-LINK HS100 Smart Plug (WiFi)?

First shot:
PR: https://github.com/openhab/openhab2-addons/pull/2018
Project: https://github.com/computerlyrik/openhab2-addon-hs110

I’d be happy to hear from HS100 Users - i’m owner of HS110 (with powermeter)

1 Like

Hey Christian,

thank you for the addon.

When i try to install this i get an error:

[16:47:52] pi@openHABianPi:/usr/share/openhab2$ git subtree pull --squash --prefix addons/binding/org.openhab.binding.hs110 https://github.com/computerlyrik/openhab2-addon-hs110.git master
fatal: Not a git repository (or any of the parent directories): .git

I tried the url with and without the ‘.git’. Where is my error?

Best regards,
Dirk

Perhaps the project information was somewhat misleading. The commands you issued are used to ‘copy’ the source code from a separate github project into the openhab2-addons tree.

I updated the Readme for your need: https://github.com/computerlyrik/openhab2-addon-hs110#building--testing

Ok.

Thank you for the clarification!

All just wondering if there will ever be a binding for the TPlink sockets (HS100).

They are around a while now (2-3 years) and seem one of the more popular WIFI sockets and its strange there isnt a binding for it yet…

I see lots of users using exec and scripts etc… would a binding not be more effective than tons of scripts.

Is the issue with TPLink or the complexity to do it ???

Thanks

2 Likes

Script isn’t working for me; thoughts?

nevermind i got it

@computerlyrik thanks for starting this. Would it be possible to add a .jar to github for those users who don’t have a development environment setup (for example myself :slight_smile: )? Will happily wait until the PR merges if not possible, but just wondering.

How would one do the following:

/opt/openhab2/conf/scripts/hs100.sh 192.168.10.42 9999 status

Run that, and based on if it was on or off, go and set something in openhab.

I assume it would have to be:
Rule calls another script that runs this script with the parameters.
Then the first script would have to maybe set something in rest(lets say postUpdate to a switch in openhab)?

How would one do this?

Could you please pack it to a jar?

1 Like

Has anyone had any luck with using the script above on openhab2 exec binding following this thread: Exec 2.0 : Updated : new functionalities to address your concerns

Or should I just wait for the addon?

Sorry, my posts got hidden and flagged as spam - according to my Inbox by some users.
I do not know how to restore them.
Is this how OpenSource feels like?

@mjwedeking @lipp_markus
I did a Pre-Release on github - please find it by yourself. It seems, posting weblinks leads to Messages like

Your post was flagged as spam: the community feels it is an advertisement, something that is overly promotional in nature instead of being useful or relevant to the topic as expected.

Is this a hint to not participate on the openhab-community anymore?

@computerlyrik Thanks so very much!!! Got it!!

@computerlyrik just a quick update, while discovery seems to work with HS100’s (I only have those), the logfile gets swamped with error messages; logged an issue on github with more details. Let me know if I can help more.

Looking for a TP-Link addon I found this thread and the addon created by @computerlyrik. As this addon could need some improvements I’ve picked up the addon and basically rewrote it completely. It’s now pending in a new pull request on GitHub. For the time being I’ve added a release jar to my fork of the openhab2-addons: https://github.com/Hilbrand/openhab2-addons/releases/tag/2.1.0-SNAPSHOT-TP-Link Edit: dead link: binding is part of openHAB or new beta version in Eclipse Marketplace

hi @hilbrand

Any chance there will be compatibility with the HS200 in-wall switch in the future? The reason I ask is, i’m currently just starting to migrate my home automation system from home-assistant to openhab, and this is one of the last devices I need to switch over to openhab. I know I can probably get away with the exec binding, but the openhab ones are much more proper.

Just curious. The plugin installed just fine, and I did try to search for the device but no luck.

Thanks!
\

EDIT:

I take it all back now. I just thought to try and add it manually as an HS100 plug and it worked perfectly; even shows the signal strength to the wifi point. So, scratch that, you can add that it works with the HS200 perfectly (manually)!

Thank you so much for this addon!

Hi Derrick,

Nice you got it working. It should actually be fairly easy then to add support for the HS200. I only was wondering if what value you used for the refresh. Because the default of 30 seconds seems high for what is the default value for the smart plugs.

Hi,

I’ts currently set to the default 30 seconds; never gave any thought to changing it.

I’ve added the HS200 so that device should also be found and supported out-of-the box. Because it’s a switch and therefor logical to act on manual state changed the default refresh is 1 second. I’ve updated the jar file (in https://github.com/Hilbrand/openhab2-addons/releases/tag/2.1.0-SNAPSHOT-TP-Link) to contain the new jar with HS200 support.

Edit: dead link: binding is part of openHAB or new beta version in Eclipse Marketplace

i got it working too. with several hs110 power plugs. But it’s showing “-NaN” for the “Energy Usage” in KWh. Do I need to change something?