Status Poll Script

Posted on
Thu Mar 29, 2018 4:28 pm
GRWilde offline
User avatar
Posts: 173
Joined: Nov 15, 2005
Location: Los Angeles

Status Poll Script

I have an external status poll AppleScript that I run daily to determine the status of all of my devices. Most other AppleScripts I use I have been successful in converting to Python, but I have no idea how to convert this one. Any suggestions?

Code: Select all
set ignoreList to {"RemoteLinc 2 Wireless Keypad", "Guest Bedroom Remote Control", "003 - Downstairs Hall Motion Sensor", "004 - Entry Hall Motion Sensor", "005 - Upstairs Hall Motion Sensor", "006 - Inside Garage Motion Sensor"}

tell application "IndigoServer"
   with timeout of 60 seconds
      try
         repeat with curDevice in devices
            set curDeviceName to name of curDevice
            if (supports status request of curDevice) and (ignoreList does not contain curDeviceName) then
               status request (curDevice)
               delay 0.75
            end if
         end repeat
      end try
   end timeout
end tell

George Wilde

Posted on
Thu Mar 29, 2018 4:59 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Status Poll Script

Code: Select all
ignoreList = [RemoteLinc 2 Wireless Keypad", "Guest Bedroom Remote Control", "003 - Downstairs Hall Motion Sensor", "004 - Entry Hall Motion Sensor", "005 - Upstairs Hall Motion Sensor", "006 - Inside Garage Motion Sensor"]
for dev in indigo.devices:
   if dev.name in ignoreList: continue
   if "supportsStatusRequest" in dir(dev) and dev.supportsStatusRequest:
      indigo.device.statusRequest (dev.id, suprpressLogging=True)
Last edited by Colorado4Wheeler on Thu Mar 29, 2018 5:01 pm, edited 1 time in total.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Thu Mar 29, 2018 5:00 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Status Poll Script

This is a direct port:

Code: Select all
import time

ignore_list = [
   "RemoteLinc 2 Wireless Keypad",
   "Guest Bedroom Remote Control",
   "003 - Downstairs Hall Motion Sensor",
   "004 - Entry Hall Motion Sensor",
   "005 - Upstairs Hall Motion Sensor",
   "006 - Inside Garage Motion Sensor"
]

for device in indigo.devices:
   if device.name not in ignore_list and device.supportsStatusRequest:
      indigo.device.statusRequest(device)
      time.sleep(.75)


Be sure to run this as an external script (not embedded). One obvious improvement would be to make ignore_list a list of device ids rather than names so you could change the name and it would still work as expected.

I have to ask though: why are you running this daily? If you're having device out of sync issues wouldn't it be better to get to the bottom of that problem? I'm pretty sure if you have a lot of Insteon devices that this script is going to cause tons of problems because it's flooding the network with lots of traffic. And Insteon is terrible when it comes to network collisions.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Mar 29, 2018 5:02 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Status Poll Script

Great minds think alike :lol:

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Thu Mar 29, 2018 5:32 pm
GRWilde offline
User avatar
Posts: 173
Joined: Nov 15, 2005
Location: Los Angeles

Re: Status Poll Script

Thanks for the input. With most of my scripts I am using Device IDs, but I just resurrected this one recently and began regularly running it to check on a couple of my older Insteon devices that are having periodic connection problems. It would probably be much better to only check on these few devices, but I wanted to see if I had more general problems, and a number of devices are not accessed very frequently. I have had to replace a number of my really old Insteon devices in recent years. The newer ones seem to have better reliability.

George Wilde

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron