I have a simple ZIgbee board that has two logical outputs. One at endpoint 1, the other at endpoint 2.
I've been struggling for days trying to get control of the outputs. I finally stumbled upon code that can control endpoint 2 only but I'm far away from understanding it or being able to read the status.
I've looked at over 6 different Zigbee device drivers and various documentation. It seems to me there are multiple approaches but I can't get a handle on a basic approach.
If anyone has a few lines of zigbee code showing the basics or direct me to a guide of some sort I would really appreciate it.
Thanks
John
// v00
metadata {
// Automatically generated. Make future change here.
definition (name: "ZigbeeTest", namespace: "johnrob", author: "johnrob") {
capability "Actuator"
capability "Sensor"
capability "Configuration"
capability "Refresh"
capability "Switch"
fingerprint profileId: "0104", inClusters: "0006", outClusters: "0006"
}
} // --- metadata ---
// Parse incoming device messages to generate events
def parse(String description) {
log.debug "Description= $description"
def name = null
def value = null
def zbc = zigbee.clusterLookup(0x0006)
log.debug "cluster=${zbc}" // <---- returns "ON_OFF_CLUSTER"
}
def off() {
def cmds = zigbee.off(200) // <---- works on led @ Endpoint 2
//zigbee.writeAttribute(0x0006, 0x0000,0x020, 0x01)
// zigbee.command(0x0006, 0x0001)
}
def on() {
def cmds = zigbee.on(200) // <---- works on led @ Endpoint 2
//zigbee.writeAttribute(0x0006, 0x0000,0x020, 0x01)
// zigbee.command(0x0006, 0x0001)
}
def refresh(){
def zbc = zigbee.clusterLookup(0x0006)
log.debug "cluster=${zbc}"
"st cmd 0x${device.deviceNetworkId} 0x${device.endpointId} 6 ${0x0001} {}"
}