Help with new DH for Aust 3 Gang light switch - catchall included

You have to carefully catch the catchall as u turn on and off endpoints 2 and 3.

And then update the relevant sections of the if else statements.

in the case of kudled, it returns different catchall, depending if the physical button was pressed or if the on/off was called from the app.

if ((descMap.command==“0B” && descMap.raw.endsWith(“0100”)) || (descMap.command==“01” && descMap.raw.endsWith(“1001”))){

        if (descMap.sourceEndpoint == "12") {   
			return	[type: "switch", value : "on"]
    	}
    	else if (descMap.sourceEndpoint == "11") {   
     		return	[type: "switch2", value : "on"]
    	}
    	else if (descMap.sourceEndpoint == "10") {   
 			return	[type: "switch3", value : "on"]
    	}

        
        

	}
	else if ((descMap.command=="0B" && descMap.raw.endsWith("0000")) || (descMap.command=="01" && descMap.raw.endsWith("1000"))){
		
	
		if (descMap.sourceEndpoint == "12") {   
			return	[type: "switch", value : "off"]
    	}
    	else if (descMap.sourceEndpoint == "11") {   
     		return	[type: "switch2", value : "off"]
    	}
    	else if (descMap.sourceEndpoint == "10") {   
 			return	[type: "switch3", value : "off"]
    	}
        
    }
   
    else if (descMap.command=="01" && descMap.raw.endsWith("2000")){
	
		if (descMap.sourceEndpoint == "12") {   
			return	[type: "switch", value : "off"]
    	}
    	else if (descMap.sourceEndpoint == "11") {   
     		return	[type: "switch2", value : "off"]
    	}
    	else if (descMap.sourceEndpoint == "10") {   
 			return	[type: "switch3", value : "off"]
    	}
    }
    else if (descMap.command=="01" && descMap.raw.endsWith("2001")){
	
		if (descMap.sourceEndpoint == "12") {   
			return	[type: "switch", value : "on"]
    	}
    	else if (descMap.sourceEndpoint == "11") {   
     		return	[type: "switch2", value : "on"]
    	}
    	else if (descMap.sourceEndpoint == "10") {   
 			return	[type: "switch3", value : "on"]
    	}

        
    
	}
1 Like