home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.75k stars 30k forks source link

Xiaomi Gateway (Aqara) integration fails to discover Gateway #38582

Closed manosioa closed 3 years ago

manosioa commented 4 years ago

The problem

Hi there, trying to use the Xiaomi Gateway (Aqara) integration that supports all my sensors and my Gateway. The integration " Xiaomi Gateway (Aqara)" cannot be setup due to the fact that it doesn't discover the Gateway. When I select the integration, the prompt asks: > "Xiaomi Aqara Gateway > Connect to your Xiaomi Aqara Gateway > The network interface to use > "any" Tried to use "any" and get the error: "Failed to discover a Xiaomi Aqara Gateway, try using the IP of the device running HomeAssistant as interface" or my HA IP address and get the error: "Unknown error occurred" and "Failed to discover a Xiaomi Aqara Gateway, try using the IP of the device running HomeAssistant as interface" or the Gateway's IP address and get the error: "Unknown error occurred" and "Failed to discover a Xiaomi Aqara Gateway, try using the IP of the device running HomeAssistant as interface" Can you please provide help with the issue? If I can help, I would be happy to contribute to the solution of the issue. Many people have the same issue and trying to find out a way to solve it. Some have mentioned that the HA 0.111 was the last version that the integration worked as it should. I cannot verify that as I'm fairly new to HA. @danielhiversen @syssi Sensors: Mi motion sensor (Model: lumi.sensor_motion.v2) Mi Door/Window Sensor (Model: lumi.sensor_magnet.v2) Mi Wireless button (Model: lumi.sensor_switch.v2) Gateway: lumi.gateway.v3-MW300 by Xiaomi Firmware: 1.4.1_176 (Latest) ## Environment

Problem-relevant configuration.yaml

No custom .yaml, all in UI ```yaml ``` ## Traceback/Error logs

Additional information

probot-home-assistant[bot] commented 4 years ago

xiaomi_aqara documentation xiaomi_aqara source (message by IssueLinks)

probot-home-assistant[bot] commented 4 years ago

Hey there @danielhiversen, @syssi, mind taking a look at this issue as its been labeled with an integration (xiaomi_aqara) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

manosioa commented 4 years ago

Hi all,

Are there any suggestions I could try to get the gateway working?

@syssi @Danielhiversen

Your help would be much appreciated

manosioa commented 4 years ago

https://github.com/home-assistant/core/issues/38581#issuecomment-671221733

Let's move this here. @VDigitall

1) i remove the Gateway. 2) Reboot HA 3) Doesnt auto discover it so I click on "+" on the bottom right corner 4) Select Xiaomi Aqara integration. 5) On the stable release (not Beta) i had this first screen 89763305-e9f44380-dafa-11ea-80f2-311fbdd64a71 6) Left "any" and clicked "submit" 7) It could not find my Gateway 8) On latest Beta realease which you proposed to use in a previous comment, i get the following screen image 9) I leave "any" in the first field, click "submit" and it doesnt discover my Gateway. 10) Leaving "any" and filling in the IP on the 2nd field and the MAC address on the 3rd field doesnt help discover my Gateway.

Fun Facts: 1) on the latest beta I get this screen image NOT this 89763305-e9f44380-dafa-11ea-80f2-311fbdd64a71

2)The gateway is being Auto discovered by Xiaomi Miio integration. image

@starkillerOG since you wrote the Config Flow of the Xiaomi Aqara integration and you are activelly involved in Xiaomi Miio which seems to auto discover my Gateway, maybe you have some insights on how to resolve the issue of the Xiaomi Aqara integration not being able to auto discover or what to type in the fields mentioned above to help point the integration to the Gateway?

manosioa commented 4 years ago

UPDATE:

A user in HA's forums proposed to remove the Xiaomi Aqara entry from the “core.config_entries" file, located in “.storage”. https://community.home-assistant.io/t/xiaomi-gateway-setup-ha-0-112/209523/62

1)Removed the entrry from the file ignored edited 2) Restarted HA 3) Both integrations now auto-discovered the Gateway image 4) Clicked "Configure" on "Xiaomi Aqara Gateway" 5) Got this pop up image 6) Clicked on "Submit" with "any" left in the field 7) It failed to connect and gave me this scree. image 8) Left "any" in the first field and typed the IP on the 2nd field and the MAC address on the 3rd field. 9) The same screen appeared again image

