17 comments

[ 2.7 ms ] story [ 43.2 ms ] thread
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.
thanks! just bought one hs110 and was in serious tinkering needs ;-)
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.
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...

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.
I use FHEM (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.

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 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 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.

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

https://github.com/arendst/Sonoff-Tasmota

esphomelib.com is gaining a lot of traction too, for ease of use, update, and integration with HomeAssistant.
There's now a pyhs100 library/utility that works pretty nicely out of the box.

https://github.com/GadgetReactor/pyHS100

"At the moment only switching the state of the LED is implemented. Feel free to submit patches as pull requests for further features!"
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)

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.

¯\_(ツ)_/¯

I don't have any smart bulbs... that always seemed kind of silly to me. The switches work fine.

Anyone interested in this kind of local control should check out the Home Assistant project: 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.