Have I Done It? - Thermostat/Motion for Space Heater


#1

I’m trying to create a piston that will turn on a space heater by turning on a smart outlet when the following conditions exist:

  1. The two motion sensors in the room are active. (Mom & KWS Motion)
  2. The temperature (Mom) is below 67F.
  3. It goes off when temp is above 67 or person isn’t in room or no one is home (Away).

What have I missed or messed up?

2) What is the expected behavior?
Motion in room + Temp =<67 then On
No Motion for 20 Minutes = Off
Temp in Room =>68 then Off
Away Mode = Off

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

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)

REMOVE BELOW AFTER READING


#2

I think I had some logic errors and rewrote it to be this:


#3

Two triggers in the same IF block is going to create problems… (two motion sensors change at the same time)
Most likely it will not execute…or will rarely execute.

What is the reason you want two motion sensors being active at the same time?

If you are trying to figure out the walking path (if they are just passing by or walking into the room lets say) pick the first motion sensor that gets activated, use that as a condition.

ie : Motion sensor A is in the hall way and motion sensor B is in the room.

IF motion sensor B changes to active (trigger)
AND
IF motion sensor A IS active (condition)
then do this do that..

But remember, if the person is slow or changes their mind and walks back, and comes back this may create problems.
In that case, if you insist on using two motion sensors as a trigger and/or condition, you can use variables to replace one of the motion sensors.


#4

Thank you, I could use one. I used both to differentiate between someone coming in to grab something and someone actually sitting at the desk. The Mom detector is actually an Ecobee Sensor.
I’ll drop that one and see how it works.
Thank you.


#5
Might be simpler for your first if to use

If any of motion sensor 1 or motion sensor 2 change to active
     And
    Temp <67
Then
  Turn on
Endif

For the second if, you could also simplify using:

If all of motion sesnor 1 and motions sensor 2 stay inactive for 20 minutes 
   Or
  Temp > = 68
Then
   Turn off
Endif

#6

Thank you…cleaner, neater and a better chance of working.


#7

You reposted the same piston.