Newbie---Piston Help


#1

Hello everyone, I need help.

I have three fans to circulate warm air from my wood burning stove.

This is what I am trying to make happen when thermostat reaches 73 deg.

  1. When the thermostat reaches 73 deg, turn on my living room fan.
  2. If the living room fan comes on, I want the hall fan to come on.
  3. If the hall fan has been on for at least 10 minutes, I want it to turn the heat fan on(bedroom fan)
    4, If it is between 8 pm and 7 am turn on and keep heat fan on. regardless of temperature.

Then, If it falls to 71 deg. I want it to

  1. Turn off living room fan
  2. wait 10 minutes
  3. Turn off hallway fan
  4. If it is between 9 am and 7 pm and hallway fan has been off for 5 minutes turn off heat fan
    Also, I still want to be able to control living room fan manually at any temperature and keep all the triggers the living room fan triggers.

I have no idea what I am doing and need some guidance.


#2

Hi there and welcome to webcore.
You’ll find this forum very efficient and lots of helpful people around.

That piston (i haven’t read line by line) would probably never execute due to TONS of IF/Else and nested IFs…

Lets go very simple and start adding more step by step once they work.
First step,

IF thermostat reaches 73,

  1. Living room fan comes on
  2. Hall fan comes on
    lets just keep it this simple to begin with…

IF falls to 71,

  1. Living room fan turns OFF
  2. Wait 10 minutes
  3. Turn OFF hallway fan.

For the other stuff you need to get dirty with variables and maybe even a second piston…

Let me write the simple first step.

IF thermostat temp rises to or above 73 (you need a trigger instead of a condition for this one) 
Then 
With
Livingroom fan, hallfan 
do Turn ON

(now completely separate IF block)
IF thermostat drop to or below 71
Then 
With 
livingroom fan 
Do turn OFF
Then (TCP set to never cancel task)
With hall fan
WAIT 10 minutes
Turn OFF

This is far from being complete but since your title says Newbie, I assumed you might want to learn some basics first.

Here are the possible obstacles you will face writing this - but we’ll get to those - some I can help some can’t/.
a) Does the temp change very fast in your environment.
ie: 73 inside but 20 outside and if door is left open 10 seconds the sensor can go down to 65 very fast.
b) What would you want if it’s 72 and remains that way for a long period of time?


#3

Hey, thanks for your response. So to answer your question, yes, I am trying to learn some basics. I have surfed the internet to no end, but it doesn’t seem like there is a wealth of information out there. So yeah, I am hoping someone could guide me through at least one advanced piston to learn from example.
Anyway, the temp does not change fast at all. I just want it so that when I go to bed, sometime in the middle of the night, it will drop, so i want the fan to shut off so it doesn’t blow cold air around. So as long as it is 73 and above, but not below 71, the fans should circulate. So, in the example you wrote, It makes perfect sense. But what is TCP?


#4

TCP is Task Cancellation Policy.
Simply,
Pistons run top to bottom in one go like a rain drop and doesn’t stop when there is WAIT.
But if you change the TCP to NEVER then when it comes to WAIT it will wait as long as you told it to.

Check this example I made while ago.