Whole House Fan (Switch)

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 ???


Thanks @ac7ss. I installed a Leviton DZ15S to control my whole house fan and your Fan Control Smartapp worked perfectly. Now I need to shop for a good outdoor temp sensor.

How is it possible to open the double hang windows before the fan comes on ? The incoming air draft will shut off the pilot light for the heater.Has anyone worked with linear actuators ?

I can not answer the linear actuator question. But it is critical that you have a source of fresh air any time the whole house fan is run. Or the air flow through your gas water heater can be reversed and pull carbon monoxide into the living space. The fan control smartapp also knows about my ecobee3 thermostat states. And it should not run when it is in away mode. However I have not tested that yet. When I am home during the summer a window will be open since I do not have AC.

I would just cut and paste the code in the IDE.

Brian, I see the “window check” version of “Whole House Fan” is in Marketplace now. Where do I find that code to review/study/learn? Your Github version does not have the Window check; latest version there is Nov. 2014. Or, maybe I just don’t know how to Navigate Gitub. Pls help.

At some point I moved my SmartApps to a new repo (probably for better IDE integration). Link is below.