Essent ICY Thermostat

Moderator: leecollings

Post Reply
JuanUil
Posts: 497
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Essent ICY Thermostat

Post by JuanUil »

Hi Folks,

I had a lot of problems finding the right way to control my Essent Thermostat.
Especially for putting it in a continuous temperature mode.
I have found a way of doing this by a Lua scipt.
Maybe it is old news for a lot of you but maybe some beginners (like me) find it helpfull.
I have made a dummy switch Constant temperature and one called home or away.
Further on I have made the heating program for workdays and weekend so now you can delete the programming in the thermostat.
Any questions don't hesitate to reply

Enjoy
Juan

Code: Select all

-- ~/domoticz/scripts/lua/script_device_Thermostaat.lua

commandArray = {}

-- bepalen dag, tijd, setpoint en kamertemperatuur
dag = tostring(os.date("%a"));
uur = tonumber(os.date("%H"));
min = tonumber(os.date("%M"));
setpoint = tonumber(otherdevices_svalues['Room Setpoint'])
werkelijk= tonumber(otherdevices_svalues['Room Temperature'])

-- Temperatuur instellingen
dagtemperatuur = 20.5
nachttempteratuur = 15
vorstbeveiliging = 10

-- Bepaling werkweek of weekend
if (dag=='Mon' or dag=='Tue' or dag=='Wen' or dag=='Thu' or dag=='Fri') then
	werkweek = true; weekend = false
elseif (dag=='Sat' or dag=='Sun') then
	werkweek = false ; weekend = true 
end

-- Als we thuis zijn temperatuur instellen volgens een schema
-- Als er een constante temperatuur is ingesteld dan deze volgen
if (otherdevices['Thuis']=='On' and otherdevices['Vaste temperatuur']=='Off') then


-- Dagtemperatuur instellen voor werkdagen en weekend
	if (werkweek and uur==7 and min==0 and setpoint<dagtemperatuur) then
		setpoint=dagtemperatuur
		set = "6|0|" .. setpoint
		commandArray ['UpdateDevice']= '6|0|' .. setpoint  
	elseif (weekend and uur==8 and min==0 and setpoint<dagtemperatuur) then
		setpoint=dagtemperatuur
		set = "6|0|" .. setpoint
		commandArray ['UpdateDevice']= '6|0|' .. setpoint  
	end

-- Nachttemperatuur instellen voor werkdagen en weekend
	if (werkweek and uur==22 and min==30 and setpoint>nachttempteratuur) then
		setpoint=nachttempteratuur
		set = "6|0|" .. setpoint
		commandArray ['UpdateDevice']= '6|0|' .. setpoint  
	elseif (weekend and uur==23 and min==30 and setpoint>nachttempteratuur) then
		setpoint=nachttempteratuur
		set = "6|0|" .. setpoint
		commandArray ['UpdateDevice']= '6|0|' .. setpoint  
	end
	
end

if (devicechanged['Thuis']=='Off') then
--	print ('Het is vandaag : '.. dagned)
--	print ('Het Setpoint= : '.. setpoint)
	setpoint=vorstbeveiliging
--	print ('Het is aangepast naar : '.. setpoint)
	set = "6|0|" .. setpoint
	commandArray ['UpdateDevice']= '6|0|' .. setpoint  
	commandArray ['Vaste temperatuur']= 'On'
end

if (otherdevices['Vaste temperatuur']=='On' and otherdevices['Thuis']=='On' and setpoint<dagtemperatuur) then
	setpoint=dagtemperatuur
	set = "6|0|" .. setpoint
	commandArray ['UpdateDevice']= '6|0|' .. setpoint  
end

return commandArray

Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
raymond
Posts: 71
Joined: Monday 12 October 2015 15:46
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10232
Contact:

Re: Essent ICY Thermostat

Post by raymond »

Great script first of all. I have done it through a work around but get stuck a little.
I have created multiple virtual switches (which you can use in blocky too) to get more programmed Temperatures and times. The standard ICY is too limited.

On the Virtual Set Point, I have used the Timers function, which follows the same concept as your script.

The one thing that I want to do is to disable the Timers when I'm long gone. I have created a group of virtual switch for this too, but that goes by On and Off actions through JSON.
It's a bit tricky, but as soon as you read the JSON commands (Chrome browser) you can actually use them.
The one thing I wonder about, is the command I use now "sets" the timers each and every time, and switches them On or Off.

Code: Select all

http://192.168.200.6:8084/json.htm?type=command&param=updatesetpointtimer&idx=2&active=true&timertype=2&date=11/03/2015&hour=7&min=0&tvalue=18&days=256
Does anybody know if there are other commands for the &param=updatesetpointtimer? (idx is the idx of the timer, not the device)

If I leave anything out, the JSON return with an error. Just using &active=false would do the trick, but gives an error too.

The general idea is to have the Timers function do it's work, and have a Override button (Group) to switch each timer Off.

Cheers,

Ray
D'rMorris
Posts: 138
Joined: Thursday 01 May 2014 9:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands - Sittard
Contact:

Re: Essent ICY Thermostat

Post by D'rMorris »

Nice script! I have one remark: I think you can better retrieve your temperature settings via uservariables.
So, in stead of:

Code: Select all

-- Temperatuur instellingen
dagtemperatuur = 20.5
nachttempteratuur = 15
vorstbeveiliging = 10
do:

Code: Select all

dagtemperatuur = uservariables["dagtemperatuur"]
nachttempteratuur = uservariables["nachttempteratuur"]
vorstbeveiliging = uservariables["vorstbeveiliging"]
You can then set those values in the Domoticz uservariables settings. This is much easier to update when you want to change it. Next to that, you can also update the variables with another script for example.
Same goes for the if statement with the hours:

Code: Select all

if (werkweek and uur==7 ...
You can better put this in uservariables, much easier :).
JuanUil
Posts: 497
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: Essent ICY Thermostat

Post by JuanUil »

Tnx for your comments
I have taken them to my new script which is in viewtopic.php?f=38&t=8799&p=60861#p60861
Tnx again for your possitive replies!!
Jan
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest