Skip to content
ggodart edited this page Jan 27, 2021 · 11 revisions

mh.ini and mh.private.ini

Whenever you read about MisterHouse there will be mention of the mh.private.ini file. But before we delve into that, there is another file mh.ini that lines in the /mh/bin directory. This file holds all of the default parameters for MisterHouse, such as holiday dates, where the logs are stored, where the photos for the photo frame are stored, etc. Most of these parameters probably won't be used, but as the code is available the parameters have to be there.

First things first, DO NOT EDIT the /bin/mh.ini file! No really! It is very big and you may break something! And it changes over time as new features are added!

The correct way to tell MisterHouse your specific parameters is to put them into your personal mh.private.ini file in your MisterHouse root directory. Any parameters you put in the mh.private.ini will override the defaults set in the mh.ini file.

All the parameters in the file are generally of the kind:

# comments start with # e.g.
# something = value
tk = 0

Which we used earlier to tell MisterHouse that we don't want to run with a GUI window, (as we're running on Ubuntu Server without a graphical desktop, this option is a must otherwise MisterHouse will fail to start due to not being able to open a GUI window!)

Let's start with something simple, edit your mh.private.ini in your MisterHouse root directory and these lines:

latitude =44.0817
longitude =-92.5038
time_zone =-6

and save the file.

For these parameters to take effect you must restart MisterHouse.

These lines tell MisterHouse where on the planet the MisterHouse box and its users are located. You can use Google Maps to determine your specific lat/long values. The time_zone parameter tells MisterHouse your timezone. Surprise.

Using this info MisterHouse can determine sunrise/sunset times and the correct time, which can for instance, be used to automatically turn on lights. The sunrise/sunset times are also shown at the bottom of the MisterHouse webpage.

Commonly used .ini parameters

Area Example Meaning
Filesystem `root_dir = /home/pi/mh MisterHouse top level directory
Filesystem `code_dir = /home/pi/mh/Mycode Where to find the additional code you wrote
Filesystem data_dir = /home/pi/mh/Mydata Where to put log files etc.
Filesystem `sound_dir = /home/pi/mh/Mysounds Where to find sound files
Security password_allow_file = /home/pi/mh/Mydata/password_allow Where to find your password allow file
Security password_file = /home/pi/mh/Mydata/.password Where to find your password file
Security password_protect = all what to protect
Security password_allow_clients= 192.168.0.3, 192.168.0.4, 192.168.0.5 Defines which IP addresses don't have to log into the web service, useful for devices like tablets inside the house.
Geography `latitude = 52.25242811505444'
Geography `longitude = 1.102425456047058'
Geography `time_zone = 0' GMT
Geography `time_format = 24'
Geography `date_format = ddmmyyyy'
Geography `time_format_log = 12'
Geography `default_temp = Celsius'
Geography seasons=Winter,Spring,Summer,Autumn Which way around your seasons run
Geography wunderground_locality=global/stations/03779.html locality for www.wunderground.com look up your location and use the last 5 numeric in that url in this url...
Graphics tk = 0 Disable Tk interface
Web server http_port = 8077 Run the web server on port 8077

See /mh/bin/mh.ini for additional parameters that you want to override in your mh.private.ini

Each MisterHouse Item may require additional parameters, see [here][(tems-and-methods) for an index.

You can also add your own parameters e.g. in mh.private.ini

config_files_directory = /home/pi/mh/Mydata/config/

And in your code

my $config_file = $config_parms{config_files_directory} . "heating.tab";

Note that MisterHouse trims parameters both left and right.

Clone this wiki locally