Updated Domoticz API calls

Updated API call for getting device status from "type=devices" to "type=command&param=getdevices"
This commit is contained in:
2023-09-28 20:29:13 +02:00
parent 5f98bc4221
commit c37b269586
2 changed files with 2 additions and 2 deletions

View File

@@ -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&param=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&param=switchlight&idx="$DomoticzIDX"&switchcmd="$DomoSendMSG"" 2>&1 1>/dev/null
fi