XIaomi Aqara gateway v2 - problem with devices

Hello, I have a problem, first I bought new version of gateway by Xiaomi Aqara.v3 and then I read that this version is uncompatibility with HA, then I bought v2 gateway by Xiaomi and this time I have access to hub info and password. Then I put in my configuration.yaml:

xiaomi_aqara:
discovery_retry: 10
gateways:
- mac: 7811DCxxxxxx
key: xxxxxxxxxxxxxxxxx
host: ‘192.168.1.23’ #static IP address

and gateway was discovered in HA. Now in services I see: 4 option of xiaomi: xiaomi_aqara.add_device, ringtone etc, but I don’t see any devices. In xiaomi mi app on my phone I see all devices (I have 2 sensor of temperature mini version, flood sensor, rgb led bulb, white led bulb, 2 dockers, magic cube etc). I try with every items but I can’t find this devices in HA. Please help because I try everything what you wrote in many topics.

After send services ‘xiaomi_aqara.add_device’ in interface a see notification: “Join permission enabled for 30 seconds!..” and gateway is blink, but when I pairing new devices then I see them only in Xiaomi app (mihome). I have enabled in miHome wireless communication protocol and my version is 2.75.3

HA is raspberry Pi with Hassio.

Which server are you using? If I remember correctly you have to use the Chinese one!

Yes I have Chinese server because I used also air purifier with full functions in HA.

so this does suggest that something is working - the other check is to see if you have the hub light showing.

If it doesn’t show, then it is more likely your front-end isn’t configured to show devices…
Which version of HA are you running, and are you using Lovelace?

If you are using something like 0.90+ and lovelace, in the main screen, select the three dots on the top right, and then “unused entities” and see if your sensors and bulbs show there…

Wifi bulbs? you can’t control wifi bulbs via xiaomi hub - only zigbee devices. Are they yeelight bulbs (Yeelight - Home Assistant) ?

Are they yeelight bulbs

Yes, my bad not xiaomi but yeelight. But others devices are from aqara/miija family and are connected with my gateway like a ‘child devices’ in Xiaomi MiHome app.

But I have also this bulb. None of them is visibility in HA.

You can add a lot of stuff to Mi Home that can’t be managed via zigbee and the HA xiaomi integration.

In this case the MiHome app is managing the lights via their wifi internet connection.

But the motion sensor should show up:

Yes I know this, but in states in my HA I don’t have any aqara devices.

like You see I added mi flora, eq-3 bluetooth thermostat, but I don’t see any devices of aqara :confused: even gateway, but in services I can call a service to xiaomi.

OK - you don’t have a light.gateway_light_aabbccddeeff listed - there is something wrong with your gateway connection.

I accept the add_device service seems to trigger the gateway, but you should see the gateway light in your states list…

Can you confirm the indentation of your configuration.yaml:

xiaomi_aqara:
  discovery_retry: 10
  gateways:
    - key: xxxxxxxx
      host: 192.168.1.72
      mac: 7811DCxxxxxx

if that is correct, check the log file for anything related to xiaomi?

@matek1990PL Try commenting out the MAC address line and restart.

I have the same problem.
After a lot of trials I connected xiaomi gateway (lumi v3) to home assistant and I can see 4 different services in developer tools. (add device etc).
Other than that I cannot connect any sensor. I am trying to connect zigbee temperature sensor, I call the add service, press the button, says something in chinese and then nothing comes up to my entities. Do I have to add anything to configuration file or something?

hi guys,

i’ve posted here too Xiaomi V2 Gateway discovery issues

but i need some help for some reason my HAAS just won’t connect to my V2 Xiaomi gateway no matter what i enter in the configuration. Anyone got any guidance?

the Chinese voice is saying something like “ready for pairing” - you have to trigger the sensor to pair, by pressing the button on it - have a look at Using the Xiaomi Gateway & Button | Smart Home Hobby

Hi,
thanks for the reply!
As I describe, I call the service (xiaomi aqara add device), then I press the sensor button and says somehting in chinese but nothing happens. There are no any new entities.Also, when I call the rest 3 services (ringtone etc) it says failed “required key not provided”. The key from mihome is correct because if it’s not I cannot see the gateway in home assistant services; I’ve tried before generating new key from mihome. It looks that this is an issue for many people.

does the sensor show in MI Home? if not, then it isn’t pairing, and wont show in HA.

can you try the following in a CLI

nmap -sU -p 9898 192.168.1.199

and

nmap -sU -p 4321 192.168.1.199

Both need to be open for everything to work…

Yes, you can see the sensor in MiHome and works as it should.
Do you mean to open ports (9898 and 4321) in router for the gateway’s ip?
What is this to try in a CLI?

no, you need to run the nmap commands on which every box you run HA on - my HA install is runing on an intel NUC with Ubuntu and virtenv -

walaj@JonLabNUC:/home/homeassistant/.homeassistant$ sudo nmap -sU -p 9898  192.168.1.72
[sudo] password for walaj:

Starting Nmap 7.01 ( https://nmap.org ) at 2019-07-01 11:40 AEST
Nmap scan report for LUMI-GATEWAY-V3_MAIN (192.168.1.72)
Host is up (0.0031s latency).
PORT     STATE SERVICE
9898/udp open  unknown
MAC Address: 78:11:DC:E1:F8:CD (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 0.59 seconds
walaj@JonLabNUC:/home/homeassistant/.homeassistant$ sudo nmap -sU -p 4321  192.168.1.72

Starting Nmap 7.01 ( https://nmap.org ) at 2019-07-01 11:40 AEST
Nmap scan report for LUMI-GATEWAY-V3_MAIN (192.168.1.72)
Host is up (0.0027s latency).
PORT     STATE         SERVICE
4321/udp open|filtered rwhois
MAC Address: 78:11:DC:E1:F8:CD (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 0.60 seconds

Hi,
do I have to ssh to my raspberry pi and run those 2 commands?
nmap -sU -p 9898 192.168.1.199

and

nmap -sU -p 4321 192.168.1.199

(where I have to replace with my gateway’s ip?)

Also, what is the result of that. Is it going to fix the issue or it is just information to check the connection?

Thanks

yes - ssh to the rpi and run them - if they are not installed/available, you might have to install them:

sudo apt-get install nmap

All it will do is check the two ports are open (yay), or not open (boo) - the previous post I did is on my working install.

also - check the MAC address of the gateway, and Xiaomi Gateway and how to get the correct one

1 Like