Jump to content

Query device status from JDK


siegeld

Recommended Posts

I'd appreciate if you could explain how to query the status of a device (node) from the JDK. I'd also appreciate if you could include information on how to trigger a query of all nodes as well - the same operation that is performed when the ISY first starts up. I would like to do this on a periodic basis to make sure things stay in sync. Much thanks.

Link to comment

Hello siegeld,

 

It's quite simple:

UDProxyDevice dev = ISYInsteonClient.getDevice();
if (dev == null)
  return false;
dev.queryAll(address, true);

 

Please note the following:

1. ISYInsteonClient is the superclass of your class

2. The first parameter for queryAll method is the address of the device or the scene as a string

3. The second parameter for queryAll is whether or not the given address points to a device or a scene

 

May I humbly ask why you would want to do "schedule" maintenance in the code? You can simply use ISY's Admin Console to schedule the query (for whatever time you wish) on any device, any scene, or even My Lighting (all the devices). As a matter of fact, you should already have a schedule for 3:00 a.m. which does precisely that.

 

The advantages of the above are:

1. You don't have to maintain the schedules in your code

2. Whenever the schedule is run, you are "notified" of all the changes and you can act accordingly through the following callback method:

 

public void onModelChanged(UDControl control, Object value, UDNode node) ;

3. It's much more efficient to have the query schedules since ISY will only query the status if scheduled otherwise it will try to query the on level and ramp rate as well.

 

With kind regards,

Michel

I'd appreciate if you could explain how to query the status of a device (node) from the JDK. I'd also appreciate if you could include information on how to trigger a query of all nodes as well - the same operation that is performed when the ISY first starts up. I would like to do this on a periodic basis to make sure things stay in sync. Much thanks.
Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...