Any suggestions?

VDigitall commented 4 years ago

@manosioa Do you have a working instance before with xiaomi_aqara integration? On previous versions of HA?

manosioa commented 4 years ago

@vdigitall unfortunatelly no because I started using HA a week ago. The Supervisors i've tested where 228,229 and the beta 230. The Cores i've tested where 0.113.3 and the beta 0.114.0b3.

VDigitall commented 4 years ago

@manosioa there are many reasons for failure:

manosioa commented 4 years ago

@vdigitall

@manosioa there are many reasons for failure:

  • It could be firewall settings Any suggestions that I can check? I'm going in as we speak.
  • It could be when Gateway and HA not in the same network HA is running on a VM which is on the same network as the Gateway
  • I have a problem when trying to start HA instance with VPN No use of VPN
  • It could be a router configuration I'm using OpenWRT and i've even forwarded the Gateway's ports. Plus there is no issue for the Miio integration to auto-discover the Gateway and register it, working fine (minus the fact that it doesnt support any of my sensors), so how can it be a router issue?
starkillerOG commented 4 years ago

Xiaomi_Miio uses direct TCP connection to the gateway. Xiaomi_aqara uses UDP multicast address for communication with the gateway. Do you have a setting in the router to allow UDP multicast? Furthermore you can try filling in the IP of the device running HomeAssistant instead of "any"

manosioa commented 4 years ago

Xiaomi_Miio uses direct TCP connection to the gateway. Xiaomi_aqara uses UDP multicast address for communication with the gateway. Do you have a setting in the router to allow UDP multicast? Furthermore you can try filling in the IP of the device running HomeAssistant instead of "any" Tried that but the issue remains

Cool. I've just searched a bit on the whole UDP Multicast thing. I'm guessing this is where I have to look into to find out how to enable it in OpenWRT. https://openwrt.org/docs/guide-user/network/wan/udp_multicast

From my understanding the Gateway is set by default to multicast data. Furthermore, HA sends Multicast requests to the Gateway. Is that right?

The HA VM is running on wired connection to the router. The Gateway is on WiFi. So what I need to make sure that they are listening each others requests.

Do you have any idea if OpenWRT is UDP Multicast ready or do I have to bridge them?

@starkillerOG

VDigitall commented 4 years ago

@manosioa you can install WireShark on OpenWRT and capture traffic in network with fitlers for example port=udp

manosioa commented 4 years ago

BTW it seems weird to me that it worked in 0.111.0 for everyone and since the 0.112.0 doesn't work.

Did the way the integration works changed to multicast in the last versions or was setup like this since the beginning?

manosioa commented 4 years ago

UPDATE:

1) Did everything to make sure that multicast is working on my router. All the steps described n the link posted in my previous comment. Made sure that firewall rules allow the connections between the HA and Gateway. Still the issue remains but now i have a new message: image I tried to type my HA's IP. Same reply.

2) I even downgraded to 0.111.0 to see what people were talking about that the Aqara integration was working in previous versions but the Aqara integration was nowhere to be found, only Miio.

3) All forums suggest against multicast over WiFi because of bandwidth and performance issues. I wonder why and how the Aqara integration works with multicast.

4) Why there are 2 Xiaomi Gateway integrations and what are the differences?

5) Here is the post with many. many users having the same issues I have and trying to find a solution. https://community.home-assistant.io/t/xiaomi-gateway-setup-ha-0-112/209523/62

Beduir commented 4 years ago

I have the same problem. I have two identical gateways lumi.gateway.v3. They're on the same subnet as Home Assistant. I was able to configure one of the gateways once. But during the experiments, I removed it and can't add it anymore. I get the same error "Zeroconf". I kept the settings from core.config_entries when I could add the gateway.

Now if you manually insert settings into core.config_entries, the gateway works. If I adjust the settings in core.config_entries to a second gateway, the gateway works too. I couldn't add a second gateway through the interface once.

In version 0.111.0, everything works.

manosioa commented 4 years ago

Hi @Beduir,

Can you please share the working aqara entry you manually put into "core.config_entries" file?

Thanks

