I’m trying to have my thermostat set points change when there isn’t activity in the room. So if motion is detected in the Living Room my thermostat will have a set points of (71F Heat & 80F Cool) when there is no motion detected for atleast an hour after being tripped, have the set points go to (69F Heat & 78F Cool). I know this is going to probably done with LUUP but not sure where to start.
I’m half way there! So I have 2 scenes set up. 1st one to run if sensor is tripped and 1 to run when sensor is not tripped.
1st scene. Sensor is tripped. Pretty simple. Apply sensor and then set thermostat to temp. Done
2nd scene. Sensor is not tripped for an hour. In the sensor LUUP code I have
local lastTrip = luup.variable_get(“urn:schemas-micasaverde-com:device:MotionSensor:1”,“LastTrip”,59)
if(((os.clock() - lastTrip >= 3600)))then
return true
else
return false
end
I then set action on the therm via vera. All works great. Once an hour has pasted and the motion sensor has not been tripped then my therm will have the new adjusted value.
I want to go 1 step further on each of the scenes I want a final LUUP code to have if the thermostat modestatus = off then return false everything. I have this but it’s not taking it. It keeps erroring me
local tMode = luup.variable_get(“urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1”,“ModeStatus”,59)
if (tMode = Off) then
return false
end
I am wanting this statement because I will be putting in scenes for summer and if it is nice outside and i have the windows open and the thermostat is OFF then I don’t want that scene to fire up.
Is there any reason you aren’t doing this in pleg? It would be much easier and let you build more complicated logic as you discover further tweaks to make.
Haven’t messed with PLEG yet. Got everything wrote up. Everything is working freaking great. No longer have to set the tstat to schedule as it is random times we leave and come back. You don’t need a nest tstat, all you just need a sensor to make it trigger events. Not to bad to do. Onto the next project, turning lights off in the kids room.
Totally agree, you can get so much more from a vera connected stat than with nest, especially as it can take advantage of multiple sensors for sensing people home or use a house alarm. The one bit I guess it’s harder is building in weather into the process
I suggest you have a look at pleg before your next project. It’s quicker to set up the required logic and if you want to add a new condition in line your thermostat being off then it’s easy to test and get a nice report telling you when that last individual condition tripped or the whole scene did.
It’s also much more stable than lua in vera scripts. I have had a repeating scene fail often and randomly for months that ran 30 lines of lua code. Moved it into pleg and is been rock solid since then.