Motion last update


#1

1) Give a description of the problem
I have two temperature sensors in one room and I want to base the heat on the last sensor that reported the temperature. Is there a way to do that. Can you base a condition on the last time it changed?

2) What is the expected behavior?
(PUT YOUR INFO HERE)

3) What is happening/not happening?
(PUT YOUR INFO HERE)

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Like this?


#3

The example from @Gopack2 could potentially list both devices in the variable, if both changed in the last 30 seconds.

For a more reliable setup i would use the age([device name : device attribute]) function and a ternary operator (C ? T : F) to evaluate and compare the true age of each device and return the one that changed most recently.

(age([Temperature Sensor : temperature])<age([Temperature Sensor 2 : temperature]) ? [Temperature Sensor : temperature] : [Temperature Sensor 2 : temperature])

The example above will find the the device that changed most recently, and check if it has a value greater than 70

In my case, the device that changed most recently has a temperature reading of 69.

Change Temperature Sensor and Temperature Sensor 2 to represent the names of your two devices.

p.s. What’s up with the topic title, you mentioned motion but your question doesn’t??


#4

Good point

I am just guessing here the motion sensors report back temperature, I know the Bosch motions do.