-
Notifications
You must be signed in to change notification settings - Fork 130
Insteon Programming
- NOTES
- This page has not been editted in quite some time and contains some significantly out of date information. If you are new to Misterhouse and Insteon please stick to the rather detailed Insteon page for the time being. It has been significantly revised to make it more accurate
This section is very incomplete, it is recommended that you look at the examples that ship with misterhouse, and now would be a good time to read the main mh documentation and you'll also find good tips and help in the FAQ page. If you aren't too familiar with perl, you can read about the perl syntax tricks used in mh (they may come handy, even if you are familiar with perl).
To answer the likely most common question for the X10 user, or someone trying to do something outside mh, this is how you toggle a switch from the command line:
gargamel:/var/local/src/misterhouse/mh/bin# ./mhsend --run 'fmr mast off'
(remove underscores).
If you wonder what voice commands are available, try this on the web interface: Browse MrHome -> List voice commands.
More generally, there are 3 major ways to get mh to do things for you:
- add code that is run as part of the main event loop
- write a web module/button that only runs code when triggered
- write a so called voice command, which is basically a command you can trigger from the command line among other ways (the command above would be run as mhsend --run 'AllDevices Scan).
As a quick sample, for your code directory, you can create ~mh/code/insteon.pl:
# Category=Insteon #@ Jason Sharpee's Insteon PLM interface user code # Example use, turn the patio lamp at 10 minutes before sun set if(time_now("$Time_Sunset-0:10")) { $office_lamp->set('50%'); } # Example use, turn the patio lamp off at midnight if(time_now "12:00 AM") { $x10_kitchen_light->set(OFF); }