2 definition (name: "Aeon Minimote", namespace: "smartthings", author: "SmartThings") {
5 capability "Configuration"
7 attribute "numButtons", "STRING"
9 fingerprint deviceId: "0x0101", inClusters: "0x86,0x72,0x70,0x9B", outClusters: "0x26,0x2B"
10 fingerprint deviceId: "0x0101", inClusters: "0x86,0x72,0x70,0x9B,0x85,0x84", outClusters: "0x26" // old style with numbered buttons
14 status "button 1 pushed": "command: 2001, payload: 01"
15 status "button 1 held": "command: 2001, payload: 15"
16 status "button 2 pushed": "command: 2001, payload: 29"
17 status "button 2 held": "command: 2001, payload: 3D"
18 status "button 3 pushed": "command: 2001, payload: 51"
19 status "button 3 held": "command: 2001, payload: 65"
20 status "button 4 pushed": "command: 2001, payload: 79"
21 status "button 4 held": "command: 2001, payload: 8D"
22 status "wakeup": "command: 8407, payload: "
25 standardTile("button", "device.button", width: 2, height: 2) {
26 state "default", label: "", icon: "st.unknown.zwave.remote-controller", backgroundColor: "#ffffff"
28 // Configure button. Syncronize the device capabilities that the UI provides
29 standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat") {
30 state "configure", label:'', action:"configuration.configure", icon:"st.secondary.configure"
33 details(["button", "configure"])
37 def parse(String description) {
39 if (description.startsWith("Err")) {
40 results = createEvent(descriptionText:description, displayed:true)
42 def cmd = zwave.parse(description, [0x2B: 1, 0x80: 1, 0x84: 1])
43 if(cmd) results += zwaveEvent(cmd)
44 if(!results) results = [ descriptionText: cmd, displayed: false ]
46 // log.debug("Parsed '$description' to $results")
50 def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd) {
51 def results = [createEvent(descriptionText: "$device.displayName woke up", isStateChange: false)]
53 results += configurationCmds().collect{ response(it) }
54 results << response(zwave.wakeUpV1.wakeUpNoMoreInformation().format())
59 def buttonEvent(button, held) {
60 button = button as Integer
62 createEvent(name: "button", value: "held", data: [buttonNumber: button], descriptionText: "$device.displayName button $button was held", isStateChange: true)
64 createEvent(name: "button", value: "pushed", data: [buttonNumber: button], descriptionText: "$device.displayName button $button was pushed", isStateChange: true)
68 def zwaveEvent(physicalgraph.zwave.commands.sceneactivationv1.SceneActivationSet cmd) {
69 Integer button = ((cmd.sceneId + 1) / 2) as Integer
70 Boolean held = !(cmd.sceneId % 2)
71 buttonEvent(button, held)
74 def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd) {
75 Integer button = (cmd.value / 40 + 1) as Integer
76 Boolean held = (button * 40 - cmd.value) <= 20
77 buttonEvent(button, held)
80 def zwaveEvent(physicalgraph.zwave.Command cmd) {
81 [ descriptionText: "$device.displayName: $cmd", linkText:device.displayName, displayed: false ]
84 def configurationCmds() {
86 def hubId = zwaveHubNodeId
87 (1..4).each { button ->
88 cmds << zwave.configurationV1.configurationSet(parameterNumber: 240+button, scaledConfigurationValue: 1).format()
90 (1..4).each { button ->
91 cmds << zwave.configurationV1.configurationSet(parameterNumber: (button-1)*40, configurationValue: [hubId, (button-1)*40 + 1, 0, 0]).format()
92 cmds << zwave.configurationV1.configurationSet(parameterNumber: (button-1)*40 + 20, configurationValue: [hubId, (button-1)*40 + 21, 0, 0]).format()
98 // Set the number of buttons to 4
99 sendEvent(name: "numButtons", value: "4", displayed: false)
101 def cmds = configurationCmds()
102 log.debug("Sending configuration: $cmds")