Is it possible to know if a room temperature is going up or down?
Sample the sensors’ input on a rolling basis and report if it is going up or down, on a 15 minute basis for example.
The reason I ask is: in the lounge I have a fire occasionally. If the room temperature is going up and the panel heaters are off, then a fire is obviously lit, hence keep the heating off for longer.
Also, I have multiple heaters in rooms. If the room temperature is going up with just one heater, then all good. If the room temperature is not going up, the SetPoint isn’t reached etc, then boost on another heater.
If you use a sensor like the Fibaro which allows you to set the threshold for temperature reporting, it should update everytime the temp goes up or down a degree, but you are going to have to pair that with something like PLEG to measure how much up/down variance you want.
Another option is the EZMultiPli which is a plug in sensor (so no battery issues) which will let you set the reporting rate on temp as low as once a minute, but again you have to pair it with some like PLEG to do all the logic and computations.
I’ve got a Fibaro and a Thermostat reporting frequently, so temperature reporting is not a problem. I was wondering how to do the PLEG conditions/coding such that i can find out if the temperature is going up or down?
You might add a variable to your temp sensor called old-temp. Add another variable called temp-change. Then have this series of events occur on a schedule.
Compare current temp to temp-old
If current >old, set temp-change =1
If current =old, set temp-change=0
If current <old, set temp-change= -1
Good call with the variables and conditions.
Any ideas how i get the Old Temp though?
The actual temperature will come from a number of sources, e.g. Fibaro, which sends the real time value to vera when it changes by 0.5degC. Where i’m going with that is that that it could be sent at any time, not a regular polling - something i’d like to keep for accuracy.
I can write the current temp to a dummy device every 15 mins easily enough, but that is not a rolling historic value as it will be real time as soon as the scene is run.
It should work. What may not have been obvious is that the scene actions should be assigned in LUUP rather than widgets.
Let’s walk through the timeline.
900am at end of scene current temp (76F) assigned to old_temp
915 scene. LUUP compares now-current temp (77F) to old_temp. Then sets temp_change to 1. The heat control logic runs turning on or off heaters. Lastly old_temp is updated to 77F.
You might want to go to the PLEG programming forum and see if Richard has already solved this without resorting to LUUP.
local real = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature",87)
local old = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature",300)
if old < real then
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = “1”}, 299)
end
if old > real then
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = “0”}, 299)
end
Then a condition in PLEG: If the temp<setpoint AND “Increasing vSwitch=1” AND rate of temp change < 1 (current - historic) then turn on the big heater.
Hopefully it will work.
I would still prefer a better way to have the temperature from a true 30 mins ago if possible.
i’ve changed it already.
Removed the If statements in the scene as this was only updating the Increasing/Decreasing switch status every 30 mins. If made 2 PLEG conditions to say
(if Current > Historic) then switch on=Increasing Temperature
(If Current < Historic) then switch off=decreasing room temperature.
This is making better use of the frequent temperature updates.
Best Home Automation shopping experience. Shop at Ezlo!