I finally gave up on the built in driver and paired back the example RGBW zigbee dimmer.
The log shows this when using the built in driver:
dev:512018-11-17 02:32:20.535 pm infoBathroom Motion is active
dev:502018-11-17 02:32:16.220 pm debugParse: catchall: 0104 0008 01 01 0040 00 173D 00 00 0000 0B 01 0400
app:992018-11-17 02:32:16.089 pm infoBathroom Dimmer Day Turn On & Set Level
dev:512018-11-17 02:32:15.997 pm infoBathroom Motion is active
When I use my driver:
dev:502018-11-17 02:37:42.081 pm infoBathroom Dimmer is 100%
dev:502018-11-17 02:37:42.079 pm debugevt- rawValue:255, value: 100, descT: Bathroom Dimmer is 100%
dev:502018-11-17 02:37:42.065 pm debugparse description: read attr - raw: 173D0100080A000020FF, dni: 173D, endpoint: 01, cluster: 0008, size: 0A, attrId: 0000, encoding: 20, value: FF
dev:502018-11-17 02:37:41.874 pm infoBathroom Dimmer is on
dev:502018-11-17 02:37:41.872 pm debugevt- rawValue:1, value: on, descT: Bathroom Dimmer is on
dev:502018-11-17 02:37:41.868 pm debugparse description: read attr - raw: 173D0100060A00001001, dni: 173D, endpoint: 01, cluster: 0006, size: 0A, attrId: 0000, encoding: 10, value: 01
dev:502018-11-17 02:37:41.682 pm infoBathroom Dimmer was turned on
dev:502018-11-17 02:37:41.680 pm debugevt- rawValue:1, value: on, descT: Bathroom Dimmer was turned on
dev:502018-11-17 02:37:41.677 pm debugparse description: read attr - raw: 173D0100060800001001, dni: 173D, endpoint: 01, cluster: 0006, size: 08, attrId: 0000, encoding: 10, value: 01
dev:502018-11-17 02:37:41.667 pm debugparse description: catchall: 0104 0006 01 01 0040 00 173D 00 00 0000 0B 01 0100
dev:502018-11-17 02:37:41.463 pm debugparse description: catchall: 0104 0008 01 01 0040 00 173D 00 00 0000 0B 01 0400
app:992018-11-17 02:37:41.345 pm infoBathroom Dimmer Day Turn On & Set Level
dev:512018-11-17 02:37:41.250 pm infoBathroom Motion is active
I use this to set the level:
def setLevel(value,rate) {
rate = rate.toBigDecimal()
def scaledRate = (rate * 10).toInteger()
def cmd = []
def isOn = device.currentValue("switch") == "on"
value = (value.toInteger() * 2.55).toInteger()
if (isOn){
cmd = [
"he cmd 0x${device.deviceNetworkId} 0x${device.endpointId} 0x0008 4 {0x${intTo8bitUnsignedHex(value)} 0x${intTo16bitUnsignedHex(scaledRate)}}",
"delay ${(rate * 1000) + 400}",
"he rattr 0x${device.deviceNetworkId} 0x${device.endpointId} 0x0008 0 {}"
]
} else {
cmd = [
"he cmd 0x${device.deviceNetworkId} 0x${device.endpointId} 0x0008 4 {0x${intTo8bitUnsignedHex(value)} 0x0100}", "delay 200",
"he cmd 0x${device.deviceNetworkId} 0x${device.endpointId} 0x0006 1 {}", "delay 200",
"he rattr 0x${device.deviceNetworkId} 0x${device.endpointId} 0x0006 0 {}", "delay 200",
"he rattr 0x${device.deviceNetworkId} 0x${device.endpointId} 0x0008 0 {}"
]
}
return cmd
}
The above is the Hubitat example code with the added lines to also send an on command when the level is set and the dimmer is off.
@arnoud My dimmers have date codes 1705 and 1829
EDIT: Put the correct code in and added explanation.