Hello there As I mentioned above I have tried this code 00010201000100 but it does not work for me. It only activates me with the code: 00010101000100 the first Gang. The second Gang is not remotely activated. I also modified the code but did not get a satisfactory result. I'll show you:
metadata {
definition (name: "MOES ZigBee Dimmer V.1.0", namespace: "CPS Smart Home", author: "Christos Psaroudis") {
capability "Actuator"
capability "PushableButton"
capability "Configuration"
capability "Refresh"
capability "Sensor"
capability "Switch"
capability "Switch Level"
command "on"
command "off"
command "on1"
command "off1"
command "on2"
command "off2"
fingerprint profileId: "0104", deviceId: "808F", inClusters: "0000,0004,0005,EF00", outClusters: "0019,000A", manufacturer: "_TZE200_9i9dt8is", model: "TS0601", deviceJoinName: "WorksWith Dimmer"
}
tiles(scale: 2) {
multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true) {
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#79b821", nextState:"turningOff"
attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#79b821", nextState:"turningOff"
attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
}
tileAttribute ("device.level", key: "SLIDER_CONTROL") {
attributeState "level", action:"switch level.setLevel"
}
}
standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
}
main "switch"
details(["switch", "refresh"])
}
}
// Parse incoming device messages to generate events
def parse(String description) {
Map map = [:]
//def event = zigbee.getEvent(description)
if (description?.startsWith('catchall:')) {
log.debug description
// call parseCatchAllMessage to parse the catchall message received
map = parseCatchAllMessage(description)
if (map != [:]) {
log.debug "ok send event: $map.name $map.value"
sendEvent(name: map.name, value: map.value)
}
}
else {
log.warn "DID NOT PARSE MESSAGE for description : $description"
}
}
def off() {
log.debug "called off"
zigbee.command(0xEF00, 0x0, "000101010001000201000100") //TODO
}
def off1() {
log.debug "called off1"
zigbee.command(0xEF00, 0x0, "00010101000100")
}
def off2() {
log.debug "called off2"
zigbee.command(0xEF00, 0x0, "00010201000100") //TODO
}
def on() {
log.debug "called on"
zigbee.command(0xEF00, 0x0, "000101010001010201000101") //TODO
}
def on1() {
log.debug "called on1"
zigbee.command(0xEF00, 0x0, "00010101000101")
}
def on2() {
log.debug "called on2"
zigbee.command(0xEF00, 0x0, "00010201000101") //TODO
}
def setLevel(value) {
log.debug "called setLevel with value $value"
if (value >= 0 && value <= 100) {
//String commandValue = "0001020200040000" + zigbee.convertToHexString((value * 10) as Integer, 4)
Map commandParams = [:]
String commandPayload = "0001020200040000" + zigbee.convertToHexString((value * 10) as Integer, 4)
zigbee.command(0xEF00, 0x0, commandPayload)
}
}
def refresh() {
log.debug "called refresh"
zigbee.command(0xEF00, 0x0, "00020100")
//pauseExecution(1000)
//zigbee.command(0xEF00, 0x0, "0002020200")
}
def configure() {
log.debug "Configuring Reporting and Bindings."
zigbee.onOffConfig() + zigbee.levelConfig() + zigbee.onOffRefresh() + zigbee.levelRefresh()
}
private Map parseCatchAllMessage(String description) {
// Create a map from the raw zigbee message to make parsing more intuitive
def msg = zigbee.parse(description)
Map result = [:]
switch(msg.clusterId) {
case 0xEF00:
def attribute = getAttribute(msg.data)
def value = getAttributeValue(msg.data)
switch (attribute) {
case "switch":
switch(value) {
case 0:
result = [
name: 'switch',
value: 'off',
data: [buttonNumber: 1],
descriptionText: "$device.displayName button was pressed",
isStateChange: true
]
break;
case 1:
result = [
name: 'switch',
value: 'on',
data: [buttonNumber: 1],
descriptionText: "$device.displayName button was pressed",
isStateChange: true
]
break;
}
break;
case "level":
int levelValue = value / 10
result = [
name: 'level',
value: levelValue + "%",
data: [buttonNumber: 1],
descriptionText: "$device.displayName level was modified",
isStateChange: true
]
break;
}
break;
}
return result
}
private String getAttribute(ArrayList _data) {
String retValue = ""
if (_data.size() >= 5) {
if (_data[2] == 1 && _data[3] == 1 && _data[4] == 0) {
retValue = "switch"
}
else if (_data[2] == 2 && _data[3] == 2 && _data[4] == 0) {
retValue = "level"
}
}
return retValue
}
private int getAttributeValue(ArrayList _data) {
int retValue = 0
if (_data.size() >= 6) {
int dataLength = _data[5] as Integer
int power = 1;
for (i in dataLength..1) {
retValue = retValue + power * _data[i+5]
power = power * 256
}
}
return retValue
}
I'm not sure what's wrong with it or how to correct it.
My device: https://cdn.alzashop.com/ImgW.ashx?fd=f16&cd=Szyslk005
In any case, thanks in advance.