Manage switch selector and using different selection on "if"
Posted: Sunday 19 January 2020 0:52
hi, i have this part of my dzvent script (version dzvent=2.4.19)
how i can set a specific level of dummy switch selector device inside code?
i mean for example this line:
where i need to put my selector switch at lever named "SUN_POWER"
second question at line:
i would like to set the level my switch at "Heating from October to april, and set to "Cooling" level from may to september, how i can implement that change?
thanks
Code: Select all
local function manageSwitches()
if heatpump.state == "Off" then
controlVar.set("false")
season.switchSelector("Heating") -- from October to April put selector in Heating ; from May to September put in Cooling
switchValves(off)
elseif heatpump.state == "On" and (manuale.value) == 0 then -- if PDC is ON -> switch on the valves
controlVar.set("true")
season.switchSelector("SUN_POWER")
switchValves(on)
elseif heatpump.state == "On" and (manuale.value) == 1 and controlVar.value == "true" then
manuale.set(0)
season.switchSelector("SUN_POWER")
switchValves(on)
end
endi mean for example this line:
Code: Select all
season.switchSelector("SUN_POWER")second question at line:
Code: Select all
season.switchSelector("Heating") -- from October to April put selector in Heating ; from May to September put in Coolingthanks