קוד: בחירת הכל
curl -d '{"id":"test", "action":"activate"}' -H 'Content-Type: application/json' -X PUT http://192.168.0.111:8888/api/scenes
קוד: בחירת הכל
curl -d '{"id":"test", "action":"activate"}' -H 'Content-Type: application/json' -X PUT http://192.168.0.111:8888/api/scenes
קוד: בחירת הכל
rule "Check Public IP"
when
Item Sys_CheckPublicIP received command ON
then
logInfo(filename, "Checking Public IP")
var String currentIP = executeCommandLine(Duration.ofSeconds(15),"dig","+short","myip.opendns.com","@resolver1.opendns.com")
logInfo(filename, "IP is: " + currentIP)
currentIP = currentIP.substring(0,currentIP.length-1)
Sys_PublicIP.postUpdate(currentIP)
end
קוד: בחירת הכל
rule "VPN Server Control"
when
Item Sys_VPNControl received command
then
logInfo(filename, "Controling the VPN server: " + receivedCommand)
switch Sys_VPNControl.state {
case "Activate":{
executeCommandLine("sudo","/usr/bin/vpn/startService.sh")
Sys_VPNCheck.sendCommand(ON)
}
case "Deactivate": {
executeCommandLine("sudo","/usr/bin/vpn/stopService.sh")
Sys_VPNCheck.sendCommand(ON)
}
case "Check": {
Sys_VPNCheck.sendCommand(ON)
}
}
end
קוד: בחירת הכל
executeCommandLine("curl@@-d@@-H@@Content-Type: application/json@@-X@@PUT@@{\"id\": \"clear\", \"action\": \"activate\"}@@http://192.168.0.111:8888/api/scenes")
קוד: בחירת הכל
curl -d '{"id":"clear", "action":"activate"}' -H 'Content-Type: application/json' -X PUT http://192.168.0.111:8888/api/scenes
קוד: בחירת הכל
"id":"clear"
לא הבנתי משהו- אתה על ווינדוס 10 או על Raspberry Pi?05/05/2021 14:37razserv2010 כתב: ↑ @chenta
openhab 2.5.10 על ווינדוס 10
זאת הפקודה (היא עובדת אם אני מריץ אותה מה terminal מרספברי פיי)הפקודה אמורה להפעיל סצנות שנשמרו תחת ID למשל בפקודה יש:קוד: בחירת הכל
curl -d '{"id":"clear", "action":"activate"}' -H 'Content-Type: application/json' -X PUT http://192.168.0.111:8888/api/scenes
זה שם הסצנה ששמורה בledfxקוד: בחירת הכל
"id":"clear"
זה הקישור לdocs של ledfx
https://ledfx.readthedocs.io/en/master/ ... api-scenes...
קוד: בחירת הכל
executeCommandLine(Duration.ofSeconds(15),"curl","-d","'{\"id\":\"clear\", \"action\":\"activate\"}'","-H","'Content-Type: application/json'","-X","PUT","http://192.168.0.111:8888/api/scenes")
קוד: בחירת הכל
executeCommandLine(Duration.ofSeconds(15),"curl","-d","'{\"id\":\"clear\",\"action\":\"activate\"}'","-H","'Content-Type:application/json'","-X","PUT","http://192.168.0.111:8888/api/scenes")