This is the problem:
physicalgraph.zwave.commands.sceneactivationv1.SceneActivationSet
called
parse()
every Xms (I forget the exact/rough value) until it returns an event.
If you ran this
def parse(String description) {
log.debug description
return
and did not create an event, the system would log a description roughly 2/3rds of the time and not log the description at all 1/3 of the time, my assumption is that the function returned an ‘all done’ message before it had finished writing a ‘start work’ state somewhere which resulted in really erratic behavior.
Adding in a simple createEvent
def parse(String description) {
log.debug description
createEvent(name: "button", value: 1)
return}
results in 90% of the time the system calls parse() once, and 10% calls it twice. Using sendEvent() in my custom locking code seemed to get this down further. Basically, if I could get an event fired off ASAP, the chances that parse() would run again would drop significantly.
If we start calling all sorts of zwave event and parse functions, we start to increase the number of times parse() runs as it keeps firing them off until it reaches 6, or an event fires.
For instance, the normal barebones example containing several function calls resulted in a significant number of 2 parse() calls and occasional situations of a 3rd.
def parse(String description) {
log.debug description
def result = null
def cmd = zwave.parse(description)
if (cmd) {
result = zwaveEvent(cmd)
} else {
log.debug "Non-parsed event: ${description}"
}
return}
Then at around 3:30PST, some new debounce code prior to parse() being called started propagating and it now almost never fires off more than one parse(). Which, is nice and all, but it precludes using some really quick code I wrote that prevented multiple runs of parse() and thus enabled an app I’m writing that allowed the button to be pressed numerous times to dim lights or change hue colors. There now seems to be debounce code that makes me wait ~2 seconds between button presses containing the same sceneID.
@tgauchat I’m sure you can ask some questions to help me clarify — I’m not as single-mindedly engineering detail oriented.