Skip to content

Instantly share code, notes, and snippets.

@LarsBergqvist
Last active Nov 3, 2016
Embed
What would you like to do?
crontab file for automatically turning remote controlled outlets on/off
# Turn on outdoor lights in the afternoon
00 17 * * * curl -i -H "Content-Type: application/json" -X PUT -d '{"state":"on"}' http://localhost:5000/Outlets/api/outlets/2/1
# Turn off outdoor lights in the morning
00 08 * * * curl -i -H "Content-Type: application/json" -X PUT -d '{"state":"off"}' http://localhost:5000/Outlets/api/outlets/2/1
# Turn on downstairs window lights in the afternoon
30 19 * * * curl -i -H "Content-Type: application/json" -X PUT -d '{"state":"on"}' http://localhost:5000/Outlets/api/outlets/1/2
# Turn on upstairs window lights in the evening
30 18 * * * curl -i -H "Content-Type: application/json" -X PUT -d '{"state":"on"}' http://localhost:5000/Outlets/api/outlets/1/1
# Turn off all indoor lights at night
# windows upstairs
00 22 * * * curl -i -H "Content-Type: application/json" -X PUT -d '{"state":"off"}' http://localhost:5000/Outlets/api/outlets/1/1
# windows downstairs
00 22 * * * curl -i -H "Content-Type: application/json" -X PUT -d '{"state":"off"}' http://localhost:5000/Outlets/api/outlets/1/2
# Wall downstairs
00 22 * * * curl -i -H "Content-Type: application/json" -X PUT -d '{"state":"off"}' http://localhost:5000/Outlets/api/outlets/1/3
# Floor upstairs
00 22 * * * curl -i -H "Content-Type: application/json" -X PUT -d '{"state":"off"}' http://localhost:5000/Outlets/api/outlets/1/4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment