Skip to main content

TP-Link

First of all you will need to figure out the device's IP and ideally reserve it on the DHCP.

Details to get a HS100 turning off and on via Python3:

apt-get install python3 pipwget https://github.com/GadgetReactor/pyHS100/archive/master.zipunzip master.zipcd pyHS100-master/pip install click-datetimepython3 setup.py install

Python script to turn on: from pyHS100 import SmartPlug, SmartBulb from pprint import pformat as pf plug = SmartPlug("172.17.250.196") plug.turn_on() print("Hardware: %s" % pf(plug.hw_info)) print("Full sysinfo: %s" % pf(plug.get_sysinfo())) # this prints lots of information about the device

Python script to turn off:

from pyHS100 import SmartPlug, SmartBulbfrom pprint import pformat as pfplug = SmartPlug("172.17.250.196")plug.turn_off()print("Hardware: %s" % pf(plug.hw_info))print("Full sysinfo: %s" % pf(plug.get_sysinfo())) # this prints lots of information about the device