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
-
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.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.