"Refresh" vs "Poll" Commands and "UndeclaredThrowableException" vs Timing


#1

I’ve written a webCoRE Piston to ‘refresh’ (16) Z-Wave and Zigbee devices spread throughout the house to assist in keeping ST device communication and connectivity active. It has worked well for quite a while. Recently, I noticed that I was getting semiphores (maybe I was getting them all along and just didn’t notice?) and decided to rewrite the Piston to split the devices into two groups - (10) of them refresh every (20) minutes and the other (6) receive the refresh command every-other cycle at 40 minutes. When both groups are refreshed at 40 minutes, there is a 10 second pause between the two groups. Here’s the piston:

I watched this run for a few days and there was almost no semiphores and everything was running well. Starting yesterday, I started getting, “Error while executing physical command {DeviceName} .refresh([]): java.lang.reflect.UndeclaredThrowableException” errors for some of the devices.

It’s very inconsistent. Sometimes the piston runs fine for many hours and when the errors do occur, it’s not always the same devices causing the errors.

So, looking for feedback. It sounds like this is a timing issue due to periodic system slowness - hence the inconsistency. I will likely rewrite the piston to add a short pause between each device to see if that helps - probably do this by adding a Do Loop for each device group. But, I’m also wondering about the ‘Refresh’ command. Do all devices accept that command? Or should I also look at the ‘Poll’ command?

TIA

Lee


#2

Nothing like responding to myself…

I created an alternative For-Loop piston that added a 2-second pause between devices and ran that for a while - thinking that the refresh commands were coming too fast for the system to handle. That assumption appears to be wrong as the "UndeclaredThrowableException” errors got much worse. So, it might be that the piston is taking too long - not that the commands are coming too quickly. I’ve reverted to the piston above and it seems to be running well right now.

I’m open to suggestions but the only think I can see that might help is to reduce the number of devices I’m refreshng. I may try that next.


#3

Depending on the device, I have seen a single “refresh” take longer than 30 seconds…
(although it’s usually under 10)


#4

Interesting. The piston posted above is again running fine. It must be that the piston is near the edge of running into problems when the ST system is running well and any ST system-related slowness causes the errors. I can reduce the number of devices I’m refreshing and see what happens. I selected the current devices so that there are Z-Wave and Zigbee devices throught the house. But if I draw a map and see which ones should be safe to eliminate to reduce the overall count, that may help with no significant issues caused to my original purpose.