Anyone with experience on this function?
Does it work? Is it helpful in real life when you include something that is not close to the hub under the inclusion time?
Regards
Anyone with experience on this function?
Does it work? Is it helpful in real life when you include something that is not close to the hub under the inclusion time?
Regards
@einars I just try the script from :
/**
- Copyright 2015 SmartThings
- Licensed under the Apache License, Version 2.0 (the âLicenseâ); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
- on an âAS ISâ BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
- for the specific language governing permissions and limitations under the License.
- ===== Nodon Octan =====
- Modified for NodOn Octan Remote (CRC-3-1-0x) by Richard_Woodward
- Octan supports 4 actions per button Pushed
Double Tap
Held
Hold Released
- v1.01 Updated to support all 16 actions:
- As Smartlighting can only support type âPushedâ or âHoldâ events the extra 4 functions have been mapped to
- fictional buttons 5 through 8.
- Button 1 double Tap is mapped to âButton 5 Pushedâ in smartlighting
- Button 1 Hold Release is mapped to âButton 5 Holdâ in smarlighting
- .
- Button 4 double Tap is mapped to âButton 8 Pushedâ in Smartlighting
- Button 4 Hold Rlease is mapped to âButton 8 Holdâ in Smartlighting
*/
metadata {
definition (name: âNodon Octanâ, namespace: âsmartthingsâ, author: âSmartThingsâ) {
capability âActuatorâ
capability âButtonâ
capability âHoldable Buttonâ
capability âConfigurationâ
capability âSensorâ
capability âBatteryâ
fingerprint deviceId: "0x0101", inClusters: "0x86,0x72,0x70,0x80,0x84,0x85"
}
simulator {
status âbutton 1 pushedâ: âcommand: 2001, payload: 01â
status âbutton 1 heldâ: âcommand: 2001, payload: 15â
status âbutton 2 pushedâ: âcommand: 2001, payload: 29â
status âbutton 2 heldâ: âcommand: 2001, payload: 3Dâ
status âbutton 3 pushedâ: âcommand: 2001, payload: 51â
status âbutton 3 heldâ: âcommand: 2001, payload: 65â
status âbutton 4 pushedâ: âcommand: 2001, payload: 79â
status âbutton 4 heldâ: âcommand: 2001, payload: 8Dâ
status âwakeupâ: âcommand: 8407, payload: "
}
tiles {
standardTile(âbuttonâ, âdevice.buttonâ, width: 2, height: 2) {
state âdefaultâ, label: ââ, icon: âst.unknown.zwave.remote-controllerâ, backgroundColor: â#ffffffâ
state âbutton 1 pushedâ, label: âpushed #1â, icon: âst.unknown.zwave.remote-controllerâ, backgroundColor: â#79b821â
state âbutton 2 pushedâ, label: âpushed #2â, icon: âst.unknown.zwave.remote-controllerâ, backgroundColor: â#79b821â
state âbutton 3 pushedâ, label: âpushed #3â, icon: âst.unknown.zwave.remote-controllerâ, backgroundColor: â#79b821â
state âbutton 4 pushedâ, label: âpushed #4â, icon: âst.unknown.zwave.remote-controllerâ, backgroundColor: â#79b821â
state âbutton 1 heldâ, label: âheld #1â, icon: âst.unknown.zwave.remote-controllerâ, backgroundColor: â#ffa81eâ
state âbutton 2 heldâ, label: âheld #2â, icon: âst.unknown.zwave.remote-controllerâ, backgroundColor: â#ffa81eâ
state âbutton 3 heldâ, label: âheld #3â, icon: âst.unknown.zwave.remote-controllerâ, backgroundColor: â#ffa81eâ
state âbutton 4 heldâ, label: âheld #4â, icon: âst.unknown.zwave.remote-controllerâ, backgroundColor: â#ffa81eâ
}
valueTile(âbatteryâ, âdevice.batteryâ, inactiveLabel: false, decoration: âflatâ) {
state âbatteryâ, label:â${currentValue}% batteryâ, unit:â"
}
main âbuttonâ
details([âbuttonâ, âbatteryâ])
}
}
def parse(String description) {
def results =
if (description.startsWith(âErrâ)) {
results = createEvent(descriptionText:description, displayed:true)
} else {
def cmd = zwave.parse(description, [0x80: 1, 0x84: 1])
//log.debug(âcmd=$cmdâ)
if(cmd) results += zwaveEvent(cmd)
if(!results) results = [ descriptionText: cmd, displayed: false ]
}
//log.debug(âParsed â$descriptionâ to $resultsâ)
return results
}
def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd) {
def results = [createEvent(descriptionText: â$device.displayName woke upâ, isStateChange: false)]
def prevBattery = device.currentState(âbatteryâ)
if (!prevBattery || (new Date().time - prevBattery.date.time)/60000 >= 60 * 53) {
results << response(zwave.batteryV1.batteryGet().format())
log.debug(" read battery")
}
results += configurationCmds().collect{ response(it) }
results << response(zwave.wakeUpV1.wakeUpNoMoreInformation().format())
return results
}
def buttonEvent(button, held) {
button = button as Integer
held = held as Integer
//log.debug(âbutton=$button Held=$heldâ)
if( held == 1) {
def ebutton = button +4
createEvent(name: âbuttonâ, value: âheldâ, data: [buttonNumber: ebutton], descriptionText: â$device.displayName button $ebutton was pushedâ, isStateChange: true)
}
else if (held == 2) {
createEvent(name: âbuttonâ, value: âheldâ, data: [buttonNumber: button], descriptionText: â$device.displayName button $button was heldâ, isStateChange: true)
}
else if (held==3) {
def ebutton = button +4
createEvent(name: âbuttonâ, value: âpushedâ, data: [buttonNumber: ebutton], descriptionText: â$device.displayName button $ebutton was pushedâ, isStateChange: true)
}
else if (held == 0) {
createEvent(name: âbuttonâ, value: âpushedâ, data: [buttonNumber: button], descriptionText: â$device.displayName button $button was pushedâ, isStateChange: true)
}
}
def zwaveEvent(physicalgraph.zwave.commands.sceneactivationv1.SceneActivationSet cmd) {
Integer button = (cmd.sceneId / 10) as Integer
Integer held = cmd.sceneId - (button*10) as Integer
buttonEvent(button, held)
}
def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
def map = [ name: âbatteryâ, unit: â%â ]
if (cmd.batteryLevel == 0xFF) {
map.value = 1
map.descriptionText = â${device.displayName} has a low batteryâ
} else {
map.value = cmd.batteryLevel
}
createEvent(map)
}
def zwaveEvent(physicalgraph.zwave.Command cmd) {
[ descriptionText: â$device.displayName: $cmdâ, linkText:device.displayName, displayed: false ]
}
def configurationCmds() {
delayBetween([ zwave.configurationV1.configurationSet(parameterNumber: 250, scaledConfigurationValue: 1).format(),
// zwave.associationV1.associationSet(groupingIdentifier: 2, nodeId: zwaveHubNodeId).format(),
// zwave.associationV1.associationSet(groupingIdentifier: 3, nodeId: zwaveHubNodeId).format(),
// zwave.associationV1.associationSet(groupingIdentifier: 4, nodeId: zwaveHubNodeId).format(),
// zwave.associationV1.associationSet(groupingIdentifier: 5, nodeId: zwaveHubNodeId).format(),
zwave.configurationV1.configurationSet(configurationValue: [1], parameterNumber: 3, size: 1).format(),
zwave.configurationV1.configurationSet(configurationValue: [3], parameterNumber: 8, size: 1).format(),
zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:zwaveHubNodeId).format() ],500)
}
def configure() {
def cmd = configurationCmds()
//log.debug(âSending configuration: $cmdâ)
return cmd
}
def installed() {
initialize()
}
def updated() {
initialize()
}
def initialize() {
sendEvent(name: ânumberOfButtonsâ, value: 8)
log.debug(âSent numberOfButtons 8â)
}
Orginal here but miss the last } and I rename the handlers Device Nodon Octan =>
Add itâs work for me !
Cool, tried it and it works great for 8 buttons function.
Thx for tips.