pvvx / ZigbeeTLc

Custom firmware for Zigbee 3.0 IoT devices on the TLSR825x chip
Other
358 stars 19 forks source link

MHO-C122 not supported in Zigbee2MQTT #118

Closed wimb0 closed 6 days ago

wimb0 commented 1 week ago

MHO-C122 seems to be missing in the zigbeetlc_v0121.js converter file. If I understand the converter file correctly, it should show up as a LYWSD03MMC in Z2M?

I flashed one with the Zigbee firmware, and Z2m shows it as not supported:

image

robvanoostenrijk commented 1 week ago

Your MHO-C122 should be natively supported in Zigbee2MQTT: https://github.com/Koenkk/zigbee-herdsman-converters/blob/9e4c840b5466dfd0891039ddf66056fbc5e9bc9e/src/devices/zigbeetlc.ts#L121

wimb0 commented 1 week ago

I know, that is why I created the issue here. 4 convertred LYWSD03MMC devices work fine, but my 2 MHO-C122 do not want to work with Z2M. I tried resetting them, and rejoin, but they stay Unsupported.

Zigbee2MQTT version 1.40.0-1 (HA addon)

Relevant logs from Z2M.

[2024-09-03 08:33:16] info:     zh:controller: Interview for '0xa4c138e3a1049a21' started
[2024-09-03 08:33:16] info:     z2m: Device '0xa4c138e3a1049a21' joined
[2024-09-03 08:33:16] info:     z2m: Starting interview of '0xa4c138e3a1049a21'
[2024-09-03 08:33:17] info:     z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c138e3a1049a21","ieee_address":"0xa4c138e3a1049a21"},"type":"device_joined"}'
[2024-09-03 08:33:17] info:     z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c138e3a1049a21","ieee_address":"0xa4c138e3a1049a21","status":"started"},"type":"device_interview"}'
[2024-09-03 08:33:17] info:     z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0xa4c138e3a1049a21', payload '{"last_seen":"2024-09-03T08:33:17+02:00","linkquality":83}'
[2024-09-03 08:33:17] info:     z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c138e3a1049a21","ieee_address":"0xa4c138e3a1049a21"},"type":"device_announce"}'
[2024-09-03 08:33:31] info:     z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0xa4c138e3a1049a21', payload '{"last_seen":"2024-09-03T08:33:31+02:00","linkquality":69}'
[2024-09-03 08:33:32] info:     z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0xa4c138e3a1049a21', payload '{"last_seen":"2024-09-03T08:33:32+02:00","linkquality":65}'
[2024-09-03 08:33:32] info:     zh:controller: Succesfully interviewed '0xa4c138e3a1049a21'
[2024-09-03 08:33:32] info:     z2m: Successfully interviewed '0xa4c138e3a1049a21', device has successfully been paired
[2024-09-03 08:33:32] warning:  z2m: Device '0xa4c138e3a1049a21' with Zigbee model 'MHO-C122-z' and manufacturer name 'MiaMiaoCe' is NOT supported, please follow https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html
[2024-09-03 08:33:32] info:     z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":null,"friendly_name":"0xa4c138e3a1049a21","ieee_address":"0xa4c138e3a1049a21","status":"successful","supported":null},"type":"device_interview"}'
pvvx commented 1 week ago

Most likely https://github.com/Koenkk does not support manufacturerName: 'MiaoMiaoCe' https://www.miaomiaoce.com/

robvanoostenrijk commented 1 week ago

@pvvx Looks like you are correct. That is the issue here. Is this a firmware issue or MiaMiaoCe is the correct name?

@wimb0, once @pvvx confirms I'll raise a pull request against the converter in Zigbee2MQTT to rectify the manufacturer name to what the firmware is reporting.

wimb0 commented 1 week ago

Your are correct. I see that the MHO-C122 with latest firmware reports the vendor as MiaMiaoCe, not MiaoMiaoCe:

[2024-09-03 08:33:32] warning: z2m: Device '0xa4c138e3a1049a21' with Zigbee model 'MHO-C122-z' and manufacturer name 'MiaMiaoCe' is NOT supported, please follow https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html

I'll try to fix the custom converter and see if that helps.

The correct name should be MiaoMiaoCe. Print on the back of the device says: MiaoMiaoCe Technology (Beijing) Co., Ltd.

robvanoostenrijk commented 1 week ago

We'll wait for pvvx to confirm if this is a firmware typo or not. If not, I'll change Zigbee2MQTT upstream.

His comment indicates it should be MiaoMiaoCe, as per the official website. In that case the firmware manufacturer is wrongly set (letter 'o' missing).

juha63 commented 1 week ago

sensorEpCfg.c:

#define ZCL_BASIC_MFG_NAME     {9,'M','i','a','M','i','a','o','C','e'} // MiaoMiaoCe

This has never changed since the first commit and has always been "MiaMiaoCe". Same with MHO_C401N.

Maybe it's better to stay with this error and change the converter in Zigbee2MQTT? Otherwise we all have to reflash all our devices ...

wimb0 commented 1 week ago

Maybe fix both? Correct name in new firmwares. Both manufactureres in Z2M converters.

pvvx commented 1 week ago

Ver 0.1.2.3: Added the ability to change the "manufacturer name". Changing the structure of saving the model and the manufacturer name. Corrected manufacturer name "MiaoMiaoCe" for MHO-C122 and MHO-C401N.

wimb0 commented 1 week ago

Thanks for the quick fix! Will the new firmware be available as OTA in Z2M?

pvvx commented 1 week ago

Unfortunately I do not support or use Z2M.

juha63 commented 1 week ago

@wimb0: You should be able to do a local OTA update in Z2M using the bin file 1141-020b-01233001-ZMHOC122.zigbee

wimb0 commented 1 week ago

I've updated via local OTA. My MHO-C122 with fw v0.1.2.3 is working fine now!

wimb0 commented 6 days ago

Since this issue is resolved, I'll close it.