Temperature Controlled fan with manual override


#1

1) Give a description of the problem
I am trying to build a piston that turn a fan on and off when the temperature rises to 75 or above and someone is home. I also build a manual override that disables the temp sensor in cases where the temp is below the threshold and I still want the fan to run.

2) What is the expected behavior?
Temp Enabled:
-When anyone is home and the temp reaches 75 turn on the fan. When it drops below 75 turn off the fan.
Manual Override:
-Ignore presence sensors and temp to turn fan on and stay on. Will not turn off until manually turned off.

3) What is happening/not happening?
When I arrive home with the temp above the 75 target the fan does not turn on by itself. If I manually trigger the piston it seems to work. I believe my issue is that nothing triggers the piston, so I need design help to find the right sensor or action to ensure everything runs as expected.

Maybe monitor when presence sensor changes or run on a timer?

**4)Piston Image


#2

Change lines 50 and 70 to Any of… changes to present.

The way they are written now, changes in presence will not trigger the piston. When you change it to the above, you’ll see the little lightning bolt like there is next to lines 26 and 37 in your posted piston. That means those lines are “subscribed” and the piston will automatically execute when changes to those devices are detected.

Edit to add: You can create another IF statement that says IF all presence sensors are NOT present, turn the fan off (if you’d like). Since presence changes will already be triggering the piston to execute, you don’t need to use the “changes to” for that one.


#3

Your last two if statements do not have a lightning bolt next to them. They won’t trigger by themselves. Try editing them and click on the gear in the bottom corner of the edit window. Change subscription method from automatic to always subscribe. Do this for both of them.

That should help


#4

Michicago has it correct too.


#5

Thanks! Except I didn’t realize his presence conditions were restrictions, so they can’t be made to triggers. The other pitfall is if they were home and the temperature rose above the threshold, my version wouldn’t have picked up on that. Yours would.

I imported and modified a bit to make it simpler. I also added an IF condition at the top that will prevent the variable being set to FALSE if the fan is turned on by the piston.

I think this should accomplish what you’re after. If it doesn’t quite work right, post up what’s not working and we’ll get it figured out.


#6

Thank you both for the quick feedback and explanations abut how things are triggered. This is my first attempt at something beyond the simple lights on/lights off stuff.

I have updated based on your example michicago and will update the thread after some testing to see if that did it.


#7

No luck. Ran a trace and the statement evaluating the temperature always returns false. I lowered the value to 70 and the current temp is 75. I even added a variable to the SMS message to show the temp and it correctly shows 75, so this should return true.

What am I missing?


#8

I think for it trigger the first time, the temperature actually needs to rise above the threshold.

If you set it to one degree above whatever your temp sensor is reading now, then let the room warm up (can you turn on heat in that room) it should trigger and evaluate correctly.


#9

Just thinking… Another way you could do it is to say "if temperature is greater than or equal to 75"and make sure it’s subscribed to events as described a few posts up.

That will work now and you won’t have to wait for the temperature to rise to 75 or more.


#10

Just tried the subscribe method above and when manual triggered it ran correctly. Will do some more testing to make sure. Thanks again to you both.


#11

Did some additional testing and found one of my main issues was trying to use a temp sensor that only updated every hour or two. I modified the logic to run the piston when any of the temp sensors change. I also installed NST manager so I could use my Nest as a temp sensor as well. Now when any temp changes it checks the Nest temp and turn the fan on. Here is my updated piston that is currently working for me.


#12

Final version with better messaging.