Controling TPLink smart plug with Linux

Related Post

  • No related post.

TPlink hs100 and hs110 are great cloud smart plugs with very nice Android application named KASA. While using it for my mining projects i wanted to manage switch relay with Linux on local network but i was only able to turn the plug on and off via Android application. Ive found great github page with script and explanation how to do this.

From Github page:

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.

 

Experienced Linux Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in Linux System Administration, Development, Networking and Documentation writting.