Loading ...
Sorry, an error occurred while loading the content.

Re: [mh] simple example of insteon trigger / action?

Expand Messages
  • Kevin Robert Keegan
    There are a lot of examples out there: http://misterhouse.sourceforge.net/examples.html http://misterhouse.wikispaces.com/Insteon+Programming You can also look
    Message 1 of 2 , Feb 25, 2013
      There are a lot of examples out there:

      You can also look in the code/examples directory.

      As for a tutorial for beginners, I don't know of one.  MH is basically one big perl script.  This makes the initial learning curve a little steep, but the potential is really only limited by what your computer can do.

      Does anyone have a good perl tutorial? 

      The following is the motion.pl file that I created and saved in my code directory.  It uses all of the names of my devices, so it won't work for you, but it can get you started.  My motion sensors are $g_st_mt.  It controls the light $g_st_lt_ma.

      My motion sensors are not linked directly to my lights.  While this causes a slight delay between when motion is detected and when the lights turn on, it allows me to alter the result depending on the time of day.  Such as using a lower on_level at night or staying on for a longer period of time at a specific time of day:

      # Category = Device Management

      #@  Commands to run on Motion detected

      ## Garage Motion Entry
      # If motion detected turn on entry light
      my $f_kt_en_lt_ma_timer;  #timer used to turn off lights
      if ($g_st_mt->state_now && $g_st_mt->state eq 'on'){
      $f_kt_en_lt_ma_timer = time;

      #turn off after time
      if (defined($f_kt_en_lt_ma_timer) && (time - $f_kt_en_lt_ma_timer) > 120){
              $f_kt_en_lt_ma->set('off'); undef($f_kt_en_lt_ma_timer);


      As for sending an email or making a noise, I haven't done that yet either.  But, there are numerous things in MH that will allow you to do that.  

      Try looking through the old FAQ which describes both email and sound features:

      On Mon, Feb 25, 2013 at 4:37 PM, SSzretter <sszretter@...> wrote:

      Hi, hoping someone can show me, explain, or point me to a link of a simple insteon action?

      I have my insteon devices (sensors - motion for example), working, and I see that they trigger in the log, and I see them in the web interface when I go to browse groups -> sensors.

      However, now, how do I do more?    For example, how do I say make a noise, or send an email, or do something else when the motion sensor triggers?

      I feel like I am probably missing the basic tutorial...

      Everyone hates slow websites. So do we.
      Make your web apps faster with AppDynamics
      Download AppDynamics Lite for free today:
      To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

    Your message has been successfully submitted and would be delivered to recipients shortly.