Updated Domoticz API calls
Updated API call for getting device status from "type=devices" to "type=command¶m=getdevices"
This commit is contained in:
@@ -28,7 +28,7 @@ sendDomoticz() {
|
||||
fi
|
||||
|
||||
# Check Online / Offline state of Domoticz device
|
||||
if [ "$DomoSendMSG" != "$(curl -s "http://"$DomoticzAddr"/json.htm?type=devices&rid="$DomoticzIDX"" | grep '"Data" :' | awk '{ print $3 }' | sed 's/[!@#\$%",^&*()]//g')" ] ; then
|
||||
if [ "$DomoSendMSG" != "$(curl -s "http://"$DomoticzAddr"/json.htm?type=command¶m=getdevices&rid="$DomoticzIDX"" | grep '"Data" :' | awk '{ print $3 }' | sed 's/[!@#\$%",^&*()]//g')" ] ; then
|
||||
echo "Updating Domoticz device" | tee -a $LogFile
|
||||
curl -s "http://"$DomoticzAddr"/json.htm?type=command¶m=switchlight&idx="$DomoticzIDX"&switchcmd="$DomoSendMSG"" 2>&1 1>/dev/null
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user