Fixed: Zigbee button is buggy


(Norman Williams) #1

The Iris button was unreliable especially on first press. It would not trigger pressing. I looked at the code and found the problem. Here is the failed and good logs and I saw error in timeDiff:

FAILED:

e35fbafc-1a2f-4367-828f-0642cd6329f7 11:31:52 AM: debug Parse returned [:]
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:31:52 AM: info presstime: 1501515112914
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:31:52 AM: debug Button was value : press
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:31:52 AM: debug description is catchall: 0104 0006 01 01 0140 00 8911 01 00 0000 01 00
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:31:52 AM: debug Parse returned [:]
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:31:52 AM: info holdp2 : 1000
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:31:52 AM: info holdp1 : 1
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:31:52 AM: info timeDiff: 921785
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:31:52 AM: debug Button was value : release
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:31:52 AM: debug description is catchall: 0104 0006 01 01 0140 00 8911 01 00 0000 00 00

GOOD:
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:32:53 AM: debug Parse returned [name:button, value:pushed, data:[buttonNumber:1], descriptionText:Iris Smart Button button 1 was pushed, isStateChange:true, displayed:true, linkText:Iris Smart Button]
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:32:53 AM: info holdp2 : 1000
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:32:53 AM: info holdp1 : 1
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:32:53 AM: info timeDiff: 108
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:32:53 AM: debug Button was value : release
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:32:53 AM: debug description is catchall: 0104 0006 01 01 0140 00 8911 01 00 0000 00 00
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:32:53 AM: debug Parse returned [:]
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:32:53 AM: info presstime: 1501515173466
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:32:53 AM: debug Button was value : press
e35fbafc-1a2f-4367-828f-0642cd6329f7 11:32:53 AM: debug description is catchall: 0104 0006 01 01 0140 00 8911 01 00 0000 01 00

I then copied the Zigbee button device handler from SmartThings Community in GitHub. I have disabled the checking of timeDiff and it now works every press. The issue is that device handler can not use stateAtomic which the state is allowed. However, the state will only be saved after app exists.

In the ZIGBEE BUTTON Device handler line 224: It was changed from:

OLD: if (timeDiff > 10000) { //timeDiff>10sec check for refresh sending release value causing actions to be executed

NEW: if (false && (timeDiff > 10000)) { //timeDiff>10sec check for refresh sending release value causing actions to be executed

I am now very happy with Iris button as it works everytime now. Anyone reported this issue before?

Thanks.