[Deprecated] Xiaomi / Aqara ZigBee device drivers (possibly may no longer be maintained)

:laughing: Did you guys even look?

:wink:

https://www.digikey.com.au/products/en?keywords=XB3-24Z8ST-J

https://www.digikey.com.au/products/en?keywords=602-1979-ND

Thanks @SmartHomePrimer, I think I am missing something. Again, excuse my ignorance here, I have zero experience with this :slight_smile:. I assume the transceiver plugs/clips/slides into the board - how does it get power?

Also, I understand that the power is greater with the xbee, and will have the ability to map my zigbee network, but the on the price side, with just the parts listed above, it looks like each one would cost a little over $60, compared to about $25-$30 for each of the ikea modules. I am sure I must be missing something.

The Xbee has pins in the bottom of it (or at least the one you’ll need does) and it simply plugs into the card. Assembly takes 2 seconds. It gets power from a Micro USB cable, like you use for an Android phone. Therefore a computer or a phone charger with a Micro USB connection can power it.

Yes, depending on which USB daughter card you get, the [Waveshare](Waveshare XBee USB Adapter USB Communication Board with Xbee Interface Supports XBee Connectivity: Motherboards: Amazon.com.au 2) or the DIgi) it's roughly $60 AUD for the 8bBm power output version like I have, or around $78 AUD for the Pro with 19bBm power output. Compared with the IKEA that will cost you somewhere around $30 AUD (assuming you're not charged duty) and are just 5 dBm (depending on which information you read).

Don't get me wrong, I'm a huge fan of the IKEA Outlets as repeaters for the Xiaomi. They're working great for me. So I'm sure the repeaters do an equally good job. However, the real benefit in Canada is the outlets are just $15 CAD and the repeaters are just $10 CAD. I have two IKEA stores with a 30 minute drive. It's a no-brainer decision. However, I also don't live in a big house, and my walls are not constructed of concrete blocks.

If you're concerned it won't be the right choice for you, I'm wondering about Amazon's return policy in Australia. It's a bit more difficult to return items from a third-party seller here, but I've never been refused, and even when I could no longer reach the seller, Amazon always refunded my money and there was no charge for return shipping as always. So couldn't you buy the board and Xbee from Amazon, and if it's not right for you, send it back?

1 Like

I’m going to hold off for now, as good as both offers are.
I just don’t have the need for extra sensors right now having just picked up 4 x Zipato 3 in 1’s.

Thanks for the explanation. I couldn't see from the picture that there was a Micro USB connector.

What sort of range would be expected from the Pro, and how many devices can link through it? I am wondering if the Pro ended up being near my centrally-located hub, could I link my devices to it. Would it have a stronger signal (further reach) than the hub?

The link you shared earlier is for the board, don't suppose you have the correct link for the one you meant to link to?

Can't recall. It's miles I think. The Everything Xbee thread has all the info you need and if you can't find it, no one here knows more about them than @NoWon. I know it's long, but if you just go to the thread, and then go to the Edit menu of your browser, you can use Find and enter keywords for things you're looking for like "range". Makes it a lot faster to find info you need.

Oops. Sorry about that. I've update my post, but here is it too.

https://www.amazon.com.au/X-XB24CZ7WIT-004-Zigbee-802-15-4-Modules/dp/B007R9U1QA/ref=pd_rhf_se_p_img_2?_encoding=UTF8&psc=1&refRID=RRXC5C2CHCDV79K3R51C

Thanks for all of your help on this.

@saxnix have a look at post 208 on Everything XBee. Is a great post on how to determine the exact device you want and where to get it from.
I personally found the dev board cheaper on amazon UK (at £10) but being as the sites add on £13 delivery if you spend under £30 ($50 USD as I recall?) it pays to get it all in one place. I’ve gone for the series 3 pro with antenna on pcb. Can’t wait to get it all through :grinning:

Thanks for everyone's suggestions. I ended up ordering 2 of these boards, and 2 of these Series 2 Pro modules. Will have to wait up to 4 weeks for arrival, but so be it.

1 Like

@veeceeoh, I just received a pair of

bulbs. They seem to work properly with the built-in Generic Zigbee CT Bulb (dev) driver, so it seems no custom DTH needed.

@mike.maxwell, the only issue with this driver is that it throws exceptions sometimes (probably when those dreaded Xiaomi strings arrive):

[dev:769]2019-03-20 07:09:36.151 am [error] java.lang.NumberFormatException: For input string: "(/!a'! ! !0Àd e 3f!ú" (parse)
[dev:769]2019-03-20 07:04:09.344 am [error] java.lang.NumberFormatException: For input string: "(2!a'! ! !0Àd e 3f!ú" (parse)

And the info for fingerprinting:

Manufacturer: LUMI
Product Name: Device
Model Number: lumi.light.aqcn02
deviceTypeId: 15
manufacturer:LUMI
address64bit:00158D0002D39D81
address16bit:4973
model:lumi.light.aqcn02
basicAttributesInitialized:true
application:17
endpoints.01.manufacturer:LUMI
endpoints.01.idAsInt:1
endpoints.01.inClusters:0000,0004,0003,0005,000A,0102,000D,0013,0006,0001,0406,0008,0300,0403,0405,0402
endpoints.01.endpointId:01
endpoints.01.profileId:0104
endpoints.01.application:17
endpoints.01.outClusters:0019,000A,000D,0102,0013,0006,0001,0406,0008,0300
endpoints.01.initialized:true
endpoints.01.model:lumi.light.aqcn02
endpoints.01.stage:4
1 Like

