[OBSOLETE] ZWN-SC7 Enerwave 7 Button Scene Controller

@tgauchat I’ve been slowly learning git too!

I’ve posted 1.01 version of my device type to git. This device type seems to work much better. Before it was either button 1 or button 2-7 working properly. Now buttons 1-7 all work every time (for me).

Onto Use Button As PIN Input, I’m seeing now that it recognizes double button pushes many times when it’s not. I’m still not convinced this isn’t related to the device type because I can see double z-wave commands on button presses.

This is logs from the z-wave device type

 12:55:13 PM: debug Button 3 repeat 0x 1419447313466
 12:55:13 PM: debug Parsing 'zw device: 43, command: 2B01, payload: 03 FF '
 12:55:13 PM: debug Parsing 'zw device: 43, command: 2B01, payload: 03 FF '
 12:55:11 PM: debug Parsing 'zw device: 43, command: 2B01, payload: 02 FF '
 12:55:11 PM: debug Parsing 'zw device: 43, command: 2B01, payload: 02 FF '
 12:55:09 PM: debug Button 1 repeat 0x 1419447309873
 12:55:09 PM: debug Parsing 'zw device: 43, command: 2B01, payload: 01 FF '
 12:55:09 PM: debug Parsing 'zw device: 43, command: 2B01, payload: 01 FF ' ' 

This is the same log from the Use Button As Pin Input SmartApp

12:55:13 PM: debug "Use Buttons As PIN Input".("Use Buttons As PIN Input"): buttonEvent Device: [Z-Wave Controller], Name: [button], Value: [button 3], Data: [{"buttonNumber":3}], ButtonNumber: [3]
12:55:12 PM: debug "Use Buttons As PIN Input".("Use Buttons As PIN Input"): buttonEvent Device: [Z-Wave Controller], Name: [button], Value: [button 2], Data: [{"buttonNumber":2}], ButtonNumber: [2]
12:55:12 PM: debug "Use Buttons As PIN Input".("Use Buttons As PIN Input"): buttonEvent Device: [Z-Wave Controller], Name: [button], Value: [button 2], Data: [{"buttonNumber":2}], ButtonNumber: [2]
12:55:09 PM: debug "Use Buttons As PIN Input".("Use Buttons As PIN Input"): buttonEvent Device: [Z-Wave Controller], Name: [button], Value: [button 1], Data: [{"buttonNumber":1}], ButtonNumber: [1]
12:54:50 PM: debug "Use Buttons As PIN Input".("Use Buttons As PIN Input"): Initialized - state: [inputDigitsList:[], pinLength:3, pinSeqList:[1, 2, 3]]
12:54:49 PM: trace button from Z-Wave Controller was provided with buttonEvent...creating subscription
12:54:49 PM: trace Use Buttons As PIN Input is attempting to unsubscribe from all events
12:54:49 PM: debug "Use Buttons As PIN Input".("Use Buttons As PIN Input"): Updated; settings: [buttonDevice:Z-Wave Controller, pinLength:3, switches:Office Hue, comb_3:3, comb_2:2, comb_1:1]
12:54:49 PM: trace "Use Buttons As PIN Input".("Use Buttons As PIN Input"): Updated; Version: v0.1.0-beta+005
1 Like

Hi @mattjfrank … Merry Christmas!

Thanks for the detailed debug output; I think I know what’s going on, and I’ve pushed a hotfix for you to test at your convenience (no rush at all!!!).

