Skip to content

Insteon Status Update

galiven edited this page Nov 7, 2014 · 2 revisions
  • NOTE: This page contains a suggestion from Marc Merlin for instances in which MH is not properly receiving status updates all of the time. The Insteon code has been significantly improved since Marc created this code. It is believed that a process like this is not currently necessary. Keep in mind Marc's warnings below, adding unnecessary traffic to your insteon network can cause MH to miss messages that it cannot hear. Additional traffic can also cause more messages to be corrupted. Use caution when enabling something like this.
Even if you properly link your switches so that mh gets status updates, under some circumstances, mh can lose track of device status, like:
  • if you switch Insteon devices directly with X10 commands
  • if you didn't configure all your inter device links in mh so that the PLM doesn't get updates on changes
  • dimming status may not be kept track of properly when coming from initiators like remotelincs in the current 2009/03 code
  • similarly, dimming a switch in a n way setup updates the other switches, but mh doesn't know the other switches got updated
  • if some status messages got lost or some other error happened
To work around this, you can have mh sync with reality from time to time by putting this so called voice command into your misterhouse/code directory (it's just a command you can run from other places later):
my $v_state;
$v_rescan = new Voice_Cmd 'AllDevices [Scan,Status]';

# Change 'PLM' with the name of your plm device in insteon.mht
if ($v_state = said $v_rescan)
{
  # from Insteon_PLM::poll_all
  foreach my $insteon_device ($PLM->find_members('Insteon_Device'))
  {
    if ($insteon_device and $insteon_device->is_root and $insteon_device->is_responder)
    {
      my ($dev_state, $dev_name) = ($insteon_device->state, $insteon_device->get_object_name);

      if ($v_state eq 'Scan')
      {
        print_log "log=logs/dev_status.log rescanning $dev_name that was $dev_state";
        $insteon_device->request_status();
      }
      # You can't call state right after status as the status commands are stacked up,
      # so you have to ask later
      elsif ($v_state eq 'Status')
      {
        print_log "log=logs/dev_status.log status $dev_name is $dev_state";
      }
    }
  }
}

and add something like the following to data/triggers.current while MH is not running (please be advised that scanning your house will make the bus busy, especially the more devices you have, and could interfere with normal operation. Every 15mn may be to aggressive for you). These go in data/triggers.current or can be added via the web through http://server:8080/bin/triggers.pl

name=Rescan Insteon type=NoExpire triggered=1237165200
time_cron '0,15,30,45 * * * *'
run_voice_cmd 'AllDevices Scan';

name=Result Insteon type=NoExpire triggered=1237165200
time_cron '2,17,32,47 * * * *'
run_voice_cmd 'AllDevices Status';
Clone this wiki locally