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

If you’re going to go through that trouble, why not get a high power Xbee shipped to you?

1 Like

I had a quick look yesterday, they are a maker option aren't they? If so, unfortunately I don't have any skills/knowledge for that option.

Technically yes, but it’s really simple. You order the XBee and adapter. you screw the antenna on and follow the examples here of how to set the program and you’re done.

Everybody who tries it, myself included are anxious about the process and then shocked at how simple it was.

Don't suppose you have a link handy for where you got yours?

I got the Xbee from Mouser, and I got the board from Digikey. Long story. Had to do with availability and my impatience around the situation. My antenna came from an old TP link router

The settings for PC are in the Everything Xbee thread, and I posted the settings for Mac.

Here's the waveshare board that a lot of people are using for $22 AUD

https://www.amazon.com.au/Waveshare-XBee-USB-Adapter-Communication/dp/B017KGBP6Y/ref=sr_1_21?ie=UTF8&qid=1552951609&sr=8-21&keywords=xbee

Here's an XBee Pro for $43 AUD with the antenna already installed.

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

They're available from DigiKey Australia too. These are the exact Xbee and daughter card I have.

Here's the Pro model. You might only need one with this because the power output is strong, but that depends on the layout of your home and where your devices are.

This is a far better value than importing IKEA repeaters. A lot more powerful and you'll be able to map your Zigbee network.

Here are the settings for Windows

Here are the settings for Mac

You just download XCTU, put in the values, press program and it's ready to go.
LInks for downloading and instructions are in the first post. You'll actually feel kind of silly for worrying about the process so much when you finally do it yourself. Writing your first RM rule is seriously more complicated than this.

1 Like

: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?