Hello, I’m new to the world of Home Automation and since i’ve read a lot and learned a lot from this forum i’d like to share with you my configuration that maybe can be of any help to someone.
GOAL
Control the temperature in my house according to who is at home, holidays, outside temp etc.
wife friendly
Low cost
WHAT I HAVE
1Vera Lite
3 X Stellaz Thermostat
1 X Secure SSR303 kit (thermostat+Switch)
1 X Vera Lite plugin MULTISWITCH (thanks to whoever did it)
OVERVIEW
The idea is to use MultiSwitch as a control unit and the Secure thermostat (the one with the wheel)as an input point since i only own it and my wife is maniacally always fine tuning its temp.
According to special settings of temperature the multiswitch change its values and so the house.
EXAMPLE: if we come back home my wife will put 13degrees meaning that we are all at home and the corresponding Multiswitch switch will light on; also authomatically the following code will take back to the previous temperature the set point of the thermostat. Meanwhile the 3 stellaz has changed their values according to who is at home.
LUUP CODE
i created a Scene called Whos@Home that RUN EVERY MINUTE and has the following LUUP CODE:
currentset=luup.variable_get("urn:upnp-org:serviceId:TemperatureSetpoint1_Heat","CurrentSetpoint", 4) --READ THE ACTUAL HEAT SET POINT AND CALL IT "CURRENTSET"
if (tonumber(currentset) > 18) then -- IF CURRENTSET IS HIGHER THEN 18 THEN DONT DO ANYTHING (RETURN FALSE)
setpoint = luup.variable_get("urn:upnp-org:serviceId:TemperatureSetpoint1_Heat","CurrentSetpoint", 4) -- CREATE/UPDATE THE VARIABLE "SETPOINT" AND REMEMBER THE TEMP VALUE
return false
else
if (tonumber(currentset) == 15) then -- IF CURRENTSET = 15 THEN MY WIFE IS @HOME SO SWITCH THE FIRST MULTISWITCH (STATUS1) AND SWITCH OFF THE AWAY MULTISWITCH SWITCH(STATUS4)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus1",{ newStatus1="1" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus4",{ newStatus4="0" },12)
elseif (tonumber(currentset) == 16) then --SETPOINT=16 MEANS WIFE+KIDS(SWITCH 1 & 2) AT HOME
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus1",{ newStatus1="1" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus2",{ newStatus2="1" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus4",{ newStatus4="0" },12)
elseif (tonumber(currentset) == 17) then -- SETPOINT=16 HUSBAND (SWITCH 3) AT HOME
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus3",{ newStatus3="1" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus4",{ newStatus4="0" },12)
elseif (tonumber(currentset) == 14) then -- SETPOINT 14 MEANS AWAY
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus1",{ newStatus1="0" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus2",{ newStatus2="0" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus3",{ newStatus3="0" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus4",{ newStatus4="1" },12)
elseif (tonumber(currentset) == 13) then --SETPOINT = 13 ALL AT HOME (SHORT CUT TO AVOID TO INPUT ALL THE SETPOINT FOR EACH ONE)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus1",{ newStatus1="1" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus2",{ newStatus2="1" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus3",{ newStatus3="1" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus4",{ newStatus4="0" },12)
elseif (tonumber(currentset) == 12) then -- SETPOINT=12 MEANS HOLIDAY YES/NO(SWITCH 5) SO SOME SCENES WILL NOT BE RUN AND OTHER YES
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus1",{ newStatus1="1" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus2",{ newStatus2="1" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus3",{ newStatus3="1" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus4",{ newStatus4="0" },12)
luup.call_action("urn:dcineco-com:serviceId:MSwitch1","SetStatus5",{ newStatus5="-1" },12)
else
setpoint = luup.variable_get("urn:upnp-org:serviceId:TemperatureSetpoint1_Heat","CurrentSetpoint", 4) --RELATED TO THE FIRST "IF" SO THE HEAT SETPOINT IS READED
end
end
luup.call_action("urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", "SetCurrentSetpoint", {NewCurrentSetpoint = setpoint}, 4) -- CHANGE BACK THE TEMPERATURE ACCORDING TO THE VARIABLE"SETPOINT" VALUE
WHAT ELSE
I prepared normal scenes for my thermostat with schedules that depends on days and time of the day .For example the Wake up scene start at 7.00 to heat the house at 23 degrees. For each scene i added the following LUUP code to make it run or not.
if (luup.variable_get("urn:dcineco-com:serviceId:MSwitch1", "Status4", 12)=="1") or (luup.variable_get("urn:dcineco-com:serviceId:MSwitch1", "Status3", 12)=="0") or
(luup.variable_get("urn:dcineco-com:serviceId:MSwitch1", "Status6", 12)=="1") then
return false
else
return true
end
In these scene if we are away (Status 4=1) or i’m not at home (status 3=0) or it’s Summer (status6=1) the code RETURN FALSE that means DON’T RUN THE SCENE.
I also prepared scenes for the Stellaz activated by triggers linked to the Multiswitch. For example if the kids are not at home their room will not be heated because the setpoint of the Stellaz in their room is set at a low value(19). On the contrary if they are at home the switch number 2 will be turned on by the thermostat(remeber? 13 degrees)and the Stellaz also will be triggered to rise their value to 24degrees.
NOW I ONLY HAVE TO UPGRADE THE CODE OF MY WIFE SO THAT SHE TRUST THE THERMOSTAT KNOWING THAT BY PUTTING 13DEGREES SHE WILL NOT FREEZE ANYONE BECAUSE THE SYSTEM WILL COME BACK TO THE PREVIOUS POINT. :o ;D
P.S.: to all the coders please excuse myself for the strange solution. I’m sure there is a better way to do it but i own Vera since only 5 days and i’ve never programmed before. I just did a lot of cut and paste from many part of codes that i found on this forum.
For all the others feel free to copy my examples, it works…almost :-[