It they are throwing those errors during operation, the built in driver Isnt going to work.
There is a zigbee rgbw driver in our public repo you could use as a starting point if you want to build up a custom driver for these.

IMHO the exceptions are thrown when the peroidic Xiaomi "string" arrives, everything is working flawlessly otherwise (commands work, reports received without throwing exceptions).

Maybe I'll write a DTH just to see what causes these exceptions, but the built-in driver is definitely working with these bulbs.

I couldn't resist, checked what causes the exception.

I assume your CT driver is quite similar to the RGBW sample, so the problem is that now, that string attributes are parsed back to binary string (since 2.0.5 I think),

Integer.parseInt(descMap.value,16)

fails on string values.

I think the log explains everything:

[dev:769]2019-03-20 03:49:50.199 pm [error]java.lang.NumberFormatException: For input string: "($!a'! ! !0Àd e 3f!ú" on line 67 (parse)
[dev:769]2019-03-20 03:49:50.189 pm [debug]parse description: read attr - raw: 49730100005601FF42270328240521170007270000000000000000082117010921000A0A2130C06420006520336621FA00, dni: 4973, endpoint: 01, cluster: 0000, size: 56, attrId: FF01, encoding: 42, command: 0A, value: 270328240521170007270000000000000000082117010921000A0A2130C06420006520336621FA00

This is how the code looks like:

<...snip...>
if (logEnable) log.debug "parse description: ${description}"
if (description.startsWith("catchall")) return
def descMap = zigbee.parseDescriptionAsMap(description)
def descriptionText
def rawValue = Integer.parseInt(descMap.value,16) // THIS IS WHERE THE EXCEPTION IS THROWN
def value
def name
def unit
switch (descMap.clusterInt){
    case 6: //switch
        if (descMap.attrInt == 0){
            value = rawValue == 1 ? "on" : "off"
<...snip...>

I think the current method causes exceptions on EVERY reported string attribute, so in this case the exception is not Xiaomi's fault. Moving rawValue parsing into case blocks would be much safer... It's a generic driver, it shouldn't fail on messages that otherwise follow the standard :smiley:

Edit: That's why I recommended to make a hexValue field in the map that contains the original hexadecimal string: that field would work even in this case...

1 Like

I've updated my device chart with that ZigBee model - thanks! If/when you make a custom device driver, I'll add the link in there, too.

Now, what I'm really wondering is:

  • Are all of those in/out clusters actually used?!?
  • Does the bulb work as a ZigBee router?

The built-in driver is fuctionally perfect, it just fills the logs with exceptions in every 5 minutes (when the 0xFF01 string arrives). I proposed a fix for @mike.maxwell above, if they implement it (or any other solution), the built-in driver will be just fine. If they decide to keep it this way, then I'll make a new one.

I don't think so...

Yes, it does:

image

1 Like

Hmm quite interesting

Hmm. Besides the expected Basic, On/Off, Color Control, and Level IN clusters, I see Power Configuration, Groups, Scenes, Time, Analog Output, Multi-state Output, Occupancy Sensing, Temperature Measurement, Relative Humidity Measurement, Pressure Measurement, and... Window Covering (?!?).

Are you seeing any temperature / humidity / pressure reports?

Yay! The next question is: Does it work well as a router for both Xiaomi / Aqara devices and other ZigBee devices?

Btw @veeceeoh, I have a smoke sensor as well... do you want to implement (or want me to implement) sensitivity setting in your DTH? Or a test command? I have the packet dump for these features...

And... I ordered a funky little LLKZMK11LM... (who the hell is responsible for these codes?) Seems to be a useful addition to the Aqara lineup.

No, nothing... most probably groups and scenes are supported, but the rest is just the result of copy-pasting firmware code from NXP's SDK. :slight_smile:

Well... this is a question I won't be able to respond... I have to confess that even though I have a pretty heterogeneous mesh, I have no routing issues with Xiaomi devices... that's why I'm quite silent in those topics, I simply cannot reproduce those issues. :slight_smile:

Oh yes please! Adding any functions not in the current driver would be very welcome. Since I don't own a smoke sensor, can you either share your code additions or make a pull request in GitHub?

Another thing people have asked about is a command to manually silence the alarm, but I have not seen any evidence that it's even available when the sensor is used with a Xiaomi/Aqara Gateway.

@martyn mentioned that Aqara Relay module a few days ago, and when I checked I noticed it's rated for 50Hz.

If the relays are coil-based then using the module with 60Hz power would affect impedance and then the device would be operating out-of-spec, so I will wait to hear about the internals before ordering one to try out.

Yes, probably, but with all of that and the "dreaded" FF01 attribute string, I'd have to guess this bulb is not part of Aqara's new ZigBee 3.0 Certified device lineup.

You must not have any "incompatible" routers on your mesh, fortunately!