Beduir commented 4 years ago
            {
                "connection_class": "local_push",
                "data": {
                    "host": "192.168.1.22",
                    "interface": "any",
                    "key": "b22jb533kg1vgqx2",
                    "mac": "78:7c:2e:c3:cc:82",
                    "port": 9898,
                    "protocol": "1.1.2",
                    "sid": "787c2ec3cc82"
                },
                "domain": "xiaomi_aqara",
                "entry_id": "9d1bbfcef9dd4c47ab58b000fd55e711",
                "options": {},
                "source": "zeroconf",
                "system_options": {
                    "disable_new_entities": false
                },
                "title": "Xiaomi Aqara Gateway",
                "unique_id": "78:7c:2e:c3:cc:82",
                "version": 1
            }

78:7c:2e:c3:cc:82 - MAC address in lower case 787c2ec3cc82 - MAC address in lower case without ":". b22jb533kg1vgqx2 - gateway password from MiHome application (About -> Wireless communication protocol - > Password) 192.168.1.22 - IP address of the gateway 9d1bbfcef9dd4c47ab58b000fd55e711 - I don't know exactly, I think it's just a random GUID for Home Assistant to link the gateway configuration and its devices. During the test, left one value for both gateways. If you use two gateways at once, the values should be different.

After changing the "core.config_entries" file you should restart Home Assistant.

manosioa commented 4 years ago
            {
                "connection_class": "local_push",
                "data": {
                    "host": "192.168.1.22",
                    "interface": "any",
                    "key": "b22jb533kg1vgqx2",
                    "mac": "78:7c:2e:c3:cc:82",
                    "port": 9898,
                    "protocol": "1.1.2",
                    "sid": "787c2ec3cc82"
                },
                "domain": "xiaomi_aqara",
                "entry_id": "9d1bbfcef9dd4c47ab58b000fd55e711",
                "options": {},
                "source": "zeroconf",
                "system_options": {
                    "disable_new_entities": false
                },
                "title": "Xiaomi Aqara Gateway",
                "unique_id": "78:7c:2e:c3:cc:82",
                "version": 1
            }

78:7c:2e:c3:cc:82 - MAC address in lower case 787c2ec3cc82 - MAC address in lower case without ":". b22jb533kg1vgqx2 - gateway password from MiHome application (About -> Wireless communication protocol - > Password) 192.168.1.22 - IP address of the gateway 9d1bbfcef9dd4c47ab58b000fd55e711 - I don't know exactly, I think it's just a random GUID for Home Assistant to link the gateway configuration and its devices. During the test, left one value for both gateways. If you use two gateways at once, the values should be different.

After changing the "core.config_entries" file you should restart Home Assistant.

Cool @Beduir That worked! Thank you!

The Gateway is discovred and connected but it didnt discover the sensors on the Gateway. In your case did it discover the devices on your Gateway?

Beduir commented 4 years ago

In your case did it discover the devices on your Gateway?

Yeah. One gateway was without devices. Only light was found on this gateway, maybe something else. There were many devices on the second gateway. Everyone was detected and working.

manosioa commented 4 years ago

@Beduir Are the discovered devices under the "entities" in integrations? Could you please list the devices you have connected on the Gateway? Maybe a screenshot of the Xiaomi Home App > about > multiple taps to the blank space to reveal the dev options > 4th option from the top

Beduir commented 4 years ago

@manosioa lumi.vibration.aq1 lumi.sensor_switch.v2 lumi.sensor_wleak.aq1 lumi.sensor_magnet.aq2 lumi.sensor_magnet.v2 lumi.plug.v1 lumi.sensor_smoke.v1 image

manosioa commented 4 years ago

