MHCOZY 4 Channel 12V ZigBee Relay Switch Flashing

I recently installed this device

It's "working" with the built in "Generic Zigbee Multi-Endpoint Switch" or the "Zemismart ZigBee Wall Switch Multi-Gang" by @kkossev.

Unfortunately when I turn any of the relays "on" the lights attached just flash on/off. I can also hear the relay clicking on/off, until I send the off command, and it stops.

Any thoughts on how I can get the relay to just stay on?

It comes broken out of the box?

These relay boards have an 'inching operation' mode - check whether you can change the mode using the mode switch button?

I've tried clicking the mode button. I've tried holding it down for a few seconds. I've tried holding the relay manual on/off button and clicking the mode button. None of them seem to work. Once I got it to switch to "momentary mode" where it turn on then went off and stayed off, but never to stay on.

What are the device model / manufacturer ID's ?

Also, when you paired it for the first time to your HE hub - which driver was selected automatically?

The first time I paired it, it came in as a "Device". After doing some digging I found your driver, and removed/readded it. Then it came in as the "Zemismart ZigBee Wall Switch Multi-Gang"

This device is mentioned here :

Change the driver 'Type' to the HE inbuilt default 'Device' driver, then click on the 'Get Info' button. I will need the fingerprint, as shown in the live logs. This device fingerprint is currently not in the Muxa's Zemismart driver.

dev:22482025-03-05 01:29:25.522 PM

info

fingerprint profileId:"0104", endpointId:"01", inClusters:"0003,0004,0005,0006,E000,E001,0000", outClusters:"0019,000A", model:"TS0004", manufacturer:"_TZ3000_u3oupgdy", controllerType: "ZGB"

dev:22482025-03-05 01:29:25.421 PM

trace

ZCL version:03

dev:22482025-03-05 01:29:25.418 PM

trace

Software Build Id:unknown

dev:22482025-03-05 01:29:25.415 PM

trace

Model:TS0004

dev:22482025-03-05 01:29:25.413 PM

trace

Manufacturer:_TZ3000_u3oupgdy

dev:22482025-03-05 01:29:25.316 PM

debug

getting info for unknown Zigbee device...

1 Like

See this link : Device recognized correctly but stange behaviour -> related to #18640 · Issue #19432 · Koenkk/zigbee2mqtt · GitHub

I found out it has as a fact to do with some configuration settings. Pressing specific two buttons on the device (button 4 and M), the device is in another mode now and reacts as expected.

You can update the Muxa's driver manually to ver. 1.1.5

https://raw.githubusercontent.com/kkossev/hubitat-muxa-fork/development/drivers/zemismart-zigbee-multigang-switch.groovy

or update through HPM.

Delete (REMOVE) the device, then pair it again to your hub.
Muxa's Zemismart ZigBee Wall Switch Multi-Gang driver must be selected automatically when paired as a new device.

Does it work now?
The difference with is that the 'Tuya Magic' initialization will be applied at the proper time when pairing the device for first time (as a new device).

Try pressing the button 4 and button M (simultaneously?) as well.

1 Like

Well it seems I've somehow disabled all the relays. If I send the on command or push the manual buttons the devices does nothing.

I did remove and readd the unit with the updated driver. It did find the unit as the "Zemismart ZigBee Wall Switch Multi-Gang" when it paired. Still it does not respond to button pushes or commands.

Hi Krassimir, Does Muxa's driver below, have the Tuya Magic applied? The keyfob paired initially, but fell off and won't pair again at all. Could a faulty initial pairing cause this symptom?

Summary

/**

  • Heiman ZigBee Key Fob
  • Device Driver for Hubitat Elevation hub
  • Version 0.1.1
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.

*/

metadata {
definition (name: "Heiman ZigBee Key Fob", namespace: "muxa", author: "Mikhail Diatchenko") {
capability "PushableButton"
capability "Battery"
capability "Configuration"

	fingerprint endpointId: "01", profileId: "0104", inClusters: "0000,0001,0003,0500", outClusters: "0003,0501", manufacturer: "HEIMAN", model: "RC-EM"
    fingerprint endpointId: "01", profileId: "0104", inClusters:"0000,0003,0500,0B05", outClusters:"0003,0019,0501", model:"ZB-KeyfodGeneric-D0001", manufacturer:"lk"
    
	command "resetBatteryReplacedDate"
    command "identify"
}

preferences {
	//Battery Voltage Range
	input name: "voltsmin", title: "Min Volts (0% battery = ___ volts, range 2.0 to 2.7). Default = 2.5 Volts", description: "", type: "decimal", range: "2..2.7"
	input name: "voltsmax", title: "Max Volts (100% battery = ___ volts, range 2.8 to 3.4). Default = 3.0 Volts", description: "", type: "decimal", range: "2.8..3.4"
	//Logging Message Config
	input name: "infoLogging", type: "bool", title: "Enable info message logging", description: ""
	input name: "debugLogging", type: "bool", title: "Enable debug message logging", description: ""
}

}

// Parse incoming device messages to generate events
def parse(String description) {
def descMap = zigbee.parseDescriptionAsMap(description)

displayDebugLog("descMap: ${descMap}")

def map = [:]
if (!descMap)
    return map

// Send message data to appropriate parsing function based on the type of report
if (descMap.clusterId == "0501") {
    map = parseButtonMessage(descMap.command, descMap.data)
} else if (cluster == "0001" & attrId == "0021")
	// Parse battery level from hourly announcement message
	map = parseBattery(descMap.value)
else 
	displayDebugLog("Unable to parse message")

if (map != [:]) {
    displayDebugLog("Creating event ${map}")
	return createEvent(map)
} else
	return [:]

}

