Not able to get Xiaomi Gateway Key

hello @Flo,

just enter the key with the “-” (minus) like : xxx-xx-xxx

it works with this style only, 10 digits.

I works with integration add HomeKit Accessory is perfect with XXX-XX-XXX :ok_hand:

my problem appear in the code like when I want to hard code that :

xiaomi_aqara:
discovery_retry: 5
gateways:
- mac: XX:XX:XX:XX:XX:XX # MAC AQARA
key: 103-35-287 aqara key

I have a error saying :

Invalid config for [xiaomi_aqara]: length of value must be at least 16 for dictionary value @ data[‘xiaomi_aqara’][‘gateways’][0][‘key’]. Got ‘103-35-287’. (See /config/c

compilator is not really compliant :frowning:

Thanks a lot a lot a lot a lot for Olivier!
I have the Mijia gateway 2019
And thanks to your explanation it was very easy to install in Home Assistant:
I have unplugged and plugged the gateway from the power supply.
Then HA has discovered the new device
The “token” is writen under the gateway and in the manual for me. It was 8 digits to put simply in the form xxx-xx-xxx
Very Easy!
Thaaaaaaannnnnkkksssss !!!

1 Like

read step by step my post…you do wrong…the key in

xiaomi_aqara:

is not format like xxx-xx-xxx…, this is just for Aqara gateway, one time is recognize by HA, done.

The other config in configuration.yaml

xiaomi_aqara:

is for Mio gateways (not Aqara one, compatible HomeKit with key provide on the box xxx-xx-xxx).

You seems to have some problems to read a post step by step… @benooye has read and understand so i dont think my post is malformed or difficult to understand…

happy for you!

Check this:

Salut, celui ci est bon pour moi ? Il est compatible avec HA ?
Merci beaucoup Olivier.

Hello @niconath,

yes! but the price is very expensive : https://fr.aliexpress.com/item/32912322984.html?spm=a2g0o.productlist.0.0.684f2395R8TV7g&algo_pvid=74181eba-5e49-40bd-9c42-7e4f142c9411&algo_expid=74181eba-5e49-40bd-9c42-7e4f142c9411-47&btsid=0b0a0ac215865419440265438e6117&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

perhaps this one is with a EU plug ? but i read “16629_3-UK-Gateway-New” in description…

Be carefull its not a UK plug (like chinese plug) because you need a adaptor.

The difference is the price, and if you buy the Aliexpress one, you only connect to Chinese server.

Ask the sellor if the amazon version is with a EU plug (not UK) and works on EU server.

The other point is the delay if you buy from Aliexpress…you have to wait a while…

:wink:

Thank you for your answer, it only works on Chinese server the Amazon version that I showed you and for the adapter it does not matter, I will buy one.
If not for your link, will it work with home assistant? What are the door and motion sensors that I can connect? Could you also put me a link so that I order the set and that I am sure that everything works with HA in France?
Thank you very much for your help

ok!

so best choice (for me) is to buy with the link i already provide with Aliexpress (above).

But yes, you can choose any Xiaomi Aqara HomeKit version you want on Aliexpress because the item come from China so its Chinese version!

Here is a kit with Gateway and sensors : https://fr.aliexpress.com/item/32945845633.html?spm=a2g0o.productlist.0.0.785838f4RSZPDM&algo_pvid=e7233acd-a08e-4c50-b271-5661a25feb87&algo_expid=e7233acd-a08e-4c50-b271-5661a25feb87-3&btsid=0b0a22a415865446325014868ef952&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

BUT!!! : you can NOT add motion and door sensor with a AQARA GATEWAY on HA!!!

You need to buy a Mio Gateway instead. And you have to find the key in the hiden menu of Xiaomi Mi Home APP (already speak about in my POST).

Mio gateway kit : https://fr.aliexpress.com/item/32749343672.html?spm=a2g0o.productlist.0.0.60985d6fhKK26d&algo_pvid=fe9e3d6b-1ad0-4f99-a487-49a0badc93ef&algo_expid=fe9e3d6b-1ad0-4f99-a487-49a0badc93ef-6&btsid=0b0a187915865450772988115eac25&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

I use the Aqara for led bulbs only and Mijia gateway for door, motion, etc …, sensors.

The Aqara works with sensors in Mi Home App BUT NOT IN HA.
The Mijia works with sensors in Mi Home App AND in HA.

Hope it help :wink:

OK then I want a gateway that connects to HA and so I have to take which one? And the aquara sensors are compatible with the mija?

Already respond just above lol :
“You need to buy a Mio Gateway instead. And you have to find the key in the hiden menu of Xiaomi Mi Home APP (already speak about in my POST).”

Mio gateway kit : https://fr.aliexpress.com/item/32749343672.html?spm=a2g0o.productlist.0.0.60985d6fhKK26d&algo_pvid=fe9e3d6b-1ad0-4f99-a487-49a0badc93ef&algo_expid=fe9e3d6b-1ad0-4f99-a487-49a0badc93ef-6&btsid=0b0a187915865450772988115eac25&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

Yes Aqara sensors are 100% compatible with Mijia (or called Mio is the same Gateway).
And Mijia sensors works on Aqara too.

OK thank you very much, but it seems that with the EU version of the application, we cannot display the code, can you confirm?

Yes, that why i say its better and safer to buy a Chinese product :wink:

Is this one good?

#Aliexpress € 6,39 20%de réduction | Xiao mi mi jia capteur de fenêtre de porte système d’alarme Intelligent Xiao mi Kits de maison intelligente travail de poche avec passerelle mi jia mi application à la maison

So that its works with HA of course

Okay so I just ordered this one with the Eu adapter, can you put the link of the door sensors that will be compatible with the gateway and with home assistant, thank you

You can buy whatever you want, either Aqara and Mijia sensors works on the Mijia Xiaomi Gateway2 you just bought :wink:

link you post in #144 is ok!

OK so these are compatible with the gateway DGNWG02LM and Home assistant? Thank you very much sorry I am a novice and I would not want to make a mistake while buying, thank you for your patience

#Aliexpress € 3,19 22%de réduction | 100% Original Xiaomi Aqara capteur de corps humain intelligent ZigBee connexion sans fil intégré capteurs d’intensité lumineuse travail APP Contral

#Aliexpress € 6,46 21%de réduction | Vente groupée Original Xiaomi Mijia Intelligent Mini porte fenêtre capteur taille de poche maison intelligente lumières automatiques pour MIhome App

no problem,

wahooo! very cheap!

Yes they will work dont worry :wink: