When the on/off commands are issued, I am using the rattr command to send 00 or 01, but on my side instead of responding to read attribute , I am using it as a command because I can’t get “st cmd” to work. During the join process, I get the address requests, active endpoint requests and simple descriptor requests and respond to them, the device joins and is identified correctly. But when I try and use the “st cmd” I don’t have any packets show up.
capability "Switch"
attribute "switch", "string"
attribute "switch2", "string"
attribute "switch8", "string"
attribute "switch5", "string"
attribute "switch3", "string"
attribute "switch4", "string"
attribute "switch6", "string"
attribute "switch7", "string"
attribute "status", "string"
command "on"
command "off"
command "z2on"
command "z2off"
command "z3on"
command "z3off"
command "z4on"
command "z4off"
command "z5on"
command "z5off"
command "z6on"
command "z6off"
command "z7on"
command "z7off"
command "z8on"
command "z8off"
fingerprint endpointId: "5", profileId: "0104", deviceId: "2222", deviceVersion: "00", inClusters: "0006"
fingerprint endpointId: "4", profileId: "0104", deviceId: "2222", deviceVersion: "00", inClusters: "0006"
fingerprint endpointId: "A", profileId: "0104", deviceId: "2222", deviceVersion: "00", inClusters: "0006"
fingerprint endpointId: "6", profileId: "0104", deviceId: "2222", deviceVersion: "00", inClusters: "0006"
fingerprint endpointId: "D", profileId: "0104", deviceId: "2222", deviceVersion: "00", inClusters: "0006"
fingerprint endpointId: "8", profileId: "0104", deviceId: "2222", deviceVersion: "00", inClusters: "0006"
fingerprint endpointId: "9", profileId: "0104", deviceId: "2222", deviceVersion: "00", inClusters: "0006"
fingerprint endpointId: "C", profileId: "0104", deviceId: "2222", deviceVersion: "00", inClusters: "0006"
}
// simulator metadata
simulator {
// status messages
// reply messages
}
// UI tile definitions
tiles {
standardTile("status", "device.status") {
state "off", label: '1', icon: "st.valves.water.closed"
state "on", label: '1', icon: "st.valves.water.open"
state "z2off", label: '2', icon: "st.valves.water.closed"
state "z2on", label: '2', icon: "st.valves.water.open"
state "z3off", label: '3', icon: "st.valves.water.closed"
state "z3on", label: '3', icon: "st.valves.water.open"
state "z4off", label: '4', icon: "st.valves.water.closed"
state "z4on", label: '4', icon: "st.valves.water.open"
state "z5off", label: '5', icon: "st.valves.water.closed"
state "z5on", label: '5', icon: "st.valves.water.open"
state "z6off", label: '6', icon: "st.valves.water.closed"
state "z6on", label: '6', icon: "st.valves.water.open"
state "z7off", label: '7', icon: "st.valves.water.closed"
state "z7on", label: '7', icon: "st.valves.water.open"
state "z8off", label: '8', icon: "st.valves.water.closed"
state "z8on", label: '8', icon: "st.valves.water.open"
}
standardTile("switch", "device.switch") {
state "off", label: '1', action: "switch.on", icon: "st.valves.water.closed"
state "on", label: '1', action: "switch.off", icon: "st.valves.water.open" }
standardTile("switch2", "device.switch2") {
state "z2off", label: '2', action: "z2on", icon: "st.valves.water.closed"
state "z2on", label: '2', action: "z2off", icon: "st.valves.water.open" }
standardTile("switch3", "device.switch3", inactiveLabel: false) {
state "z3off", label: '3', action: "z3on", icon: "st.valves.water.closed"
state "z3on", label: '3', action: "z3off", icon: "st.valves.water.open"
}
standardTile("switch4", "device.switch4", inactiveLabel: false) {
state "z4off", label: '4', action: "z4on", icon: "st.valves.water.closed"
state "z4on", label: '4', action: "z4off", icon: "st.valves.water.open" }
standardTile("switch5", "device.switch5", inactiveLabel: false) {
state "z5off", label: '5', action: "z5on", icon: "st.valves.water.closed"
state "z5on", label: '5', action: "z5off", icon: "st.valves.water.open" }
standardTile("switch6", "device.switch6", inactiveLabel: false) {
state "z6off", label: '6', action: "z6on", icon: "st.valves.water.closed"
state "z6on", label: '6', action: "z6off", icon: "st.valves.water.open" }
standardTile("switch7", "device.switch7", inactiveLabel: false) {
state "z7off", label: '7', action: "z7on", icon: "st.valves.water.closed"
state "z7on", label: '7', action: "z7off", icon: "st.valves.water.open" }
standardTile("switch8", "device.switch8", inactiveLabel: false) {
state "z8off", label: '8', action: "z8on", icon: "st.valves.water.closed"
state "z8on", label: '8', action: "z8off", icon: "st.valves.water.open" }
main (["status","switch","switch2","switch3","switch4","switch5","switch6","switch7","switch8"])
details(["status","switch","switch2","switch3","switch4","switch5","switch6","switch7","switch8"])
}
}
// Parse incoming device messages to generate events
def parse(String description) {
log.debug "Parse description $description"
def msg = zigbee.parse(description)
log.trace "catchall: $msg"
log.debug zigbee.parse(description)?.sourceEndpoint
log.debug zigbee.parse(description)?.text
def EP = zigbee.parse(description)?.sourceEndpoint
def name = (EP == 4) ? "switch" : (EP == 12) ? "switch2" : (EP == 6) ? "switch3" : (EP == 8) ? "switch4" : (EP == 9) ? "switch5" : (EP == 10) ? "switch6" : (EP == 5) ? "switch7" : (EP == 13) ? "switch8" : null
def set = zigbee.parse(description)?.text
def value = ((EP == 4) && (set in ["01"])) ? "on" : ((EP == 4) && (set in ["00"])) ? "off" : ((EP == 12) && (set in ["01"])) ? "z2on" : ((EP == 12) && (set in ["00"])) ? "z2off" : ((EP == 6) && (set in ["01"])) ? "z3on" : ((EP == 6) && (set in ["00"])) ? "z3off" : ((EP == 8) && (set in ["01"])) ? "z4on" : ((EP ==8) && (set in ["00"])) ? "z4off" : ((EP == 9) && (set in ["01"])) ? "z5on" : ((EP == 9) && (set in ["00"])) ? "z5off": ((EP == 10) && (set in ["01"])) ? "z6on" : ((EP == 10) && (set in ["00"])) ? "z6off" : ((EP == 5) && (set in ["01"])) ? "z7on" : ((EP == 5) && (set in ["00"])) ? "z7off" : ((EP == 13) && (set in ["01"])) ? "z8on" : ((EP == 13) && (set in ["00"])) ? "z8off" : null
log.debug(value)
def result = createEvent(name: name, value: value, isStateChange: true, display: true)
log.debug "Parse returned ${result}"
return result
}
def status(value){
sendEvent(name: "status", value: value)
}
// Commands to device
def on() {
sendEvent(name: "status", value: "on")
"st rattr 0x${device.deviceNetworkId} 4 6 0x01"
//"st cmd 0x${device.deviceNetworkId} 4 6 0x00 {}"
//"st cmd 0x${device.deviceNetworkId} 4 6 0 {}"
}
def off() {
//'zcl on-off off'
sendEvent(name: "status", value: "off")
"st rattr 0x${device.deviceNetworkId} 4 6 0x00"
//"st wattr 0x${device.deviceNetworkId} 1 0xB04 0x12"
}
def z2on() {
sendEvent(name: "status", value: "z2on")
"st rattr 0x${device.deviceNetworkId} 12 6 0x01"
}
def z2off() {
sendEvent(name: "status", value: "z2off")
"st rattr 0x${device.deviceNetworkId} 12 6 0x00"
}