A Temperature Controlled Whole House Fan with MisterHouse
The 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 INSTEON_IOLINC, DE.AD.BE:01, whf_main, HVAC INSTEON_IOLINC, DE.AD.BE:01, whf_speed, HVAC |
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:
$house_fan_temp->tie_event('house_fan_temp_change($state)'); 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"); $whf_main->set("on"); } } else { if ($whf_main->state eq 'on'){ ::print_log("[a1housefan.pl] Auto: Turning off fan"); $whf_main->set("off"); } } } } |
The result, is a temperature controlled whole house fan. The image above is a screen shot from my web interface.