Whole House Fan (Switch)

OK, but remember, I’m not trying to make the garage a nice, cool place to be; I’m simply attempting to limit the amount of heat there is in there that can be transferred into the house. I’ll come back and let you know how it’s working (or not) once I get the fan mounted…

1 Like

What kind of whole house fan? Did you install it yourself? Is there also a damper? Is the damper controlled by a switch? Is it insulated so that there is no heat loss in the winter?


I installed this:

QuietCool is what I would like to pick up myself. I’ll probably work to get one in place over the winter so that it’s ready for next season.

Great code. I’m just getting started with ST and setting up a whole house fan is my first project. Your code appears to be almost exactly what I was looking for with one caveat. I use the EcoBee 3 Thermostat with @yvesracine s binding. Your code polls thermostatMode. In the case of EcoBee3, all summer it’s in “cool” mode meaning it’s allowed to cool the house if it’s hotter than the set-point. The problem is that this also means that your code sees the thermostat is not “Off” and will never turn the WHF on.

What I would really like your code to look at is:
thermostatOperatingState (if not ‘Idle’ then don’t run) or
equipmentStatus (if not ‘Idle’ then don’t run)

I have tried modifying your code:

def thermostatMode = settings.thermostat.currentThermostatMode


def thermostatMode = settings.thermostat.thermostatOperatingState

Unfortunately this parameter returns ‘null

I can see these parameters under EcoBee Device Current States, any guess what I’m doing wrong that I cannot access these parameters in this app?

Thanks so much!

Note: Eventually the long-term plan is to have this app SET the EcoBee3 to “off” when the WHF is running and then reset EcoBee3 to “Cool” when conditions are not met (too hot outside or windows are closed).


[quote=“bravenel, post:22, topic:2447, full:true”]
I recently wrote just such an app for the very same reason…[/quote]

I got mine going with your SmartApp (see my update HERE if interested). :slight_smile:

Thanks a lot!

Edited: To disable the original app, simply set the Threshold temp above any real temp, and the app won’t turn on the fans.


Thanks, Bruce.
I will test it this weekend and get back to you.

So, with this, there will be no need for my ‘disabled’ Mode, right?..I mean, unless I want it for something else or whatever.

Not for this app, no. You just have to use a disable switch. That can be a virtual switch.

Dear Brian,
I have searched everywhere for a script like this and your idea is well thought out and I am sure already being used and enjoyed by countless ST users. I am actually looking to cool a massive warehouse with outside air which could also be applied to homeowner’s attics, basements and garages but the biggest improvement is to fully automate green indoor cooling by actually opening and closing the window or vent for them without any intervention and continue to turn off the thermostat as you already programmed. The variation I am looking for is for is ST to ping an indoor and outdoor thermostat every x mins 24/7 and keep the minimum variable indoor threshold you have already written. Here are some other mods and why: If outdoor temp is x degrees less than indoor temp, turn on switches. If outdoor temp is x degrees higher than indoor temp, turn off switches. The reason for the variable delay in pinging of temps and the variable threshold is so air has a chance to settle before triggering on and off commands over and over. Also the variable is so one can set their attic systems which might never reach below outside temp or for circulating the basement air which might always stay cooler with outside lower humidity air. Actually turning on and off switches is important for this application because I will have many switches automatically open vents (windows) and many switches turn on different fans. If it is toggle, then the command might accidently trigger the reverse over time and damage fans running without proper ventilation or even reverse the cooling plan. The entire program could be reversed to control heating as well. Your idea is wonderful, hope this idea further expands on it.

Thanks for your help!

Is there a way to do this with a routine? I have a whole house fan but I would like it run when I say so but automatically turn of when the inside temp reaches a certain temperature.

Maybe this will help:

I have written my own version of this. Mine doesn’t use the thermostat to set the cooling mode. (so you don’t need to have one.)
The options on mine are:

  • Devices to turn on (multiple choice)
  • Inside thermometer
  • Outside thermometer (Use your own or the accuweather device)
  • Inside minimum temp (When to start considering turning the fan on.)
  • Temperature Delta (how much warmer inside than outside to start the fan)
  • Always run temperature (Run the fan regardless of outside temp)
  • Override off hours shutdown if over the always run temp
  • Optional start and end times. (in case you don’t want to have it on at night)

This was not a fork, but written as my first program to learn the language and API.

If there is any interest, I can release it.

I am interested.

