Evohome: using a dummy switch to control thermostat

For heating/cooling related questions in Domoticz

Moderator: leecollings

Post Reply
Mrwolf
Posts: 5
Joined: Wednesday 31 July 2013 19:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Evohome: using a dummy switch to control thermostat

Post by Mrwolf »

I have a Honeywell Round Connected thermostat, which can be controlled via EvoHome (mytotalconnectcomfort.com). I've installed the Honeywell EvoHome hardware in Domoticz, using the Web API-option. This works, and a Temperature device is created which shows the current room temperature and the setpoint.

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&param=udevice&idx=$(echo $HeatZoneLiving_IDX)&nvalue=0&svalue=$(echo $HeatZoneLiving_Value)"
Running the script shows no errors, and indeed, the setpoint of the thermostat device is changed to the set value of the dummy switch. However, within a minute this value is overwritten by the previous 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"
}
I'm not even sure if the actual setpoint is changed on the thermostat itself, or if it's only in Domoticz where it's changed. It looks like the set values by the script are overwritten by the values from the Honeywell-servers.

How can I resolve this in a proper way?
gordonb3
Posts: 111
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Evohome: using a dummy switch to control thermostat

Post by gordonb3 »

You're just changing the value in Domoticz. The correct uri for changing the setpoint is:

Code: Select all

/json.htm?type=setused&idx=${IDX}&name=${NAME}&description=${DESCRIPTION}&setpoint=${SETPOINT}&mode=${MODE}&used=true
where $MODE should be either "PermanentOverride" or "TemporaryOverride" and of course if you use the latter the uri needs to be expanded with a value for `until`

You may also want to have a look at dzEvo
Mrwolf
Posts: 5
Joined: Wednesday 31 July 2013 19:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Evohome: using a dummy switch to control thermostat

Post by Mrwolf »

Thanks, I knew I was getting something mixed up!

dzEvo looks nice, and I've got installed and configured. But I've got no idea how to run it on my RPi.
gordonb3
Posts: 111
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Evohome: using a dummy switch to control thermostat

Post by gordonb3 »

It's quite verbose (supposed to be). For every partial command you give it, it will give you more detailed information. Hidden feature: you can abbreviate every parameter to where it becomes unique. e.g. you can type `dzEvo q dev` to get a list of Evohome devices registered in Domoticz.

Here's one that I use for one of the children's bedrooms:

Code: Select all

dzEvo set temp Moira 20 +10
This sets a temporary override to 20 degrees for 10 minutes from now. It's enough to kick off the radiator in her room and make it feel comfortable until she's tucked in.
Mrwolf
Posts: 5
Joined: Wednesday 31 July 2013 19:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Evohome: using a dummy switch to control thermostat

Post by Mrwolf »

I think I'm a bit lost here; Linux is not my strong point... I've installed the required packages, cloned it to my Pi and ran the 'make' command, and created a config file. Surely I'm missing a step here, because just running dzEvo from any folder only returns a 'command not found'.
gordonb3
Posts: 111
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Evohome: using a dummy switch to control thermostat

Post by gordonb3 »

As a rule, Linux only searches /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin and /usr/local/sbin for executables. For every other location you need to specify the path, either relative or absolute, and this includes the current folder.

Example:
  • ./dzEvo
  • /home/pi/dzEvo
Mrwolf
Posts: 5
Joined: Wednesday 31 July 2013 19:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Evohome: using a dummy switch to control thermostat

Post by Mrwolf »

:oops:
Thanks, I should've known that!
Mrwolf
Posts: 5
Joined: Wednesday 31 July 2013 19:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Evohome: using a dummy switch to control thermostat

Post by Mrwolf »

dzEvo is a nice tool, it gives instant status feedback and is configurable, thanks for that!

How have you linked it to a dummy thermostat device?

I'm looking for a solution where I can change the setpoint from the domoticz app and the manual thermostat on the wall. If I create a dummy thermostat switch that changes the set point every minute, a manual setting will be overruled by the switch.

I think a switch that only sends a command to evohome when it's changed is what I'm looking for. In that case, the switch should read the actual set point every minute to keep in sync, but only update when it's changed by a user.

Am I making any sense?
gordonb3
Posts: 111
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Evohome: using a dummy switch to control thermostat

Post by gordonb3 »

Actually, I don't.

I wrote this as a replacement for a tool that talked directly to Evohome and was called by a desktop shortcut. I started thinking how I could make that tool send multiple commands in a single Evohome session rather than one and then I realized I could already do that by sending the commands to Domoticz instead.

Got me thinking though. I could use a KaKu transmitter to trigger the script and then monitor the state of the actual temperature device to reset the switch to the off state when the override is no longer active.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest