Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Query device status from JDK

Featured Replies

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.

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.
  • Author

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

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.