Skip to content
Switch branches/tags
Go to file
This branch is 39 commits ahead, 31 commits behind ggeorgovassilis:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

tp-link Wi-Fi Smart Plug HS100


The tp-link Wi-Fi Smart Plug model HS100 is an embedded Linux computer with a Wifi chip, a 110/220 V AC relay with a 15 A current limit, and a US-style grounded electrical socket. You pair with it by establishing an ad-hoc network between the plug and a smartphone (also called Wifi direct). After giving your router's SSID and access information, the plug connects to it and you can control the plug with the app provided by tp-link, called Kasa. One downside of using Kasa is that it's really not much more than a wall-switch in an app, though it does have pretty rich timer features which are nice. But you can't do things like turn the light on or off in response to events on the internet. Tp-link does provide a network control mode, but you have to pass control of your plug over to them, which isn't particularly great if you endeavor to remain the master of your own domain, haha only serious.

The script below was graciously provided by @ggeorgovassilis in his linux scripts repo, with help from Thomas Baust. You can read a great description of the reverse engineering process and the development of the script at George's blog here.

control the tp-link hs100 and hs110 wlan smart plug

Script to connect over TCP/IP to an hs100/hs110 smart plug, switch it on and off and query status information. You'll need the IP address and port (was 9999 in my tests) and a command, e.g.:

Print what IP your HS100 has: discover

Discover IP, and save it for later:

  • if you use sudo, then an entry is written into /etc/hosts for the HS100, if it is found
  • if you don't do this, you must add an -i arguments to all other commands, e.g. -i on
sudo discover

Switch plug on: on

Switch plug off: on

Check if plug is on or off: check

Print plug system status: status

Print power consumption (not supported with my hs100 so not tested): emeter


Control the tp-link HS100 smart plug from the command line



No releases published


No packages published