Last active
May 21, 2017 13:53
-
-
Save karolyi/1566ebc4591dc31c300a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Turns your smartplug on and off. Set the IP and the password in the variables below. | |
# Works with SP-1101w and SP-2101W plugs. | |
# http://www.edimax.com/images/Image/manual/HomeAutomation/SP-1101W/SP-1101W_manual.pdf | |
EDIMAX_IP='192.168.1.141' | |
EDIMAX_PASSWORD='password' | |
STATE='ON' | |
if [[ $1 == 'off' ]]; then | |
STATE='OFF' | |
fi | |
STR_1='<?xml version="1.0" encoding="UTF8"?><SMARTPLUG id="edimax"><CMD id="setup"><Device.System.Power.State>' | |
STR_2='</Device.System.Power.State></CMD></SMARTPLUG>' | |
curl http://$EDIMAX_IP:10000/smartplug.cgi -u admin:$EDIMAX_PASSWORD --data "$STR_1$STATE$STR_2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment