[RELEASE] Xiaomi Drivers with Health Status and Zigbee2MQTT

Haha, lived in Leeds for a while! :joy: Other side of the Pennines these days.

Hi - I keep getting notices from HPM that an update is available for these drivers but each time I try to install the update, I get this error. It's been going on for many many months.

Error Occurred During Installation

An error occurred while installing the package: Failed to upgrade driver https://raw.githubusercontent.com/birdslikewires/hubitat/master/xiaomi/drivers/xiaomi_mijia_smart_light_sensor_gzcgq01lm.groovy.

You need to be running at least v1.8.7 of HPM. Update HPM first, then these drivers. If you get any trouble once you're on the latest HPM version, use the Repair function to reinstall the drivers.

Only v1.8.7 and above of HPM can deal with libraries, a recent Hubitat feature which these drivers now use.

2 Likes

Ahah! That fixed it. I didn't realize that HPM wasn't getting updated by...HPM. Or at least not by the version I had.
Got HPM up to 1.8.8 and was able to update the Xiaomi drivers.
Thanks!

1 Like

Just an interesting observation... I have one remote switch which started consistently dropping. This, I guessed, was due to a nearby IKEA repeater which was having trouble talking to the hub on occasion (who knows why this started happening, perhaps the neighbours have bought a new wireless doodad).

So, with the C8 coming out I thought "why not get that with it's snazzy extended range". Clearly it arrived in record time and I've switched my Xiaomi hub over to using it (the migration did not go well, but that's another story).

Naturally I hit problems, but I suspect the problems are because the range of the new hub is so good. If the Xiaomi switches connect via an IKEA repeater they're fine and they stay connected. If they connect directly to the hub they will drop.

Neighbor Table Entry
[Secondary Repeater, 26B6], LQI:123, age:3, inCost:1, outCost:1
[Study Switches, 4B9D], LQI:171, age:9, inCost:1, outCost:0
[Primary Repeater, FDBB], LQI:255, age:3, inCost:1, outCost:1

I see this and I'm pretty certain that those study switches are on their way out unless they connect via the repeater at some point. The trick so far has been to reduce the radio power level to the point where the repeaters maintain an inCost and outCost of 1, but making the hub less attractive for a direct connection. Wish me luck.

NB. I did try using the new Zigbee 3.0 radio in the C8 with no repeaters. Range was great and the switches connected and worked fine... for a couple of hours and then they all dropped. With the two IKEA repeaters most are fine, there are just a few stragglers going missing.

5 Likes

That’s a rather disappointing news, I believe no one expected this ‘side effect’ of the much better C-8 radio in relation to some of the Aqara devices.

Do all of your Aqara devices behave this way now, or just some models?

2 Likes

I will stay away from the C8 if this is the case.
My Aqara/Xiaomi devices is working rock solid on my C7 with a few IKEA outlets acting as repeaters.

1 Like

I don't experience problems with Aqara buttons ( model: lumi.sensor_switch) and motion sensors (mostly model: lumi.sensor_motion.aq2) paired directly to my C7 hub.

What these Aqara older generation sensors do not like, are any changes in the Zigbee network. So I hope that resetting the devices and pairing them again to a C-8 hub just once will do the trick.

I will know for sure next week...

2 Likes

Well, that's going to be an annoyance. When I get a C-8 (I'm dragging my feet) I suspect what I will do is leave my Aqara/Xiaomi devices and some Iris outlets (as repeaters) on a C-7, isolating them from the rest of my Zigbee mesh which I'll move tho the C-8.

That reminds me... when I did a backup migration from my original C-7 to the C-7 with the antenna mod, it took almost a week to get the Aqara devices happy again. They'd continually drop and I'd reset them over and over. Finally it stabilized.

1 Like

Undoubtedly, this will be the best approach. It always works independently of the home automation platform, not just HE.

Interesting, I will follow your experience with the C8 closely. :slight_smile:

All of my Aqara sensors (leak, temperature, contact) made it through the migration without issue and have stayed on the mesh for almost 24 hours. No re-pairing needed. Interestingly, none of the 65 zigbee devices in that mesh are directly connected to the C-8- verified by XCTU.

Repeaters:
6 eWelink outlets
2 XBees
2 Iman's Environmental sensors

2 Likes

What's this antenna mod of which you speak?

I'm still in the process of re-pairing the ones which are dropping, in a frustrating game of whack-a-mole. :slight_smile:

The usually well-behaved light sensor is refusing to pair at all currently, so it'll probably get moved to my AlertMe mesh (where they're happy all the time, this one was a test case). I've only re-paired one of the mini buttons and that's been hit-and-miss, though surprisingly it's still paired this morning.

It's the "wireless remote switches" which I have on the walls that are the important ones, so I'm concentrating on getting them all back. Thankfully the family have chosen to see this round of interruption as amusing for the time being, as everything's controllable through HomeKit via Homebridge anway. Phew.

and

1 Like

Couldn’t keep my hands of an C8 so I ordered and got one a few days ago.
Seems like one button and one motion sensor are giving me some troubles. They have worked flawless for years before.
The rest of my Aqara buttons, motion sensors and temperature sensors works fine.

Well, I've ended up having to rethink.

I could not get the C8 and the Xiaomi gear to work reliably at all. Some devices were absolutely solid and would work perfectly... and others of the same device and firmware version would drop within a couple of hours. And it wasn't even dependent upon proximity to the hub or a repeater - switches within centimetres of one another would have one working, one constantly dropping.

Instead, I've come up with a completely new solution. These drivers now contain compatibility with a Zigbee2MQTT parent driver which I'm planning on releasing. I've got a bunch of devices moved off Hubitat's Zigbee radio and on to Zigbee2MQTT... and it's looking really good.

Once I've given it some more testing I'll throw it out there. It's actually amazing to have an independent Zigbee mesh and then the Hubitat platform to control everything, to the point that I'm wondering why it's not an official thing.

2 Likes

I have the same problem with Aqara device with the new C8. None of them are working but a newer P1 motion the older units will not pair or if they do pair they will drop off within minutes tried all the radio stuff, on the new C8 running the latest software So the newer Aqara p1 motion is fine and doesn't drop, but all the older Aqara devices drop off and have a tough time connecting. I have three devices older Aqara, Motion, buttons wxkg11lm and Contact sensor,MCCGQ1LM, none of these will stay connected and will not pair correctly running on a C8 with firmware 2.3.5.110, Using drivers that worked on the C7 hub and had no issues. So any suggestions would be greatly appreciated, I have tried all the above suggestions only to have them drop off within a few minutes and then will not reconnect.

Well, it's probably not an answer you'll like given you (as I) are C8 owners, but family pressure to operate the lights required a rapid solution, so I came up with this Zigbee2MQTT integration.

I suppose your other option would be to run the C7 and C8 together and use Hub Mesh to share devices between them, with your Xiaomi bits on the C7.

I kind of regret switching my C7 for a C8. Can’t understand how the C8 can fail when the C7 been rock solid in the EXACT same environment and setup.
Unfortunately I can’t blame anyone but myself since a few people already mentioned this…

Hi guys, i'm having problems.
Been trying to get Mi Light Sensor working. Have tried marcus and another persons code but they didn't work. Stumbled upon yours and i'm finally getting a "illuminance" current state but it just says 0.

What i've done:
Installed via HPM 1.8.8.
Clicked configure.
Re-Paired the sensor.
Changed the battery.

It's a GZCGQ01LM.
I only get this info:

Current States

  • illuminance : 0
  • presence : present
  • pushed : 1

State Variables

  • rawLux : 0
  • presenceUpdated : 0

Log file

dev:1722023-03-15 07:00:44.055 PMwarnLux : Presence : Waiting for first presence report.
dev:1722023-03-15 06:56:40.939 PMtraceLux : Trace Logging : Automatically Disabled
dev:1722023-03-15 06:50:44.022 PMwarnLux : Presence : Waiting for first presence report.
dev:1722023-03-15 06:40:44.318 PMwarnLux : Presence : Waiting for first presence report.
dev:1722023-03-15 06:36:40.946 PMtraceLux : Trace Logging : true
dev:1722023-03-15 06:36:40.946 PMdebugLux : Debug Logging : true
dev:1722023-03-15 06:36:40.945 PMinfoLux : Info Logging : true
dev:1722023-03-15 06:36:40.944 PMinfoLux : Preferences updated.
dev:1722023-03-15 06:36:40.852 PMinfoLux : Configuration complete.
dev:1722023-03-15 06:36:40.836 PMtraceLux : sendZigbeeCommands received : [zdo bind 6664 0x01 0x01 0x0000 {04CF8CDF3C819A78} {}, zdo bind 6664 0x01 0x01 0x0001 {04CF8CDF3C819A78} {}, zdo bind 6664 0x01 0x01 0x0003 {04CF8CDF3C819A78} {}, zdo bind 6664 0x01 0x01 0x0400 {04CF8CDF3C819A78} {}, zdo bind 0x6664 0x01 0x01 0x0001 {04CF8CDF3C819A78} {}, delay 2000, he cr 0x6664 0x01 1 32 32 3600 3600 {} {}, delay 2000, zdo bind 0x6664 0x01 0x01 0x0400 {04CF8CDF3C819A78} {}, delay 2000, he cr 0x6664 0x01 1024 0 33 3 3600 {6400} {}, delay 2000]
dev:1722023-03-15 06:36:13.340 PMtraceLux : Trace Logging : true
dev:1722023-03-15 06:36:13.339 PMdebugLux : Debug Logging : true
dev:1722023-03-15 06:36:13.338 PMinfoLux : Info Logging : true
dev:1722023-03-15 06:36:13.337 PMinfoLux : Preferences updated.

Please tell me what obvious thing i'm doing wrong.
If I pair it to my old smartthings hub it works and updates the lux changes very quickly. I've tried 3 other driver codes and now this package but cannot get any form of decent data out of the sensor.

Also on an unrelated note, how do I change my username?