Page 1 of 1

Controlling EvoHome using LUA

Posted: Tuesday 06 February 2018 11:29
by PhilippeDom
Hello,

Four years ago, I aquired the EvoHome multi-zone system, wanting one day to create a smart home heating system. Now, with the arrival of cheap sensors from Xiaomi, I am finally in the "Home stretch".

In each EvoHome zone (room), one (or multiple) PIRs are placed. After not detecting any motion for 15 minutes, the lua script checks the room setting and if it is set to "Auto", and if the program temperature is set to more than 15C, the room is set to "PermanentOverride" at 10C
When the PIR detects a room presence for more than 5 min., and if the room setting is set to "PermanentOverride" at 10C, the lua script should activate the "Auto" setting for that room. I said should, because I am not able to get it back from "PermanentOverride" using LUA and JSON.

To set the room to "PermanentOverride" I use the JSON script from the Evohome - Domotiocz Wiki:

Updating a setpoint using the JSON API


/json.htm?type=setused&idx=<idx>&setpoint=<setpoint>&mode=<mode>&used=true

<idx> id number of the evohome zone device in Domoticz
<setpoint> set point in degrees (will be ignored for Auto)
<mode> Auto,TemporaryOverride,PermanentOverride,FollowSchedule
used must be true


I'm running the latest Domoticz Beta on synology 6.1, The Evohome has the color display without Wifi, linked to Domoticz using the HGI/S80 gateway.

I'm sure I am not the only one to have this idea of using Domoticz for controlling the EvoHome system, so I hope that someone can help me solving this problem. Thanks a lot,

PS in Domoticz web interface, I am able to change setpoints, temporary override, etc...

Re: Controlling EvoHome using LUA

Posted: Tuesday 06 February 2018 11:44
by philchillbill
I do something vaguely similar based on voice input from Alexa to temporarily boost a zone for 15 minutes (e.g. the Bathroom before I take a shower). Instead of Lua I'm doing it via an external perl script. When I want to finish the boost, I don't set the zone back to 'Auto' but instead to 'FollowSchedule' and it works fine. Maybe you could try that? It shouldn't really matter but who knows :mrgreen:

Re: Controlling EvoHome using LUA

Posted: Tuesday 06 February 2018 12:48
by waaren
I switched some months ago to Evohome via Web API for my installation. Combined with dzVents makes it relatively simple to set the zone back to Auto.
lines in dzVents script:

Code: Select all

local myZone = domoticz.devices('Slaapkamer')
myZone.updateSetPoint(nil, Auto,nil )
I also needed to changed line 10 in domoticzdir/dzvents/runtime/device-adapters/evohome_device.lua to

Code: Select all

local res = (( device.hardwareTypeValue == 39 or device.hardwareTypeValue == 75 ) and device.deviceSubType == 'Zone')
to make dzVents recognize my evohome via Web API device as a evohome device

Re: Controlling EvoHome using LUA

Posted: Tuesday 06 February 2018 19:12
by PhilippeDom
Thanks a lot for the suggestions, it seems my Lua script was missing a quote ("), which for some reason could set a zone to PermanentOverride, but not back to Auto. With the quote added, it works like a charm.

BTW it's really a cool idea to control EvoHome using Alexa. Yet again new possibilities...