Continuing the discussion from [Linear WA00Z1 Smart Light Switch Cover (US)]
Added a thread for you in the developers section. Folks here can probably give you the most help.
For those unfamiliar with it, this new device is basically a battery-operated two button wallmount Minimote. The idea is it fits over an existing light switch so you no longer have the problem of people turning off power to smart bulbs.
@ajpri has made a great start at a device handler, but would like some more help with it.
However, I am not sure if this will pair devices to the device type. When a button is pressed on the switch, it sends a wakeup, central scene notification, and battery life info.
Also, I got inverting buttons working, preference defined in line 61, and sent to device in line 107. The command being sent every time the device is woken up. Is this good or is there a better way? Feels like it could drain the battery.
Final point is on making the device type better - optimizing the code to be efficient, and the best it can be.
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
Gotta remember to come back to this one and try to help (or see if other’s have helped…).
ZigBee (EDIT: oops… Z-Wave! ref: @JDRoberts below…) pairing (and configuring) is still too complex, though SmartThings has added a bunch of new, mostly undocumented commands (so far), but very satisfying when you get it working. Like magic it seems.
Need some time to read this through and cross reference my meager knowledge so far and/or look up the experts to tag. Ah … @JohnR has been extremely helpful to me and others… but not sure if he is only ZigBee expert or also Z-Wave.
Why are you not sure if devices will pair to the device type? I was able to test my OSRAM switch that I am working on by removing it from ST, performing a reset, and re-connecting it to see if it would pair to the correct device type. I am looking to get at least one so when I do I can test but someone else will likely get to that before me.
As far as fingerprinting is going, my fingerprint is not auto-identifying. Messed around with it a few times, still showing up as “Z-wave Device”. Stressing me out a bit. Once I master fingerprinting, I’ll write a tool that takes the raw description and makes a fingerprint.
Technically only zigbee devices have fingerprints. But SmartThings uses the same term for zwave devices as well. (Zwave devices don’t have “clusters” either, but again SmartThings takes a Zigbee term and uses it for all protocols.)
Just wanted to mention it because it can lead to some confusion if you review outside resources.
This is the ST documentation on “fingerprinting” a Zwave device.
I will say that I found when I added manufacturer and model on mine it would not pair with the device type, leaving the manufacturer and model commented out worked for my OSRAM Dimmer Switch device type. I suspect you have to have these strings exactly as the device would report and I haven’t figured out how to get the manufacturer and model string from the device, I have not seen any messages at join that would indicate it either, wondering if not specifying it for mine works because the device doesn’t actually report it.
Personally I’ve never understood the fingerprinting. I’ve made some devices where it picks it up and matches it straight away, and others where it does not. No clue what seems to push it one way or the other!
@ajpri, I was looking at your fingerprint and wondering why you are not using all the published clusters? I know that @JDRoberts said that z-wave doesn’t use “clusters” but that is what ST calls them so that is what I will call them. When I look at the raw description the ‘f’ indicates that there should be 15 clusters and you are only using 6 of them. If I were to take the raw description the fingerprint I would come up with is below.
Glad you figured it out and got it working, my switch will be here in 3-4 days. Good to know that the 0xEF is the command class mark, the device type I wrote was a zigbee device type and for that it is slightly different, the first mark (after deviceID) says how many inClusters there are and then after those inClusters are defined the next mark says how many outClusters will be defined and then they are defined. Looks like for z-wave the first mark just defines the total number of clusters (command classes) and then the 0xEF mark defines the start of the outClusters.
I will be glad to help you test/refine the device type once I have mine if you still need help.
Just got mine and it paired easily with the device handler installed. Button pushes seem to work just fine. But can the device handler deal with longer button holds? In the manual that came with the GoControl switch it seems like it should be capable of both presses and holds. Thanks for sharing this!
Sweet! So it auto-identified correctly? Right now, the Handler only handles a press, but I believe it can handle a held event as well. I’ll take a look into it soon.
Soory about my slight absence from this project. As some of you may know, I’m just a High School Student, so I’ve been busy getting back from spring break. Also, I think I’m getting a bit under the weather. I’m good, just taking things easy. I hope to have a better code version uploaded soon (Milestone 4, estimating this weekend).