
Controlling the TP-LINK HS100 Wi-Fi smart plug (2017) - ggeorgovassilis
https://blog.georgovassilis.com/2016/05/07/controlling-the-tp-link-hs100-wi-fi-smart-plug/
======
ggeorgovassilis
The TP-LINK HS100 firmware is the basis for a wide range of Wifi power
sockets. We discuss how we reverse-engineered the communication protocol and
wrote a shell script which can switch the plug on and off.

~~~
jesuslop
thanks! just bought one hs110 and was in serious tinkering needs ;-)

------
imrehg
Cool! I used a HS100 controlled from a Node.js library someone made to set up
a wifi connectivity test rig [https://github.com/balena-io-
playground/connectivity-test](https://github.com/balena-io-
playground/connectivity-test) This was testing the wifi disconnect/reconnect
stability of an OS (or alternatively the unplug/replug stability of a computer
board + OS).

Here's the Node package I used: [https://www.npmjs.com/package/tplink-
smarthome-api](https://www.npmjs.com/package/tplink-smarthome-api) it could be
made into a cool little CLI as well I guess.

HS100 is quite good, though after running/controlling it for a while, do end
up sometimes in a case when it says its socket is off (LED shows that too),
but the item plugged in is clearly powered. .. Kinda "you had one job...."
situation. It doesn't happen too often, but enough to be careful about, if you
switch it a lot.

------
oori
Tasmota is probably _the_ open source firmware for smart switches. have used
it for dozens of devices..

[https://github.com/arendst/Sonoff-Tasmota](https://github.com/arendst/Sonoff-
Tasmota)

~~~
OJFord
esphomelib.com is gaining a lot of traction too, for ease of use, update, and
integration with HomeAssistant.

------
eight_ender
Anyone interested in this kind of local control should check out the Home
Assistant project: [https://www.home-assistant.io](https://www.home-
assistant.io)

It allows you to corral all these IoT devices through a massive library of
open source component plugins. From there you can send control out to Amazon,
Google, or Apple, or just keep control local through the web UI.

------
thomersch_
In case you want to control your HS100 from Apple Homekit, I recently wrote a
small tool that you can run in your local netrwork:
[https://github.com/thomersch/tplink-
homekit](https://github.com/thomersch/tplink-homekit)

------
josteink
I recently used this[1] node package for the same end.

With that I can cron my Christmas lighting. Pretty cool.

[1] [https://github.com/konsumer/tplink-
lightbulb](https://github.com/konsumer/tplink-lightbulb)

------
ohazi
There's now a pyhs100 library/utility that works pretty nicely out of the box.

[https://github.com/GadgetReactor/pyHS100](https://github.com/GadgetReactor/pyHS100)

~~~
acqq
"At the moment only switching the state of the LED is implemented. Feel free
to submit patches as pull requests for further features!"

~~~
mjg59
That refers to features that are specific to the plug. On/off and energy meter
functions are generic across the family of devices, so are also supported on
the HS100.

(Context: I wrote the initial support for bulbs in this module, the plug
support already existed)

~~~
acqq
The way the hole text is written, and even your response, makes still not
clear for somebody not involved in the project what actually works, so please
take that as a hint for somehow presenting the information that you have so
that the others can easily understand it. I know it's a small thing directed
to maybe a small number of potential users, but maybe you still lose someone
valuable due to the confusion.

By just reading what's there it gives the impression that, surprisingly, that
project has _less_ basic functionality than the bash script.

------
gravypod
Would be cool to use this to manage power consumption of a home computer
cluster. Turning off spare nodes when you're not home/not using them would
probably save a lot of power.

~~~
ggeorgovassilis
I use FHEM ([https://fhem.de/](https://fhem.de/)) to run a periodic ARP scan
for "known" mobile wlan. Once the last one logs off the wlan, FHEM switches
secondary power sources and lights off after 15 minutes. When the devices log
back in and there is insufficient natural lighting, it switches the lights
back on.

Another, unrelated, automation step we implemented is an app checking alarms
on our smartphones. When an alarm goes off, FHEM runs a script which switches
lights on and reads aloud (with Festival) breaking news, the weather forecast
and any interruptions on our daily commute.

------
peterdox9
here are an endless number of smart plugs that let you remotely turn an outlet
on and off, but those plugs usually accept just one single cable. So to
address bigger needs, Kasa is introducing an entire smart power strip that
allows you to individually control all six of its power sockets.

~~~
berbec
I'm installing a similar enterprise version of this tomorrow. [1]

It's a 10 plug power strip. It's got an ethernet connection with a WebUI and
each outlet is individually switchable. There are two independant input power
cords, and it switches automatically if one side fails (UPS dies). Really
cool. Need to reboot the NAS, but it's frozen? Remote power cycle it!

1:
[https://www.cyberpowersystems.com/product/pdu/pdu15sw10atnet...](https://www.cyberpowersystems.com/product/pdu/pdu15sw10atnet/)

