-
Notifications
You must be signed in to change notification settings - Fork 130
Using Siri to Control Misterhouse
Using Siri to control Misterhouse has a very high cool factor.
Thanks to some excellent work by one of our esteemed Misterhouse contributors hplato, this is now reasonably easy to do.
It's accomplished by using a lightweight nodeJS server aptly named Homebridge that presents itself over the network as a controllable 'accessory' to the Homekit feature on your iOS device. To get this working in Linux follow these steps:
Step 1.
Follow the installation instructions for the Homebridge server here until you get to where typing 'homebridge' at the command prompt gives you:
$ homebridge
No plugins found. See the README for information on installing plugins.
Step 2.
From here you will want to install a homebridge-legacy-plugins repository. But instead of installing the repository using npm, install hplato's homebridge-legacy-plugins repository.
First find your 'node-modules' directory by issuing the command:
$ locate /homebridge/
and look for a directory listing something like:
/usr/local/lib/node_modules/homebridge/
then issue these commands (adjusted to your nod_modules location)
$ cd /usr/local/lib/node_modules/
$ git clone https://github.com/hplato/homebridge-legacy-plugins.git
By issuing the following command:
$ ls /usr/local/lib/node_modules/
you should see a directory listing something like this:
homebridge homebridge-legacy-plugins npm npm-check-updates request
where the 'homebridge' and 'homebridge-legacy-plugins' directories are under your 'node_modules' directory.
Step 3.
Once you have Homebridge up and running and the hplato homebridge-legacy-plugins repository installed the next step is to provide a configuration file that tells Homebridge about your Misterhouse objects.
First you need the Misterhouse code that will create a config.json file for Homebridge. You can find that here.
Go to your local code directory for Misterhouse. In my case that's /opt/mh/local/code
and using your favorite text editor create a file called homebridge_gen_config.pl
. Paste the code found above into the file and save it.
From the Home menu in Misterhouse, click 'Mr. House', 'Set up MrHouse', 'User Code Activation' and look for the homebridge_gen_config.pl and make sure it is activated. Click on the link for 'EDIT Config parms' and adjust the ini parms if required.
Step 4.
Now edit your items.mht file to add the groups that the 'homebridge_gen_config.pl' script will look for to create your config.json.
The groups you will add are as follows:
HB__LIGHT for lights
HB__SWITCH for relays (or lights with no dimmers)
HB__BLIND
HB__LOCK
HB__GARAGEDOOR
HB__FAN
Items.mht examples:
INSTEON_SWITCHLINC, 22.62.48, Front_Door_Light, Outside|HB__SWITCH
INSTEON_SWITCHLINC, 12.24.08, TV_Light, Family_Room|HB__LIGHT
SERIAL, BCD500, blinds, Family_Room|HB__BLINDS, up, weeder
INSTEON_ICONTROLLER, 6, Movie_Lights, Family_Room|HB__SWITCH
SCENE_MEMBER, Center_Light, Movie_Lights, 0%, 5s
SCENE_MEMBER, Window_Light, Movie_Lights, 0%, 5s
SCENE_MEMBER, TV_Light, Movie_Lights, 50%, 10s
SCENE_MEMBER, Fireplace_Light, Movie_Lights, 0%, 5s
SCENE_MEMBER, Wall_Light, Movie_Lights, 0%, 5s
Step 5.
The next step is to run the homebridge_gen_config.pl script from 'Menus' in Misterhouse. This will create and place a file into your local data directory called homebridge_config.json. In my case, the new file is /opt/mh/local/data/homebridge_config.json
.
Step 6.
Finally, copy the new config file to where Homebridge can see and use it. In my case, the command was:
$ cp /opt/mh/local/data/homebridge_config.json /root/.homebridge/config.json
Start Homebridge and you should be good to go.
I use an app called MyTouchHome to organize the new Misterhouse accessories into zones and rooms.
If all is well you should be able to issue commands to Siri such as:
"Siri Turn the TV Light on"
"Siri open the blinds in the Family Room", etc.