MisterHouse is an active, community-driven, open source home automation project
Configuration
In the mh-samples.rgz
file, I've loaded a default set of parameters that should allow you to get MisterHouse up and running without errors. Understand that not everything in MisterHouse is enabled, only a small subset. The default private INI file for MisterHouse is ~mh/misterhouse/bin/mh.ini
.
To make sure MisterHouse uses the correct mh.private.ini
file, set the shell variable mh_parms
to its path (export mh_parms=${HOME}/local/mh.private.ini
). Using the private INI file I have provided, you will find that its default settings will allow MisterHouse to start up (see the abbreviated mh.private.ini
in Listing 1). You can experiment later with the other values.
Listing 1
A Section of mh.private.ini
Lines that begin with a #
or @
are considered comments. Any parameter found in the mh.ini
file can be overridden in the mh.private.ini
. $Pgm_Root
is an internal MisterHouse variable; the gd
and tk
variables should be left set to 0
(turning off the use of the GD and TK libraries). The http_port
file should be changed only if you need to use a different port for the MisterHouse's HTTP server. The rest of the variables are there for you to experiment with.
Now It's Time to Play!
To start up MisterHouse, as user mh
, type:
cd ; ./start.sh
If no errors occur, MisterHouse will start spewing information to the terminal.
Next, open a browser and type the following URL into the address bar: http://IP_Address:8080/ (replace IP_Address with the MisterHouse server's eth0 IP address). Figure 1 shows the main web page for MisterHouse.
No article can do justice to what MisterHouse can do. I will get you started, give you brief introduction, and then give you something to work with. Fortunately, MisterHouse comes with documentation: http://IP_address:8080/docs/index.html.
In the MisterHouse main window (Figure 1), the most important link is the top left MisterHouse button. This button will return you to the home page. The next important button is the MisterHouse Home button. This button will take you to the administration and configuration page, where you can configure, monitor, and enable/disable the various code modules included with MisterHouse (MisterHouse Home | Setup MisterHouse.
Note the lavender status line at the bottom of the page in Figure 1; 115, 86.9F Partly Cloudy, and North @ 0 mph wouldn't be the values on your system. In my home setup, that information is pulled from a Rube Goldberg set of scripts I built for experimenting with. I've simplified everything for this article. In a moment, I'll introduce you to the command-line tools to mimic the data sent by my experiments and instead use MQTT to fill in the status bar information.
User Code
Your user code tells MisterHouse what you want it to do. The code resides in the local/code
directory. The filenames you choose can be anything; the only stipulation is that the code inside must be valid Perl and must have .pl
as the file extension. One exception is the .mht
file (MisterHouse table). When MisterHouse starts up, it reads in the xxx.mht
file, converts it to Perl code, puts it into a file called xxx.mhp
, and loads that file. This .mhp
and other .pl
files will be run as Perl code in MisterHouse's main loop. Code that you don't want to run in the loop, such as code for loading a module or initialization code, will be bound by the # noloop=start
and # noloop=stop
lines. More on that later. In the examples below, I've created two files called example.mht
and mqtt.pl
. The example.mht
file sets up the needed Perl objects, and mqtt.pl
uses those Perl objects to make decisions.
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.