TP-LINK HS100 Smart Plug (WiFi)?

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?

Does it show valid values for current, voltage? could you make a screen
shot of the energy values? I think it doesn’t parse the energy value
correctly.

I’ve found the issue. “Energy Usage” should work now. You can find a new jar at the same download location (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

1 Like

Awesome, just did a fresh install on my main server and it found it automatically; thanks!

it’s showing values now but I’m not sure what exactly it is showing

?
Comparing it with the app (kasa)

kasa displays: 302 W / 0.86 kWh
in openhab i see: 302 / 2.0 kWh

I added a screenshot the values are all looking a little bit strange…

Doesn’t it recognize the runtime? This value isn’t shown right now.
Sorry if I got something wrong :wink:

Hi,

the reading looks good at least. Both show the same momentary power reading of 302 Watts. The second reading is kiloWatts hours so your Watts divided by 1000 -> Watt to kilo Watt and then multiplied by the time (hours) the mesurement was ongoing. So they can’t be the same because this is normaly calculated on the fly by the app and not the device -> At least when the HS110 is behaving as similar devices.

Cheers,
Florian