Here is the code I am using.

 *  Fan Control
 *  Copyright 2016 Glenn Brockett
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *      http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *	Things I want to do:
 *		Add option for using thermostat settings for setting and if in cooling mode.
 *			Optional Themostat device, if defined, will use both setpoint and if in cooling mode.
    name: "Fan Control",
    namespace: "ac7ss",
    author: "Glenn Brockett",
    description: "Turn on fan when outside temperature is lower than inside.",
    category: "Green Living",
    iconUrl: "https://iconalone.com/sites/default/files/styles/frontx48x48/public/Fan.svg_0.png",
    iconX2Url: "http://downloadicons.net/sites/default/files/fan-icon-46129.png",
    iconX3Url: "http://downloadicons.net/sites/default/files/fan-icon-46129.png",
    oauth: true)

preferences {
	section("Device(s) under control:") {
    	input "ThisSwitch","capability.switch", title: "Switched Device", required: true, multiple: true
    section("Temperature sensors:") {
    	input "InsideTemp", "capability.temperatureMeasurement", title: "Inside Thermometer", required: true
       	input "OutsideTemp", "capability.temperatureMeasurement", title: "Outside Thermometer", required: true
    section ("Temperature settings:") {
    	input "Delta", "number", title: "Temperature Delta", required: true
    	input "MinimumTemp", "number", title: "Inside Minimum Temp", required: true
        input "MaxTemp", "number", title: "Always Run If Hotter Than", required: true
        input "Override", "bool", default: true, title: "Override off time setting on always run setting?"
    section ("Time Constraints") {
    	input "TimeOff","time", title: "Turn off at:", required: false
        input "TimeOn","time", title: "Start program at:", required: true

def installed() {
	log.debug "Installed with settings: ${settings}"

def updated() {
	log.debug "Updated with settings: ${settings}"


def initialize() {
	state.fanRunning = false;
    if ("on"==ThisSwitch.currentswitch){
    	state.fanRunning = true;
	state.runtime = true
	if (TimeOff) {
		schedule(TimeOff, "stopCallback")
   	schedule(TimeOn, "startCallback")
	subscribe(InsideTemp, "temperature", myHandler);
    subscribe(OutsideTemp, "temperature", myHandler);
    subscribe(ThisSwitch, "currentswitch", myHandler);

// TODO: implement event handlers

def stopCallback() {
	state.runtime = false;
    state.fanRunning = false;

def startCallback() {
	state.runtime = true;
    state.fanRunning = false;

def myHandler(evt) {
	def Inside=settings.InsideTemp.currentValue('temperature')
    def Outside=settings.OutsideTemp.currentValue('temperature')
    log.debug "Variables: $Inside $Outside $Delta $MinimumTemp $state.fanRunning"
    if (state.runtime) {
	    if(Inside > MinimumTemp && ((Inside > (Outside+Delta))||(Inside > MaxTemp)) && !state.fanRunning ) {
    		log.debug "Turn on"
	    } else if ((Inside < MinimumTemp || (Inside < Outside && Inside < MaxTemp)) && state.fanRunning) {
    		log.debug "Turn off"
        	state.fanRunning = false;
    }else if (!state.runtime) {
    	if(Inside > MaxTemp) {
    		log.debug "Offtime Turn on"
        }else if (Inside < MaxTemp){
	    	log.debug "Offtime Turn off"
        	state.fanRunning = false;

I thought this would be a good place to ask since so many posters here have whole house fans. What switch is everyone using, and what are the specs on the fan it controls? I have a 1/3hp 6amp motor on mine and want to make sure I get a switch that can handle the load. Thanks!

I haven’t installed a whole house fan yet, but I had the builder rough out an opening when the house was built 2 years ago, and I’ve done quite a bit of research on this.

There’s no easy solution for automating a whole house fan beyond on/off. For on/off, any of the regular z-wave switches will do the job (GE, Zooz, etc.) but the hi/lo switch will need to stay.

See this discussion for more.

This is exacrtly when I’m doing for mine. The attic fan itself is set on high, and I use a GE fan controller to control it. Cheers!

Mine is LITERALLY a box fan on a plug in switch set in the vent opening in my attic.

Hello Glenn,
This is exactly what I’m looking for. However, I’m a ST Noob…can you point me to a FAQ that explains how to incorporate this software into my system? I can’t find it published in the Smartthings Mobile App. I’m guessing go to the developer site\ My SmartApps\Import ???