I'm trying to configure my heating system to switch on and off with a certain hysteresis..
but i can't find out how that i need to read out the virtual thermostat value
i've tried so much allready..
this is the code at this moment:
Code: Select all
local Temperature = 'Temperatuur living'
local Temperature_SP = 'Thermostaat'
local Heating = 'KachelSP'
local AutoMode = 'HeatingAuto'
local Calc_Temperature = otherdevices[string.format('%s_Temperature', Temperature)]
local Calc_Temperature_SP = otherdevices[string.format('%s_Temperature', Temperature_SP)]
local Temp_Hys = 'TemperatuurHys'
commandArray = {}
Calc_TempHys = tonumber(uservariables[Temp_Hys])
Calc_Temperature = tonumber(Calc_Temperature)
Calc_Temperature_SP = tonumber(Calc_Temperature)
if otherdevices[AutoMode] == 'On' then
if ( Calc_Temperature > (Calc_Temperature_SP + Calc_TempHys) ) then
commandArray[Heating] = 'On'
print('Auto Mode Heating , Turned on Stove ')
elseif ( Calc_Temperature < ( Calc_Temperature_SP - Calc_TempHys)) then
commandArray[Heating] = 'Off'
print('Auto Mode Heating , Turned Off Stove ')
end
end
return commandArray
otherdevices[string.format('%s_Temperature', Temperature_SP)] ?
it's something i found on an example but i dont really understand what it does..
any help is welcome!
Thanks!