Thermostat manually changed temp

Hi all,
I’ve been trying to search for a solution, but no luck so far, wonder if anyone has any suggestions…

Here’s the scenario.
I have a thermostat schedule, running every hour, and using luup code (found in forum, thanks !), that sets the heat set point based on the day and time.
However, lets say someone manually adjusts the temperature on the thermostat from the device itself, either up or down, and they happened to do that lets say a couple minutes before the automated schedule kicks off.

In that case, I wouldn’t want the schedule to kick in and change the set point that next time the schedule runs in a couple minutes.
So, I was thinking I could use the Countdown Timer device, set that to maybe 30 minutes, triggered when someone adjusts the set point.
That way, if the Countdown Timer is still counting down, I could prevent the schedule from running that time in the luup code.
That will override the auto schedule for at least an hour, giving the person their manually set temp for a little while.

But, I don’t see a trigger based on simply changing the set point to any other value.
I see if it’s over a particular temp, but I want to trigger the Timer if changed to ANY value, up or down…

Or, in luup, can I get the last time the set point was set ?
If less than 1 hour ago, then it must have been manually set, so I can prevent the schedule from running once then.

Does that make sense ?
I am hoping to do this using luup, rather than the PLEG, if possible.

Any suggestions would be appreciated.
Thanks,
Chris B.

Vera does not provide scene triggers for when every device variable is changed. It is easy with PLEG but, if you want to use Lua:

When you read a variable using luup.variable_get(…), it returns two values. The first is the current value and the second is the timestamp of when it last changed. You can compare the timestamp with the current time and use that to gate your scene.

local dID = 123 -- Device ID of thermostat local lockout = 3600 -- Seconds to lockout scene after last change local setpnt, tstamp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSetpoint1_Heat","CurrentSetpoint",dID) local timenow = os.time() return ((timenow - tstamp) > lockout)

Ahhhhhh…I think that’s exactly what I need, thanks !!

I read in some other posts that the luup.variable_get() function may not read ALL device variables.
However, I assume the more “common” ones, like the setpoint in my example should be no issue.
I will give that a try.

Thanks again for your help !
Chris B.

I read in some other posts that the luup.variable_get() function may not read ALL device variables.

It will read any state variable that has been created for a device. It will not read a device attribute - there is a different call for that. It will not read variables directly from a Z-Wave device. I am not aware of any device state variable that it cannot access.

Great, that’s good to know !
Thanks again for you help.
Chris B.

Rex,

I just started a thread, but this is where I should have been. I can see how this will work for a thermostat temp setpoint, because the setpoint will not normally need to change before the lock out is lifted. In my situation, I’m dynamically controlling fan speed, so it may change the fan’s load level variable frequently (every few minutes anyway), but I want to lock out the fan speed for one hour if a person changes the setting via the wall control.

Is there no way to determine if a wall dimmer button is pressed rather than the loadLevel being set by a scene?

If not, it looks like the only solution is logging the last loadLevel set by the scene in a vcontainer. If current setting doesn’t match loadLevel calculation, and doesn’t match last setting then a user must have hit the switch. Does this sound like the right approach, or am I making this too difficult?

@redneckTech, you may be able to do this by comparing the LoadLevelTarget and LoadLevelStatus variables. When a scene controls the fan, it first sets LoadLevelTarget before sending the Z-Wave command. LoadLevelStatus gets updated when the controller responds. When the fan is controlled locally, only LoadLevelStatus will change.

So if you compare the two values and they are not equal, the local control was changed (provided you have not just sent a new command). The timestamp of LoadLevelStatus will tell you when it last changed.

You could also compare the timestamp of both variables. If the timestamp of LoadLevelStatus is more than, say, 10 seconds later than that of LoadLevelTarget, it must have been adjusted locally.

Exactly what I was looking for. I’ll let you know how it goes.