I currently control my Digital Loggers IP power switch with a quick applescript as below, using a variable substitution trigger to execute the commands. However, since it's one way so I don't know actual status. And, since it is an applescript....
using terms from application "IndigoServer"
tell application "IndigoServer"
set actionOrdered to the value of variable "Digital_Loggers_Switch"
set actionListAll to {"1=ON", "1=OFF", "1=CCL", "2=ON", "2=OFF", "2=CCL", "3=ON", "3=OFF", "3=CCL", "4=ON", "4=OFF", "4=CCL", "5=ON", "5=OFF", "5=CCL", "6=ON", "6=OFF", "6=CCL", "7=ON", "7=OFF", "7=CCL", "8=ON", "8=OFF", "8=CCL"}
if actionListAll contains actionOrdered is true then
log actionOrdered & " the list works"
set theIP to "http://usesr:pwd@10.0.1.XX:XXXX/outlet?" --change your ip and command string here
set theURL to theIP & actionOrdered
--log theURL --comment this out once it is working
set curlURL to "curl -k" & " " & theURL
set shellscript to curlURL
--log shellscript -- commment this out once it is working
do shell script shellscript
set value of variable "Digital_Loggers_Switch" to "x"
end if
end tell
end using terms from
I'd like to use the GhostXML plugin to generate device states so it is more controllable and I can then also get feedback. I looked at the documentation and found these links. I've tried setting up a GhostXML device, and while it does establish a link, as I can't seem to find the correct http xml URL it's generating a parse error. Any suggestions would be appreciated. If it is not possible, could I ask for a little help in converting this to a python script...
https://www.digital-loggers.com/http.htmlhttps://www.digital-loggers.com/restapi.pdf