There are various random changes in this branch, but the change related to the Enerwave is at line 242:

    + /**
    +     Aeon Minimote returns "pushed" or "held". Enerwave 7 (by @mattjfrank) returns "button #"
    +     Yes ... the Device Handlers *should* be reconciled someday:
    +       I think "held" is nonsense and Minimote should just use buttonNumber 5 to 8 for helds.
    + */
    + if(value == "pushed" || value[0..5] == "button") {
    - if(value == "pushed") {

Note: The alternative fix would be at your end instead; Change line ~96 (but, of course, that could break something in your SmartApp, though I could help resolve that if we go in this alternative fix direction. No biggie).

 -  result << createEvent(name: "button", value: /*"pushed"*/ "button $button", data: [buttonNumber: button], descriptionText: "$device.displayName button $button was pushed", isStateChange: true)
 +  result << createEvent(name: "button", value: "pushed", data: [buttonNumber: button], descriptionText: "$device.displayName button $button was pushed", isStateChange: true)

Anyhow; the test version v0.1.1-beta+004 of this SmartApp should be “live” in the IDE (with log.debug on); and/or you can copy it from this GitHub branch/tag:

VERSION TAG OBSOLETED: was [github.com/CosmicPuppy/SmartThings-ButtonsAsPIN/blob/v0.1.1-beta%2B004%2Bunstable/ButtonsAsPIN.app.groovy]

Thanks!
…CP/Terry.

Yup @tgauchat those changes made it work.

I just realized something, maybe you intended it this way. But you can install this app over and over for the same device so you can have different key combinations to do different things.

Since getting my ZWN-SC7 working, I haven’t installed it yet because I was nervous that someone could hit a button by accident to put my house into a mode I didn’t want. Rather than the SmartApp I modified to do a action with each button. I can use your SmartApp to do even more! Bravo!

Every time I read a negative post about SmartThings right or wrong, I always think ST would be nothing w/out the community. although faster IDE, better documentation, more reliable cloud would take it over the top no other Home Automation System can compete with the single best thing about SmartThings, Community Development!

1 Like

Yup… I totally intended that! :wink: … Well, I came to that same realization sometime in the past few days when I added the “Assign a name to this SmartApp?” preference. I will update the Forum post and/or readme to make this feature! more obvious.


Number of Buttons

Next on my feature and testing list is supporting more than 4 buttons as choices in the PIN sequence. Looks like your Device Handler reports buttons in attribute numButtons. The current Aeon Minimote does not have this attribute, but I added it to an experimental personal copy.

So… I’ve pushed another development beta, this one reads and uses numButtons … you should see choices 1-7 in the pulldown for each sequence slot … if the code is working properly. I simulated the numButtons attribute, but can’t test more than 4 buttons.

I have updated the shared version in the IDE, or grab the code from GitHub below (not from master):
(v0.1.2-beta+002+unstable)

https://github.com/CosmicPuppy/SmartThings-ButtonsAsPIN/blob/v0.1.2-beta%2B002%2Bunstable/ButtonsAsPIN.app.groovy

Page 2 where you select the pin is blank both in the simulator and in the ST app.

EDITED:
I just found and fixed at least one typo in the relevant code. I will save the update (it should be in IDE Shared SmartApps momentarily).

Line 134 should be: } else if (numButtonsString.toInteger > 9) {


OLD comment (but Live Logging still relevant as/if needed, of course …

Ah… The means there’s probably a fatal error where I’m trying to read the numButtons property. Could be a datatype conversion, null value, or a syntax error. I need to learn to do better error handling in Groovy.

But in the meantime…
Would you please check Live Logging sometime? Refresh to clear the log screen before you attempt the App configuration. It will include the Groovy/Java error message (if any), though these are pretty cryptic. Wish the IDE had a runtime debugger!

https://graph.api.smartthings.com/ide/logs


Thanks!
…CP/Terry.

Still getting error in logs about line 134. I don’t have it in front of me but can get it if you need.

(offlined debugging discussion to Private Message)

I got one of these from Santa. I’m a little confused on the status of this device.

Can someone kindly summarize?

@beckwith It is working see post #4

1 Like

Updated Post #4 with alternate SmartApp use with the device type.

1 Like

How does of work with the initial mission do they work with the rms2? Can you control both loads seperately?

Yes, you can control any ST connected device or mode.

I got mine hooked up. Took a few attempts to get it paired completely, but I think that is an issue with my hub. I have over 135 devices and it seems I have to reboot the hub before adding devices or it gets a Z-Wave Uart error.

Is there anyway to use “button held” like the mimoMote so we can have 14 scenes?

Thanks for sharing!

@beckwith, You have made my day!! I sure hope you or @mattjfrank can figure that out!

@beckwith I don’t think the devices support any variation of held. I can’t find any information saying they do or other devices with similar command class so that I could test if they do. You can however use @tgauchat’s app to setup numerous key combo’s so the device could support more than 7 actions.

I do think held would be nice though, and cleaner then using combo’s for simple actions. However the 7 button controller is still in my opinion the best bang for your buck in wall mounted multi button devices.

1 Like

I noticed it flashes like the Minimote and assumed this was a characteristic of a button held capability.

I wonder if double tap could be used.

Regardless, I agree that seven buttons for this price is an excellent value.

1 Like

@mattjfrank - Thanks for the promo.

@beckwith - I’m looking forward to various perspectives and ideas regarding the “PIN” (or multi-ket setting number… ) app I wrote, so appreciate your questions and feedback. Private message is best if off topic.

If “sequence as button” becomes a popular use case, perhaps there will be a way eventually to design that instead of requiring an App instance for each PIN.

(Major pain with SmartThings in general is that all connected SmartApps need to be uninstalled before you can remove a Device.)

The large button could be used as a ‘shift key’.

1 Like

Hi Cody: Is the “shift key” an inherent hardware feature in the Enerwave Controller (like the “Held Key” is implemented in hardware on the Minimote)?

If so, then the Device Handler should see different button numbers.

If it is not implemented in hardware, then an alternative Controller SmartApp could, indeed, check for key sequences that start with the big-button followed by a normal button, and tie events to these additional 6 “shifted” keys.

…Terry.