Hubitat.uk - Now Cobra-Apps.co.uk - Now Open!

Sorry about that, you should have now received a mail from us. Let me know how it goes :+1:

Hi how you i have registered on the cobra website but no confirmation email is there any way you can assist

Hi, we have two different logins and emails for you.

Could you PM me the correct details, and I'll remove the other :+1:

Hi @Royski I see you on cobra apps is there any way you could assit with a driver code I am working on

I'm no coder, but could certainly have a look :+1:

thank you i got buttons to turn each switch on but that is it :frowning:

"metadata {
definition (name: "MOES switch", namespace: "test", author: "test") {

    command "on1"
    command "off1"
    command "on2"
    command "off2"
    command "on3"
    command "off3"
    capability "Configuration"
   
    command "lighton"
    command "lightoff"
    command "lightpos"
    command "stateon"
    command "stateoff"
    command "statepos"

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"
       
        }
    }
    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 off3() {
log.debug "called off1"
zigbee.command(0xEF00, 0x0, "00010101000100")
}

def off2() {
log.debug "called off2"
zigbee.command(0xEF00, 0x0, "00010201000100") //TODO
}

def off1() {
log.debug "called off3"
zigbee.command(0xEF00, 0x0, "00010301000100") //TODO

}

def on3() {
log.debug "called on1"
zigbee.command(0xEF00, 0x0, "00010101000101")
}

def on2() {
log.debug "called on2"
zigbee.command(0xEF00, 0x0, "00010201000101") //TODO
}

def on1() {
log.debug "called on3"
zigbee.command(0xEF00, 0x0, "00010301000101") //TODO
}

def lighton() {
log.debug "called indicate lights - on"
zigbee.command(0xEF00, 0x0, "00010f04000102")
}
def lightoff() {
log.debug "called indicate lights - off"
zigbee.command(0xEF00, 0x0, "00010f04000100")
}
def lightpos() {
log.debug "called indicate lights - position"
zigbee.command(0xEF00, 0x0, "00010f04000101")
}

def stateon() {
log.debug "called relay status - on"
zigbee.command(0xEF00, 0x0, "00010e04000101")
}
def stateoff() {
log.debug "called relay status - off"
zigbee.command(0xEF00, 0x0, "00010e04000100")
}
def statepos() {
log.debug "called relay status - last status"
zigbee.command(0xEF00, 0x0, "00010e04000102")

}
def configure() {
if (logEnable) log.debug "Configure"
zigbee.onOffConfig() + zigbee.onOffRefresh()
}
"

This section can go, it isn't supported,

What is the device you're trying to get this working with?

it is a tuya light switch

Ah ok which kind, I have several.

it is 3 gang zigbee

I'm almost certain that the generic zigbee version works with this?

I can support how this switches works. I sniffered this strange payloads on cluster 0xef00

1 Like

i have tried and nothing i think it because of the cluster inClusters: "0000,0004,0005,EF00"

Check this

1 Like

I have the double (very similar) branded Yagusmart, but effectively a Tuya in drag.

https://www.amazon.co.uk/Yagusmart-Neutral-Required-Compatible-Function/dp/B0812Z277R/ref=sr_1_3?crid=2RG01AB5Q4DYF&dchild=1&keywords=yagusmart&qid=1620409649&s=lighting&sprefix=Yagusmart%2Clighting%2C165&sr=1-3

Zigbee version, and it was picked up no problem, but as posted @martinkura, it doesn't look easy :expressionless:

All commands are send on the same endpoint=01 but different value

Have got this far with help from @martinkura but just can not finish It have no idea how to make into parent and child driver to controller each switch all I can do is switch on and of from the device page

These drivers are pretty good to go off for creating the child devices.
Look for the createChildDevices, and hopefully that may help a little?

Also a previous discussion on the parent child drivers.

Sorry its createChildDevices you want to look for in the Parent.

thanks let me try it

1 Like