Jump to content

Query device status from JDK


siegeld

Recommended Posts

Posted

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.

Posted

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.
Posted

siegeld,

 

My pleasure ... please don't hesitate to contact us with your questions vis-a-vis JSDK.

 

With kind regards,

Michel

Thanks - I did not realize that you could do this from the console. I've now set it up as you suggest. Thank you.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...