-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzigbeeTools.zigbeeToolsBasicZigbeeBulbDriver.groovy
64 lines (51 loc) · 2.7 KB
/
zigbeeTools.zigbeeToolsBasicZigbeeBulbDriver.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import groovy.transform.Field
#include zigbeeTools.parsePlus
#include zigbeeTools.sendZigbeeAdvancedCommands
#include zigbeeTools.globalDataTools
#include zigbeeTools.endpointAndChildDeviceTools
#include zigbeeTools.commonClusterProcessing
#include zigbeeTools.commonDriverMethods
#include zigbeeTools.zigbeeZDOProfile0x0000
// The following libraries are included depending on what the device is.
// You should be able to simply include them all if you wish (the code will be a little longer, but it should not have any material impact on performance.
// #include zigbeeTools.identifyCluster0x0003
#include zigbeeTools.groupCluster0x0004
#include zigbeeTools.OnOffCluster0x0006
// #include zigbeeTools.switchConfiguration0x0007
#include zigbeeTools.levelCluster0x0008
// #include zigbeeTools.ColorCluster0x0300
metadata {
definition (name: "zigbeeTools Basic Zigbee Bulb Driver", namespace: "zigbeeTools", author: "James Mahon") {
capability "Actuator"
capability "Configuration"
capability "Initialize"
capability "Refresh"
capability "PowerSource"
capability "Switch"
capability "SwitchLevel"
capability "Bulb"
// capability "Color Temperature"
// capability "ColorControl"
// capability "ColorMode"
command "updateFirmware"
attribute "OnOffTransitionTime", "number"
attribute "OnTransitionTime", "number"
attribute "OffTransitionTime", "number"
// attribute "colorCapabilities", "string"
command "addNewChildDevice", [[name:"Device Name*", type:"STRING"],
[name:"componentDriverName*",type:"ENUM", constraints:(getDriverChoices()) ],
[name:"Endpoint*",type:"STRING", description:"Endpoint HEX String, Use 00 for root (parent) device" ] ]
command "setClusterAttribute", [ [name:"clusterId*", type:"STRING"],
[name:"attributeId*", type:"STRING"],
[name:"hexValue*", type:"STRING"] ]
command "readClusterAttribute", [ [name:"clusterId*", type:"STRING"],
[name:"attributeId*", type:"STRING"] ]
}
preferences {
input(name:"logEnable", type:"bool", title:"Enable debug logging", defaultValue:false)
input(name:"txtEnable", type:"bool", title:"Enable descriptionText logging", defaultValue:true)
input(name:"refreshEnable", type:"bool", title:"Refresh Status on Hubitat Startup", defaultValue:true)
// input(name:"useOnOffTimer", type:"bool", title:"Use Timer to Turn off after set time", defaultvalue:false)
// if (useOnOffTimer) input(name:"offTime", type:"number", title:"Turn Off After This Many Seconds:", defaultValue:300)
}
}