Good afternoon!
Three month ago, 6 Heltun Thermostats obtained.
It placed in each heat zone. Mode of using - control air temperature, and check limitations of floor (water heating system).
Each thermostat connected to controller, controller connected to valves and heating device.
And… all thermostats controlled by VeraPlus.
On board:
Air temperature sensor, floor temperature sensor, humidity sensor and lighting sensor (all of them - in one device)
How it works with Vera:
Not very vell
- Thermostat can support modes: Comfort, Eco, Dry, Manual and Timer. Vera - not
- Secondary sensor not recognised well. (but it can be used in DataMine - it works)
- a lot of Poll requests are lost. I don’t know, why - may be Vera not good, may be Heltun
- Device can support S2 security, Vera not
- OTA supported by device, but Vera…
My task:
Heat my house at night time (when possible). Use night tarif (when possible, do not avoid comfort)
Tariffs:
Day: 6,08₽
Night: 2,25₽
This script - make comforable setting in Home/Night mode
Decrease temperature at Vacation mode and heat house only at night - in Away mode
With checking dew
-- read house mode
local mode = luup.attr_get "Mode"
local CurrHumid=0
local CurrTemp=0
local CurrTempS
local CurrHumidS
local Humid=0
local Temp=0
local MinTemp=0
local MaxallowedTemp=21
local MinallowedTemp=9
local NightTemp=0
local HThermDayTemp
local HThermNightTemp
function ConfigureThermos(nodnostr,devno)
local nodno=tonumber(nodnostr)
-- set temperature calendar for each thermostat
-- morning, day, evening, night
for i = 56, 80, 4 do
TempSet(nodno, i, HThermDayTemp)
TempSet(nodno, i+1, HThermDayTemp)
TempSet(nodno, i+2, HThermDayTemp)
TempSet(nodno, i+3, HThermNightTemp)
end
luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = "1"}, devno)
end
function TempSet(dev, prm, temp)
local Nod = string.format("%d",dev)
-- 112 4 - configuration set, after it - parameter number, 2 - paramter length in byttes , 0 - first byte, next - second byte
-- luup.log(string.format("---------------------------------------------112 4 %g 2 0 %g",prm,temp*10))
local Dat = string.format("112 4 %d 2 0 %d",prm,math.floor(temp*10))
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node=Nod, Data=Dat},1)
end
-- check all zones t and humidity
for deviceNo,d in pairs(luup.devices) do
if d.id ~= "" then
if d.device_type=='urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1' then
CurrTempS=luup.variable_get('urn:upnp-org:serviceId:TemperatureSensor1','CurrentTemperature',deviceNo)
if CurrTempS==nil then
CurrTemp=0
else
CurrTemp=tonumber(CurrTempS)
if Temp<CurrTemp then
Temp=CurrTemp
end
end
end
-- luup.log(string.format('----------------------------DID: %s', d.id))
if d.device_type=='urn:schemas-micasaverde-com:device:HumiditySensor:1' then
CurrHumidS=luup.variable_get('urn:micasaverde-com:serviceId:HumiditySensor1','CurrentLevel',deviceNo)
if CurrHumidS == nil then
CurrHumid=0
CurrHumidS = 'nil'
else
CurrHumid=tonumber(CurrHumidS)
if Humid<CurrHumid then
Humid=CurrHumid
end
end
end
end
end
-- Max allowed humidity - 60%, not 100. Better less, then greater
-- Shift humidity value
Humid = Humid+40
-- Calculate dew point
MinTemp=Temp-((1-(Humid/100))/0.05)
luup.log(string.format('----------------------------------- Max humid: %d Max Temp:%g Min Temp:%g', Humid, Temp, MinTemp))
if MinTemp<MinallowedTemp then
MinTemp=MinallowedTemp
end
if MinTemp>MaxallowedTemp then
MinTemp=MaxallowedTemp
end
---------------------
-- Modes: 1 Home, 2 - Away, 3 - Night, 4 - Vacation
-- Calculate comfort temp for modes, except vacation
-- Calculate safe temp for Vacation
-- Home - comfort
if(mode=="1") then
HThermDayTemp=MaxallowedTemp
HThermNightTemp=MaxallowedTemp+2
end
-- Away - nightmost heating
if(mode=="2") then
HThermDayTemp=MinTemp
HThermNightTemp=MaxallowedTemp+2
end
-- Night - as day
if(mode=="3") then
HThermDayTemp=MaxallowedTemp
HThermNightTemp=MaxallowedTemp+2
end
-- Vacation. Do not allow dew.
if(mode=="4") then
HThermDayTemp=MinTemp
HThermNightTemp=MinTemp+3
end
-- fill Thermostat id's and reprogram it.
for deviceNo,d in pairs(luup.devices) do
if d.id ~= "" then
if d.device_type=='urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1' then
ConfigureThermos(d.id, deviceNo)
end
end
end