@Beduir Last question (sorry about that I'm trying to figure this out on my own)

Under the Devices > Xiaomi Aqara Gateway > Device Info What do you get?

I get this: image

Beduir commented 4 years ago

I have now started the test server again (0.113.3) to take a screenshot. The gateway that I added manually stopped working (devices became unavailable). At the same time, everything works on the production server (0.111.4). Apparently, the way the gateway was manually added to "core.config_entries" cannot be considered reliable.

image

manosioa commented 4 years ago

@Beduir On 0.111.4 It detects only the Gateway with no devices/sensors. Gives a notification that my config is wrong.

image image image

On 0.113.3 It detects only the Gateway with no devices/sensors.

xiaomi image

manosioa commented 4 years ago

I think i'm officially on a dead end. @Danielhiversen @syssi Maybe you guys can take a look and have some suggestions.

Also @starkillerOG if you have anything in mind that could help me solve the issue, please chime in.

BTW I have setup a fresh new install to crosscheck every test result.

Beduir commented 4 years ago

I tried to manually add another gateway again and it worked. image

After that, the other one worked too.

Still does not work through the interface, there is an error in the log:

Logger: xiaomi_gateway
Source: /usr/local/lib/python3.8/site-packages/xiaomi_gateway/__init__.py:175
First occurred: 7:04:40 PM (3 occurrences)
Last logged: 7:05:00 PM

Unknown gateway ip 192.168.1.24

image

guyye commented 4 years ago

hi i did the maual change of the core file and it started to work but after a 3 hours the smoke ,gaz, leak sensors stopped and the temp continue to work fine. after a reset they work fir another 3 hours. ( the ports to the gw is open )

starkillerOG commented 4 years ago

Try the latest beta of HomeAssistant and update the gateway to the latest firmware, it schould work then

manosioa commented 4 years ago

Try the latest beta of HomeAssistant and update the gateway to the latest firmware, it schould work then

@starkillerOG Just did. It doesnt auto discover the gateway and then it prompts me to fill this out image

What exactly do i have to input there and in what format?

Tried with the IP and MAC of the Gateway but still cannot discover it image

I can successfully ping my Gateway through my server which has the HA running on a docker image

Do i have to check anything else?

starkillerOG commented 4 years ago

IP + mac as you did schould work, if it doesn't it is probably something in your network, but I would not know how to resolve that. Only thing you can try is to put in the IP of the HomeAssistant device instead of "any" and then fill in the IP an MAC of the gateway

manosioa commented 4 years ago

@starkillerOG

The Xiaomi Aqara auto discovers the Gateway BUT it cannot connect to it, so I'm pretty sure it's a configuration issue as long as I can ping the device and the device works in general.

My network setup is simple: Server is connected to router with Ethernet All of the WiFi devices are connected to the same router. No VLANs, No VPNs, No Firewall rules.

2 HA SETUPS to test things out: A VM and a docker one. Both have the exact same issue on all versions of HA, even on beta ones.

HA can ping the device (tried to ping the Gateway from HAs CLI), Both in docker setup and VM setup.

It's weird that Xiaomi Miio can auto discover AND configure my Gateway without any manual input. So we know for sure that HA communicates with the Gateway.

You said that Xiaomi Aqara integration is using Multicast to connect to the device. Are there any logs that I can use to find the issue? Maybe those would help you too to point me to the right direction.

Or maybe you know a command to help me trace multicast packages and/or connections to/from the Gateway to check that too.

biglegs462 commented 4 years ago

Yeah, found this thread and I've had this issue for the past few versions. I just upgraded to 0.114.0 and problems remain, with the same dialogues and messages as described above. My variation on this is I have 3 hubs - two have been discovered and configured perfectly for Aqara and Miio, and the sensors discovered for both these hubs. However the third has configured correctly for Miio only, and the balance of sensors on that 3rd hub remain undiscovered. I also have a simple unifi network, and multicasting is enabled. In fact, these hubs worked perfectly with manual settings in earlier versions. Now dead :( I commented in another thread, that the only difference with the non-discovered hub is that it's on a wireless uplink to an AP, not wired, but I wouldn't think that would make a difference, but who knows. They are otherwise on the same network.

biglegs462 commented 4 years ago

NB - I tried substituting the IP address instead o 'any' as per the suggestioin above, and got an error : image

manosioa commented 4 years ago

@biglegs462

Hi there, could you post the other topic that you mentioned?

BTW how can you tell if multicast is enabled on the router?

And when you mentioned the other topic you said about the gateway being connected through WiFi. Is there another way to connect the gateway?

accelle17 commented 4 years ago

Yeah, found this thread and I've had this issue for the past few versions. I just upgraded to 0.114.0 and problems remain, with the same dialogues and messages as described above. My variation on this is I have 3 hubs - two have been discovered and configured perfectly for Aqara and Miio, and the sensors discovered for both these hubs. However the third has configured correctly for Miio only, and the balance of sensors on that 3rd hub remain undiscovered. I also have a simple unifi network, and multicasting is enabled. In fact, these hubs worked perfectly with manual settings in earlier versions. Now dead :( I commented in another thread, that the only difference with the non-discovered hub is that it's on a wireless uplink to an AP, not wired, but I wouldn't think that would make a difference, but who knows. They are otherwise on the same network.

same here even on 0.114.1. I have unifi with multicast and igmp proxy enabled and I'm able to configure the gateway before 0.112 on the config. I only use the gateway for the sounds though, not as zigbee gateway. The workaround for me right now is to use the xiaomi_aqara 0.111.3 package as custom component.

Here's the error when trying to add xiaomi aqara using the integration:

ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 418, in start resp = await task File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 458, in _handle resp = await handler(request) File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 145, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper result = await method(view, request, *args, *kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 106, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 153, in async_configure result = await self._async_handle_step(flow, cur_step["step_id"], user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 201, in _async_handle_step result: Dict = await getattr(flow, method)(user_input) File "/usr/src/homeassistant/homeassistant/components/xiaomi_aqara/config_flow.py", line 90, in async_step_user self.selected_gateway = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(self.args, **self.kwargs) File "/usr/local/lib/python3.8/site-packages/xiaomi_gateway/init.py", line 227, in init resp = self._send_cmd(cmd) File "/usr/local/lib/python3.8/site-packages/xiaomi_gateway/init.py", line 330, in _send_cmd _socket.sendto(cmd.encode(), (self.ip_adress, self.port)) socket.gaierror: [Errno -3] Try again

manosioa commented 4 years ago

Hi guys, @syssi @Danielhiversen

Could you please take a look on this thread and help us?

Thanks 🙏

biglegs462 commented 4 years ago

@manosioa I can tell becasue it's enabled in the Unify controller that administers the whole wifi network as per accelle17 comments. Unifi APs can connect through mesh as well as wired, and that was the only difference. The first two gateways are wireless but to wired APs. The third, not working gateway is connecting to an AP which connected via wireless uplink (Mesh). However it was also the last gateway I tried to add.

manosioa commented 4 years ago

Hi all,

Any updates regarding the issue? Any suggestions to try?

@syssi @Danielhiversen @starkillerOG

There are lots of people that cannot make the Aqara integration work on the latest versions.

See more here: Home assistant Forum regarding Aqara integration issues

Thanks

Kyle-Bang commented 4 years ago

Hello guys, I have exactly same problems mentioned above, and try everything I can do but not working. And now It is FINALLY SOLVED! This is working for me but could not be working for other cases.

SOLUTION: Delete 'Aqara Cube' and 'wireless wall switch' on Mi home from your Xiaomi Gateway.

The problem was that some Aqara devices have compatibility issue with the 0.112 or later system. For my case, I did Factory reset my Xiaomi Gateway and immediately my hassOs recognized new Xiaomi Gateway and added it with no any problem. But after add my all devices, suddenly all Zigbee devices are unavailable on my hassOs. So I checked every my devices and I finally found out the devices which causes the problem. For my case, It was Aqara Cube and wireless xiaomi wall switch (double locker). These two devices previously worked without any problems. Other devices could be problem but my case, only that two devices are problem.

System information Home Assistant 0.114.3 arch | armv7l chassis | embedded dev | false docker | true docker_version | 19.03.11 hassio | true host_os | HassOS 4.12 installation_type | Home Assistant OS os_name | Linux os_version | 4.19.127-v7 python_version | 3.8.3 supervisor | 235 timezone | Asia/Seoul version | 0.114.3 virtualenv | false

alexanderznamensky commented 4 years ago

Hi dears!

I've the same issue with Xiaomi MIio integration. After updating core version higher than 0.112.4 it is not working. In the same time, I've no issues with integration of Xiaomi Aqara Gateway.

Screenshot 2020-08-03 18 09 39 Screenshot 2020-08-03 19 32 59 Screenshot 2020-08-19 12 58 54 Screenshot 2020-08-03 19 23 57

I'd appreciate to recieve your kind support. System info: arch | armv7l chassis |   dev | false docker | true docker_version | 19.03.11 hassio | true host_os | Raspbian GNU/Linux 10 (buster) installation_type | Home Assistant Supervised os_name | Linux os_version | 4.19.118-v7+ python_version | 3.8.3 supervisor | 235 timezone | Europe/Moscow version | 0.114.4 virtualenv | false

vosko87 commented 4 years ago

Hi All

I've the same issue with Xiaomi Aqara integration.

arch armv7l
chassis embedded
dev false
docker true
docker_version 19.03.11
hassio true
host_os HassOS 4.12
installation_type Home Assistant OS
os_name Linux
os_version 4.19.127-v7l
python_version 3.8.3
supervisor 235
timezone Asia/Jerusalem
version 0.114.4
virtualenv false
manosioa commented 4 years ago

Hello guys, I have exactly same problems mentioned above, and try everything I can do but not working. And now It is FINALLY SOLVED! This is working for me but could not be working for other cases.

SOLUTION: Delete 'Aqara Cube' and 'wireless wall switch' on Mi home from your Xiaomi Gateway.

The problem was that some Aqara devices have compatibility issue with the 0.112 or later system. For my case, I did Factory reset my Xiaomi Gateway and immediately my hassOs recognized new Xiaomi Gateway and added it with no any problem. But after add my all devices, suddenly all Zigbee devices are unavailable on my hassOs. So I checked every my devices and I finally found out the devices which causes the problem. For my case, It was Aqara Cube and wireless xiaomi wall switch (double locker). These two devices previously worked without any problems. Other devices could be problem but my case, only that two devices are problem.

System information Home Assistant 0.114.3 arch | armv7l chassis | embedded dev | false docker | true docker_version | 19.03.11 hassio | true host_os | HassOS 4.12 installation_type | Home Assistant OS os_name | Linux os_version | 4.19.127-v7 python_version | 3.8.3 supervisor | 235 timezone | Asia/Seoul version | 0.114.3 virtualenv | false

Tried what @Kyle-Bang proposed and had no luck.

@syssi @Danielhiversen @starkillerOG Any updates on this? It's getting bigger and bigger

fantasy9876 commented 4 years ago

I just tried to delete all other devices and try to connect to the Xiaomi Miio.

image

Remember to fill in the token you get from the Xiaomi Mi home.

alexanderznamensky commented 4 years ago

Hi.

Have you deleted all devices in HA or in MiHome also? Thanks!

Best regards, Alexander Znamensky

On Fri, Aug 28, 2020 at 8:54 PM fantasy9876 notifications@github.com wrote:

I just tried to delete all other devices and try to connect to the Xiaomi Miio.

[image: image] https://user-images.githubusercontent.com/4337585/91600311-f3eac300-e991-11ea-9cd5-4645e1d30cfc.png

Remember to fill in the token you get from the Xiaomi Mi home.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/38582#issuecomment-682991460, or unsubscribe https://github.com/notifications/unsubscribe-auth/APR3HZ4IXALT2MVOGU7SIXLSC7VMNANCNFSM4PWIF64Q .

alexanderznamensky commented 4 years ago

Hi!

Thanks for your kind support and suggestion! I did your recommendation, but without success. Probably I should delete all Aqara devices (I'm using also Motion sensors, Temperature sensors, curtains and Open-close sensors).

The question: do we need to do this procedure after each core update? Thanks in advance!

fantasy9876 commented 4 years ago

I figure out that deleting all other devices is not needed. Just need to get the right token and you'll be fine.

I used Bluestack, install Mi home version v5.4.49, use a File Manager to get to the log file to get the token(each time you connect the gateway to Mi Home it will generate a different token)

But my problem is that I could not use all the sensors and the subdevices of the Gateway.

alexanderznamensky commented 4 years ago

Hi! Thank you!

But I have received my token and key of gateway. And everything is working with core 0.112.4. As soon as I have updated to next core version, I'm not able to use Xiaomi Gateway Integration (process of installation is saying Success, but there is no Gateway: [image: image.png] As a result I'm not able to use Alarm of Gateway. All Zigbee sensors and entities are OK.

manosioa commented 4 years ago

Hi all,

Tried all the suggestions but the issue persists. Its a bummer that i cannot connect my Gateway and my 10 sensors on HA.

@syssi @Danielhiversen @starkillerOG Any updates on this?

Thanks

starkillerOG commented 4 years ago

@manosioa did you follow these instructions: https://www.home-assistant.io/integrations/xiaomi_aqara/#connection-problem Specifically have you checked if port 9898 is open on your gateway?

If your gateway’s MAC address starts with 04:CF:8C or 7C:49:EB, there is a good chance that the required port 9898 is closed on your gateway (you can check it with the Nmap utility, using the command sudo nmap -sU {gateway_ip} -p 9898). To fix that issue, you need to do these steps:

guyye commented 4 years ago

Hi Already done it 9898 is open. Still the same .