Virtual switch to turn furnace fan on for xx minutes


#1

Have a virtal switch called FanCirc. When it turns on, it sets my ecobee to fan on, waits 120 minutes then resumes the previous program.

I have this piston, which works but I don’t feel like it’s the most elegant way to do it. Further it would be nice if the virtual switch gets turned off before the 120 minutes is up, it’ll also tell the thermostat to resume.

I forget why I have those never cancel flags set either. I seem to remember needed them to work before.


#2

I think you probably need to think in terms of the virtual switch changing to on and off. I haven’t thought this through, but what about …

if
  FanCirc's switch changes to on
then
  with
    Thermostat 1
  do 
    set fan to on
  end with
  with
    FanCirc
  do
    wait 120 minutes
    turn off
  end with
end if

if
  FanCirc changes to off
then
  with 
    Thermostat 1
  do
    resumeProgram()
  end with
end if

When the virtual switch is turned on the fan is also turned on. After 120 minutes the virtual switch is turned off.

Whenever the virtual switch is turned off for any reason the previous program is resumed.

If the switch is turned off before the 120 minutes is up, the wait will be cancelled, which is what you want.

I think the reason you needed the ‘Never Cancel’ in your piston is because you are running the two actions asynchronously and have two timers running. When the piston wakes up and turns off the switch, that fires the piston again and that instance executes just before the other wake up timer and would be able to cancel it without the ‘Never Cancel’.


#3

I like that. Much more elegant.

I just built this with two virtual switches to play around and it works perfectly.

I tend to overthink these pistons all the time. :slight_smile:
Thank you!