private parseButtonMessage(command, data) {
def button = 0
def buttonName = ""
switch (command) {
case "00":
switch (data[0]) {
case "00":
button = 2
buttonName = "Disarm"
break
case "01":
button = 3
buttonName = "Arm Home"
break
case "03":
button = 1
buttonName = "Arm Away"
break
default:
log.warn "Unknown button: ${data[0]}"
return [:]
}
break
case "02":
// panic button
button = 4
buttonName = "Panic"
break
default:
log.warn "Unknown command: ${descMap.command}"
return [:]
}

displayInfoLog("${buttonName} button (${button}) pushed")
return [
    name: "pushed",
    value: button,
    isStateChange: true,
    descriptionText: "${buttonName} button pushed"
]

}

// Convert 2-byte hex string to voltage
// 0x0020 BatteryVoltage - The BatteryVoltage attribute is 8 bits in length and specifies the current actual (measured) battery voltage, in units of 100mV.
private parseBattery(valueHex) {
displayDebugLog("Battery parse string = ${valueHex}")
def rawVolts = hexStrToSignedInt(valueHex)/10
def minVolts = voltsmin ? voltsmin : 2.5
def maxVolts = voltsmax ? voltsmax : 3.0
def pct = (rawVolts - minVolts) / (maxVolts - minVolts)
def roundedPct = Math.min(100, Math.round(pct * 100))
def descText = "Battery level is ${roundedPct}% (${rawVolts} Volts)"
displayInfoLog(descText)
sendEvent(name: "batteryLevelLastReceived", value: new Date())
def result = [
name: 'battery',
value: roundedPct,
unit: "%",
isStateChange: true,
descriptionText: descText
]
return result
}

private def displayDebugLog(message) {
if (debugLogging) log.debug "${device.displayName}: ${message}"
}

private def displayInfoLog(message) {
if (infoLogging || state.prefsSetCount != 1)
log.info "${device.displayName}: ${message}"
}

//Reset the batteryLastReplaced date to current date
def resetBatteryReplacedDate(paired) {
def newlyPaired = paired ? " for newly paired sensor" : ""
sendEvent(name: "batteryLastReplaced", value: new Date())
displayInfoLog("Setting Battery Last Replaced to current date${newlyPaired}")
}

def identify() {
displayDebugLog("Sending Identify command to flash device light for 5 seconds")
return zigbee.command(0x0003, 0x00, "0500")
}

// installed() runs just after a sensor is paired
def installed() {
state.prefsSetCount = 0
displayInfoLog("Installing")
}

// configure() runs after installed() when a sensor is paired or reconnected
def configure() {
displayInfoLog("Configuring")
displayInfoLog("Number of buttons = 4")
init()
state.prefsSetCount = 1
return
}

// updated() runs every time user saves preferences
def updated() {
displayInfoLog("Updating preference settings")
init()
displayInfoLog("Info message logging enabled")
displayDebugLog("Debug message logging enabled")
}

def init() {
if (!device.currentState('batteryLastReplaced')?.value)
resetBatteryReplacedDate(true)
sendEvent(name: "numberOfButtons", value: 4)
}

Thanks for helping, but this thing is to much of a PITA. I'm going to return it and find another relay. I see Aeotec and Sonoff have similar units, maybe they will be better quality.

2 Likes

No, this driver and the Heiman keyfobs do not need any magic ... These keyfobs use the standard IAS cluster messaging. So the connectivity problem is elsewhere...

1 Like

Yes, its better to return it.. The eBay seller warning is also strange, usually the Tuya devices are working out of the box with the Tuya Zigbee hubs - no special updates must be required!

think Zooz also has good relays, but Z-wave tech

You should return it, but these relay are rock solid for me and I had no issue pairing them and I think you should stick with them. I have three 4-relay boards and a 2-relay board. They have never dropped off or missed a signal. One of the boards runs my heating zone valves to control my heat from virtual thermostats, and for two winters now they have just been 100% reliable.

I think mine even paired automatically with the generic component switch driver, just by hitting the Zigbee pairing button and doing nothing else, if I remember right.

I got mine on Amazon. There are many brands for this board, I don't think I even have any official MHCOZY branded boards, but they are all the same. Tons of them on Amazon.

@Rxich Yeah I have the Zooz ones and they have been solid, but I'm trying to get away from Z-wave and go all Zigbee. The Zooz relay are about the only z-wave devices I have left to replace.

@user2574 I wish I had better luck. I have 20 low voltage lighting zones to switch so having 4 channels per unit is a big plus. I bought 3 to test, so maybe I'll try one of the others and see if I just got a bad one. The warning posted on eBay seems odd thu.

The broken english doesn't help, but it seems to just be a warning about how it can have issues with the Tuya Zigbee hub via the Tuya phone app, if the Tuya hub is not updated to some level, but Tuya doesn't notify you about the hub needing to be updated to use the device. So they are just letting you know you many need to update your Tuya hub. That is my take on it.

Nothing to do with connecting it directly to Hubitat, though.

I can't speak for where the eBay ones are coming from, I have only bought mine on Amazon. Always been around $20. The last one I bought to make my Stove Fan smart was a Yitouniu with case. I've never tried the ones with temp sensors or remotes.

1 Like