Created
April 22, 2018 18:03
-
-
Save mattcuk/5a2b1fa2104da0e253574d0cb878e800 to your computer and use it in GitHub Desktop.
Basic webservice to allow us to control an Energenie power socket
This file contains 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
<?php | |
/* MattC - Call this with various parameters.. | |
callenergenie.php? | |
delay = time in seconds to sleep before calling Energenie | |
switch = which socket to talk to | |
state = turn socket on/off | |
e.g. callenergenie.php?delay=5&switch=2&state=off | |
*/ | |
print ("Waiting ".$_GET['delay']." seconds"); | |
sleep($_GET['delay']); | |
print ("Switching socket ".$_GET['switch']." ".$_GET['state']); | |
exec("sudo python /var/www/callenergenie.py ".$_GET['state']." ".$_GET['switch']); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment