Call MisterHouse to Regulate Your Heat

Combine MisterHouse with Perl scripts, X10 and the Linux kernel to create an automated zoned radiant heat system.

This can be set up as a cron job with a crontab entry:

*/2 * * * * root test -c /opt/mh/local/bin/ \
 && /opt/mh/local/bin/ >/dev/null

or it can be run periodically with MisterHouse.

I added a Perl routine to mh to query the RRD database periodically and compare current temperatures for each zone with the setpoint for that zone (specified in the mh UI code). If the current temperature is too far below the setpoint, the X10 module controlling the circulator for that zone is turned on. If the current temperature is too far above the setpoint, the X10 module is turned off. Right now, fault tolerance is achieved by turning on/off the appropriate X10 module on each loop if the current temperature is outside the acceptable differential from the setpoint. Eventually, the temperature sensors attached to the supply and return for each zone will be used to verify whether a zone circulator is running. They also will be used to calculate the actual heat output into each zone.

The RRD database keeps historical data, which might have a number of uses. Furthermore, RRD is designed specifically to record periodically polled values. It has configurable provisions to validate data and to handle queries against invalid data appropriately.

Perl is an object-oriented language, and MisterHouse takes advantage of that. Primarily, MisterHouse manages objects. The display elements, as well as programmed events and actions, all act on objects. MisterHouse already has a variety of interesting objects, but I needed something equivalent to a heating zone, so I created an HVAC_Zone object using an example object as a guide. My HVAC_Zones have a setpoint and a delta property. The setpoint is the target temperature for the zone, and the delta is the allowed deviation before taking action. HVAC_Zone objects inherit from the MisterHouse Generic_Item, so they appear in the UI under browse groups as well as in a few other places. Zones are created much like the X10 items described above. They can be created in the same .mht file with X10 items or in their own .mht file. Other HVAC groups might be North, Night and Vacation.

Figure 5. Browsing the All_HVAC group containing a single master bedroom zone—this shows a simple Web thermostat control to increase, decrease or set the setpoint for each HVAC_Zone object.

An example entry would be:

HVAC_ZONE,    H1,   master_bedrm,  All_HVAC|Thermostats,     72,  2,

This would create an HVAC_Zone object named master_bedrm in groups All_HVAC and Thermostats, with a setpoint of 72 and a delta of +/– 2°. A few minor alterations to the MisterHouse Web server were necessary to create a Web control that is displayed for each zone. I used the X10 Lamp item as a reference, as it already had a drop-down as well as arrow buttons for relative changes.

Finally, I use a Perl script executed periodically by MisterHouse to query the the current temperature of each DS1820 within each zone, comparing it to the current setpoint/delta for that zone turning on the appropriate X10 appliance module for that zone if the temperature within the zone is more than the delta below the setpoint. Currently, I repeatedly attempt to turn on the appropriate circulator so long as the temperature remains below the set range, and I repeatedly turn off the circulator so long as the temperature exceeds the set range. This provides limited fault tolerance. Turning an appliance module off when it may be off already or on when it may be on already accomplishes a small degree of fault tolerance. Before the next heating season, I expect to have code to verify the state of the circulator using the supply and return temperatures, as well as raise an alarm if the temperature in a zone drops more than twice the delta below the setpoint.

Resources for this article: /article/9193.

David Lynch is an underutilized software consultant engaged in sometimes fruitless attempts to make a living developing embedded and systems software—usually under Linux. In another life, he is an architect, and he currently keeps himself occupied when not randomly turning lights on and off throughout the house or writing software for clients by building his own home. Home automation combines his vocation of software with his interest in buildings, as well as satisfies his urges for world domination—at least within his own home. Dave can be reached at and



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

In floor heat system

Ryan McDougall's picture

I am interested in knowing more on the system you have installed and on the operations and management of it. We have existing the pipe work in our house to place an in floor heating system but we have not installed a system to this point. I am myself an automation expert and have plans for doing the control system on my own. I am however needing some help with the equipment selection, heating is not something I have much experience with and would like to know what you are using for circulation valves and what temperature of water you are circulating. I am assuming that the valve you have does both circulation and when the temperature is low is will dump to tank to pull heated water back from the system. I am also wondering about circulation methods, do you base circulation on you water temperature or room temperature. I have lots of questions so as long as you are willing to answer I would very much enjoy.
Ryan McDougall

multiple temp sensors

Anonymous's picture

did you ever install multiple temperature sensors in a room to understand the difference between perceived temperature and actual room temperature? thanks for the write-up (i'm an aspiring (considering grad school) architect, designing my own house with a bit of programming knowledge as well).

Peerceived temperature

dhlii's picture

In my list of experiments to do related to this are temperature sensors at different locations within the room.
Radiant floors put the heat at your feet. Perceived temperatures are strongly effected by the actual temperature of ones feet. Rooms also have a temperature profile that changes vertically. If we want both thermal comfort and energy efficiency then we need to start designing systems that create the greatest perception of comfort - without taking a blunderbus approach to HVAC.


Guide to Finance's picture

Thanks for sharing

Apt-get couldn't find package misterhouse

Joatmon's picture

I tried to use the apt-get installation indicated in the article, but it returned "E: Couldn't find package misterhouse". Any ideas as to what I am doing incorrectly?

Misterhouse debian package

Probebot's picture

You can download the debian package here...