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