However, for usability reasons (and WAF) I want a dummy switch so I can manually control the thermostat setpoint from the Android app.
I've created a dummy switch, and use the following script:
Code: Select all
#!/bin/bash
#### Description of get_watermeter.sh
#### Purpose: To read and write Current Living Temp and Thermostat Setpoint from/into Domoticz
#### Created: 2016-11-05
#### Modified: 2016-11-07
#### Owner: STLAHA2007
#### Functionalities: Read current temp and setpoint from Domoticz {curl/json/grep/awk/sed}
#### Write into combined Zone sensor to Domoticz {curl/json/grep/awk/sed}
#### This script needs {Unix-style} execute rights (755 - rwx r-x r-x)
#### Declare temporary variables for read/calculate/write
declare CurrentLiving_Temp
declare CurrentLiving_SetPoint
declare -i CurrentLiving_Temp_IDX
declare -i CurrentLiving_SetPoint_IDX
declare HeatZoneLiving_Value
declare -i HeatZoneLiving_IDX
declare DomoURL
DomoURL=$(echo "http://127.0.0.1:8080")
CurrentLiving_Temp_IDX=658 ### Temperature Sensor (Temperature Tab)
CurrentLiving_SetPoint_IDX=657 ### SetPoint Device (Utility Tab)
HeatZoneLiving_IDX=658 ### Your Zone Device (Temperature Tab) or modify url below the rebuild for the switch!!!!
#### read and calculate current temp and setpoint
CurrentLiving_Temp=$(echo $(curl -s "$(echo $DomoURL)/json.htm?type=devices&rid=$(echo $CurrentLiving_Temp_IDX)" | grep "Data\"" | awk '{print $3}' | sed 's/\"//g' | sed 's/\,//g'| sed 's/\.000//g' ))
CurrentLiving_SetPoint=$(echo $(curl -s "$(echo $DomoURL)/json.htm?type=devices&rid=$(echo $CurrentLiving_SetPoint_IDX)" | grep "Data\"" | awk '{print $3}' | sed 's/\"//g' | sed 's/\,//g'| sed 's/\.000//g' ))
HeatZoneLiving_Value=$(echo $(curl -s "$(echo $DomoURL)/json.htm?type=devices&rid=$(echo $HeatZoneLiving_IDX)" | grep "Data\"" ))
echo $CurrentLiving_Temp
echo $CurrentLiving_SetPoint
echo $HeatZoneLiving_Value
echo "HeatzoneLiving_Value needs to look like....:"
HeatZoneLiving_Value=$(echo $CurrentLiving_Temp";"$CurrentLiving_SetPoint";0;")
echo $HeatZoneLiving_Value
##echo "Electra: "$(echo $M_E_Curr)" kWh Gas: "$(echo $M_G_Curr)" m3 Water: "$(echo $M_W_Curr)" m3"
curl -s "$(echo $DomoURL)/json.htm?type=command¶m=udevice&idx=$(echo $HeatZoneLiving_IDX)&nvalue=0&svalue=$(echo $HeatZoneLiving_Value)"
Code: Select all
pi@raspberrypi:~/domoticz/scripts $ ./set_temp.sh
22.5
19.5
"Data" : "22.5 C, (22.0 C), TemporaryOverride until 2018-10-04T22:00:00Z",
HeatzoneLiving_Value needs to look like....:
22.5;19.5;0;
{
"status" : "OK",
"title" : "Update Device"
}
How can I resolve this in a proper way?