Device Status update on start

Posted on
Tue Jul 10, 2018 3:56 pm
BonfireVA offline
Posts: 62
Joined: Sep 17, 2017

Device Status update on start

I have had a few power outages recently and I noticed that when the server comes back online several of my Zwave switches are not displaying the correct status (ie indigo says the light is off when its on). I figured I would set up a trigger on power failure, and or start up, to send status notifications requests to all the devices in indigo. I am not sure if I am missing something, but I don't see any way to tell indigo to send status requests to ALL devices. Adding each device one at a time to the trigger is a bit tedious and doesn't seem like a best practice especially if you would be adding more devices in the future. Is there a easier way to deal with this issue?

-Eric

Posted on
Wed Jul 11, 2018 12:39 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Device Status update on start

Good point.

I only have about half a dozen in my trigger, but you’re right it could/should be all.

Three ways off top of my head:

1) Matt/Jay Support it natively in Indigo
2) A plugin dev writes 2 lines of code
3) You create a python script with 2 lines of code

Someone will need to correct this pseudocode as I’m not at PC:
for dev in Indigo.devices.zwave:
dev.sendStatusRequest()



Sent from my iPhone using Tapatalk Pro

Posted on
Wed Jul 11, 2018 1:44 pm
BonfireVA offline
Posts: 62
Joined: Sep 17, 2017

Re: Device Status update on start

howartp wrote:
Good point.

I only have about half a dozen in my trigger, but you’re right it could/should be all.

Three ways off top of my head:

1) Matt/Jay Support it natively in Indigo
2) A plugin dev writes 2 lines of code
3) You create a python script with 2 lines of code

Someone will need to correct this pseudocode as I’m not at PC:
for dev in Indigo.devices.zwave:
dev.sendStatusRequest()



Sent from my iPhone using Tapatalk Pro


Thanks for the reply. I have been reviewing the various API and scripting docs looking for the proper syntax to implement the concept you outlined in pseudocode, unfortunately I can't seem to find anything. I did find a reference to sending all on or all off commands to all Zwave devices indigo.device.allOff(indigo.kAllDeviceSel.ZWave), and all zwave light devices, indigo.dimmer.allLightsOn(indigo.kAllDeviceSel.ZWave). I was hopeful when I found these that there would also be a option for getting updates on all zwave devices, but no luck, plus these all on/off commands don't seem to be working anyway.

My next thought was using the RESTapi to get a json list of devices (http://x.x.x.x:8176/devices.json) and then running that through a python script that would pull out the device names and send the update requests. Seemed like a good idea, but then I noticed the API call returns the device names, not the indigo device ID, which is what is needed to send the indigo.device.statusRequest(deviceID) call.

-Eric

Posted on
Wed Jul 11, 2018 2:05 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Device Status update on start

Relevant docs: Iterating Object Lists and the Status Request method:

Code: Select all
for dev in indigo.devices.iter("indigo.zwave"):
    indigo.device.statusRequest(dev)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Jul 11, 2018 2:09 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Device Status update on start

Thanks Jay.


Sent from my iPad using Tapatalk Pro

Posted on
Wed Jul 11, 2018 2:14 pm
BonfireVA offline
Posts: 62
Joined: Sep 17, 2017

Re: Device Status update on start

Thanks Jay, Ill take a look!

-Eric

Posted on
Wed Jul 11, 2018 2:32 pm
BonfireVA offline
Posts: 62
Joined: Sep 17, 2017

Re: Device Status update on start

jay (support) wrote:
Relevant docs: Iterating Object Lists and the Status Request method:

Code: Select all
for dev in indigo.devices.iter("indigo.zwave"):
    indigo.device.statusRequest(dev)


Works perfect!

Thanks Jay and howartp

-Eric

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests