A Temperature Controlled Whole House Fan with MisterHouse

A Temperature Controlled Whole House Fan with MisterHouse

MisterHouse Web Interface for a Temperature Controlled Whole House FanThe main feature of MisterHouse that sets it apart from other home automation systems is the ability to customize practically every aspect of the system.  The following example is a perfect demonstration of this.

I recently purchased a whole house fan, basically a giant fan that sucks hot air out from the highest point in my house. They are great if you live in a climate with cool nights.

The controls for my fan were very basic, an on/off switch and a two-speed setting.

With Misterhouse, I created an “auto” mode which will only turn on the fan if both the indoor temperature is above a defined threshold and the outdoor temperature is 5 degrees below the indoor temperature.

This is how I did it.

Starting Materials
– A Whole House Fan
– 2 IOLincs, (1 for on/off, 1 for fan speed)
– A MisterHouse enabled indoor temperature sensor (I used my Insteon Thermostat)
– A MisterHouse enabled outdoor temperature sensor (I used data from a neighbor’s weather station through weatherunderground)

I created the following items in my mht file:

GENERIC, house_fan, HVAC|WHF_Group
GENERIC, house_fan_temp, HVAC|WHF_Group
GENERIC, house_fan_setpoint, HVAC|WHF_Group
GENERIC, house_fan_ambient, HVAC|WHF_Group

I also had the following items already setup:

$upstairs_thermo_temp #the temperature upstairs
$w_temp #the outside temperature

First, I set the available states for my generic objects:

$house_fan->set_states('on', 'off', 'auto');
$house_fan_speed->set_states('high', 'low');
$house_fan_temp->set_states('cooler', 'warmer');

Then I tied my generic items to my Insteon Devices:

$house_fan->tie_event('$whf_main->set("on")', "on");
$house_fan->tie_event('$whf_main->set("off")', "off");
$house_fan_speed->tie_event('$whf_speed->set("on")', "high");
$house_fan_speed->tie_event('$whf_speed->set("off")', "low");

Then I tied my Generic temp item to my Generic setpoint item, and inserted some custom code:

sub house_fan_temp_change {
	my ($state) = @_;
	if ($state eq "warmer"){
		$house_fan_setpoint->set(int($house_fan_setpoint->state) + 1);
	} elsif ($state eq "cooler") {
		$house_fan_setpoint->set(int($house_fan_setpoint->state) - 1);

By doing this, I can have a nice cooler and warmer button in the web panel.

Finally, every minute I check to see if the device is in “auto” mode and whether or not it should turn on:

if ($New_Minute){ 
	if($house_fan->state eq 'auto') {
		if (int($upstairs_thermo_temp->state) > int($house_fan_setpoint->state) &&
		(int($upstairs_thermo_temp->state) - 5) > int($w_temp->state)) {
			if ($whf_main->state eq 'off') {
				::print_log("[a1housefan.pl] Auto: Turning on fan");
		} else {
			if ($whf_main->state eq 'on'){
				::print_log("[a1housefan.pl] Auto: Turning off fan");

The result, is a temperature controlled whole house fan.  The image above is a screen shot from my web interface.

One thought on “A Temperature Controlled Whole House Fan with MisterHouse

  1. Hi,

    Thanks for the info, I’ll definitely check out some of the generic item capabilities of misterhouse.

    I was wondering which web interface you’re using – looks like a screenshot from a mobile device?

    Do you just have all this code in a user code file within misterhouse?


Leave a Reply

Your email address will not be published. Required fields are marked *