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
70.16k stars 29.18k forks source link

Xiaomi Aqara Gateway not receiving events #80249

Closed hanunes closed 1 year ago

hanunes commented 1 year ago

The problem

After upgrading to the new core version, aqara switches/temperature sensors/etc. don't send events or state updates to HA. The only device I see messages coming from the gateway is the Power Plug.

When I go to the Mi Home app, I see the trigger events getting logged, but they don't get passed to HA.

What version of Home Assistant Core has the issue?

core-2022.10.03

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

xiaomi_aqara

Link to integration documentation on our website

https://www.home-assistant.io/integrations/xiaomi_aqara/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2022-10-13 10:05:20.132 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] Gateway with host '10.40.0.18' connected, listening for broadcasts 2022-10-13 10:05:50.228 DEBUG (SyncWorker_8) [homeassistant.components.xiaomi_aqara.switch] Update data from hub: Plug_158d00015adfce 2022-10-13 10:05:50.234 DEBUG (SyncWorker_8) [homeassistant.components.xiaomi_aqara] PUSH >> : {'voltage': 3600, 'status': 'on', 'inuse': '1', 'power_consumed': '256227', 'load_power': '0.89'} 2022-10-13 10:06:20.229 DEBUG (SyncWorker_2) [homeassistant.components.xiaomi_aqara.switch] Update data from hub: Plug_158d00015adfce 2022-10-13 10:06:20.233 DEBUG (SyncWorker_2) [homeassistant.components.xiaomi_aqara] PUSH >> : {'voltage': 3600, 'status': 'on', 'inuse': '1', 'power_consumed': '256227', 'load_power': '0.89'} 2022-10-13 10:06:50.230 DEBUG (SyncWorker_7) [homeassistant.components.xiaomi_aqara.switch] Update data from hub: Plug_158d00015adfce 2022-10-13 10:06:50.236 DEBUG (SyncWorker_7) [homeassistant.components.xiaomi_aqara] PUSH >> : {'voltage': 3600, 'status': 'on', 'inuse': '1', 'power_consumed': '256227', 'load_power': '0.89'} 2022-10-13 10:07:20.231 DEBUG (SyncWorker_1) [homeassistant.components.xiaomi_aqara.switch] Update data from hub: Plug_158d00015adfce

Additional information

No response

homeassistant commented 1 year ago

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


xiaomi_aqara documentation xiaomi_aqara source (message by IssueLinks)

Wlad2288 commented 1 year ago

I can confirm the issue. My sensors are not getting updated anymore, however, I cannot see any errors in the log files.

Wlad2288 commented 1 year ago

Update: I rolled back to 2022.10.02 but the issue still persists.

I started a separate test instance of HA and configured my gateway from scratch, which was working fine. The sensors are getting updated again.

So, the problem seems to be related to existing gateways, which are configured already. Is there a way to reset the gateway configuration, without losing all existing entities?

Edit: I deleted one of my gateways with less devices and added it again. The sensors are getting only updated once during the start of the integration. After that no updates are shown.

Many Thanks, Wlad

gitrummy commented 1 year ago

I have also had this issue since updating to 2022.10.X, after rolling back to 2022.9.X everything works perfectly again.

romu1234 commented 1 year ago

I can also confirm that the Xiaomi Aqara Gateway has not been reliable since updating. Sensor are updated in the native xiaomi app but not (or highly irregular) in Home Assistant

Wlad2288 commented 1 year ago

After a couple of integration reloads and container restarts, everything seems to be working fine again ... strange.

romu1234 commented 1 year ago

After a couple of integration reloads and container restarts, everything seems to be working fine again ... strange.

Also after a couple of hours? In my installation is looks likes it works after reboot but soon after the door/window sensors are not updated reliable anymore.

Wlad2288 commented 1 year ago

Yes ... working since yesterday evening. But I have to mention I do have mi Gateways and not Aqara.

image

hanunes commented 1 year ago

I have exactly the same as romulder. I also have a Mi Gateway, but the integration is exactly the same, so don't quite know what's going on.

daxingplay commented 1 year ago

I have also had this issue since updating to 2022.10.X, after rolling back to 2022.9.X everything works perfectly again.

I also had this issue and rolling back to 2022.9.7 makes everything works again.

kanemari commented 1 year ago

I think I have a similar / related issue. I only use my xiaomi Gateway for the light switch and light sensor as a night light in automatons. on reboot or restating the integration the entities are there and getting updates but after a while become unavailable and don't respond.

manuelo1983 commented 1 year ago

I also have problems since I have updated to the new version. I use the gateways together with temperature and door sensors.

romu1234 commented 1 year ago

Hi @Danielhiversen, @syssi, can we help in anyway by providing logs or something?

syssi commented 1 year ago

I've compared the traffic between the Aqara Gateway and HA Core 2022.9.7 vs. 2022.10.4. I cannot see any differences.

Please increase the log level of the xiaomi_aqara component and the underlying library by:

logger:
  default: warning
  logs:
    xiaomi_gateway: debug
    homeassistant.components.xiaomi_aqara: debug
    homeassistant.components.sensor.xiaomi_aqara: debug
    homeassistant.components.switch.xiaomi_aqara: debug
    homeassistant.components.binary_sensor: debug
    miio: debug

If you see something like this

DEBUG (Thread-4) [xiaomi_gateway] MCAST (report) << {'cmd': 'report', 'model': 'magnet', 'sid': '158d000116f2bb', 'short_id': 9184, 'data': '{"status":"close"}'}
DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Battery_158d000116f2bb: 43>: {'status': 'close'}
DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Door Window Sensor_158d000116f2bb: on>: {'status': 'close'}
DEBUG (Thread-4) [xiaomi_gateway] MCAST (report) << {'cmd': 'report', 'model': 'magnet', 'sid': '158d000116f2bb', 'short_id': 9184, 'data': '{"status":"open"}'}
DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Battery_158d000116f2bb: 43>: {'status': 'open'}
DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Door Window Sensor_158d000116f2bb: off>: {'status': 'open'}
DEBUG (Thread-4) [xiaomi_gateway] MCAST (report) << {'cmd': 'report', 'model': 'magnet', 'sid': '158d000116f2bb', 'short_id': 9184, 'data': '{"status":"close"}'}
DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Battery_158d000116f2bb: 43>: {'status': 'close'}
DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Door Window Sensor_158d000116f2bb: on>: {'status': 'close'}

you are able to receive and process multicast messages. You could capture some traffic using wireshark/tcpdump too. The multicast messages does look like this:

wireshark

Please capture the traffic at the Home Assistant Core host to be sure Home Assistant is able to receive / see the same traffic.

meichthys commented 1 year ago

@syssi After increasing the logging level as you suggested, I'm only seeing the following Aquara related log after rebooting:

2022-10-16 22:44:18.291 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] Gateway with host '192.168.0.55' connected, listening for broadcasts

meichthys commented 1 year ago

I do see the following in the logs: image Then after all the devices are setup i see this which is the last xiaomi_gateway log: image

It appears that all the devices are setup correctly but the states are not updated afterward even though the listener is started.

meichthys commented 1 year ago

When reverting Home Assistant back to 2022.9.7, I see the devices being updated and the expected PUSH logs: image

syssi commented 1 year ago

@meichthys Could you describe your setup? I tried to reproduce the issue using a python virtualenv install. Do you use a docker setup?

meichthys commented 1 year ago

@syssi I'm running hassos (or whatever it's called these days 😀) on a proxmox vm.

I had not made any configuration changes between upgrading or downgrading. I tried running a packet capture on the hassos machine but I'm not sure how to do it since I don't have access to 'apk' to install tcpdump. Maybe there's a built in too I'm not aware of.

syssi commented 1 year ago

I will setup a hassos instance to reproduce the issue locally.

alosadagrande commented 1 year ago

Same issue running HA on a container, upgrading to 2022.10.x makes my two gateways stop receiving updates from sensors. The mi app is working fine.

At boot time both gateways detect all sensors (temperature, movement, water...) but then no updates are received, only a Xiaomi power switch until they go to an unavailable state.

These are logs from 2022.9.7 where I can see the multicast traffic going back to my gateway:

2022-10-21 08:28:12.081 DEBUG (SyncWorker_9) [xiaomi_gateway] _send_cmd >> b'{ "cmd":"read","sid":"158d00023f3f19"}'
2022-10-21 08:28:12.107 DEBUG (SyncWorker_9) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'plug', 'sid': '158d00023f3f19', 'short_id': 11435, 'data': '{"voltage":3600,"status":"off","inuse":"0","power_consumed":"1728","load_power":"0.00"}'}
2022-10-21 08:28:12.107 DEBUG (SyncWorker_9) [xiaomi_gateway] read_ack << {'cmd': 'read_ack', 'model': 'plug', 'sid': '158d00023f3f19', 'short_id': 11435, 'data': '{"voltage":3600,"status":"off","inuse":"0","power_consumed":"1728","load_power":"0.00"}'}
2022-10-21 08:28:20.709 DEBUG (Thread-3 (_listen_to_msg)) [xiaomi_gateway] MCAST (report) << {'cmd': 'report', 'model': 'weather.v1', 'sid': '158d0006c6e723', 'short_id': 63528, 'data': '{"temperature":"2338"}'}
2022-10-21 08:28:20.715 DEBUG (Thread-3 (_listen_to_msg)) [xiaomi_gateway] MCAST (report) << {'cmd': 'report', 'model': 'weather.v1', 'sid': '158d0006c6e723', 'short_id': 63528, 'data': '{"humidity":"6366"}'}
2022-10-21 08:28:20.718 DEBUG (Thread-3 (_listen_to_msg)) [xiaomi_gateway] MCAST (report) << {'cmd': 'report', 'model': 'weather.v1', 'sid': '158d0006c6e723', 'short_id': 63528, 'data': '{"pressure":"101350"}'}

Here are the logs from 2022.10.5 at initializing time, where the component registers and detects all devices:

2022-10-21 08:44:39.531 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd" : "get_id_list"}'
2022-10-21 08:44:39.556 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'get_id_list_ack', 'sid': '7811dcf7870a', 'token': 'ovdX3bzCbxLKwszi', 'data': '["158d00023f3f19","158d00022efaf4","158d000248846a","158d000272b945","158d0002e95c40","158d0003971d94","158d00063335ae","158d000632ee4e","158d0006c6e723"]'}
2022-10-21 08:44:39.556 INFO (SyncWorker_3) [xiaomi_gateway] Found 10 devices
2022-10-21 08:44:39.557 DEBUG (SyncWorker_3) [xiaomi_gateway] Discovery attempt 1/5
2022-10-21 08:44:39.557 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d00023f3f19"}'
2022-10-21 08:44:39.560 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'plug', 'sid': '158d00023f3f19', 'short_id': 11435, 'data': '{"voltage":3600,"status":"off","inuse":"0","power_consumed":"1728","load_power":"0.00"}'}
2022-10-21 08:44:39.561 DEBUG (SyncWorker_3) [xiaomi_gateway] Registering device 158d00023f3f19, plug as: switch
2022-10-21 08:44:39.562 DEBUG (SyncWorker_3) [xiaomi_gateway] Discovery attempt 1/5
2022-10-21 08:44:39.562 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d00022efaf4"}'
2022-10-21 08:44:39.565 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'magnet', 'sid': '158d00022efaf4', 'short_id': 62655, 'data': '{"voltage":3045,"status":"close"}'}
2022-10-21 08:44:39.566 DEBUG (SyncWorker_3) [xiaomi_gateway] Registering device 158d00022efaf4, magnet as: binary_sensor
2022-10-21 08:44:39.566 DEBUG (SyncWorker_3) [xiaomi_gateway] Discovery attempt 1/5
2022-10-21 08:44:39.567 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d000248846a"}'
2022-10-21 08:44:39.570 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'switch', 'sid': '158d000248846a', 'short_id': 14936, 'data': '{"voltage":3022}'}
2022-10-21 08:44:39.571 DEBUG (SyncWorker_3) [xiaomi_gateway] Registering device 158d000248846a, switch as: binary_sensor
2022-10-21 08:44:39.571 DEBUG (SyncWorker_3) [xiaomi_gateway] Discovery attempt 1/5
2022-10-21 08:44:39.572 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d000272b945"}'
2022-10-21 08:44:39.576 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'sensor_motion.aq2', 'sid': '158d000272b945', 'short_id': 6344, 'data': '{"voltage":3035,"lux":"17"}'}
2022-10-21 08:44:39.577 DEBUG (SyncWorker_3) [xiaomi_gateway] Registering device 158d000272b945, sensor_motion.aq2 as: sensor
2022-10-21 08:44:39.577 DEBUG (SyncWorker_3) [xiaomi_gateway] Registering device 158d000272b945, sensor_motion.aq2 as: binary_sensor
2022-10-21 08:44:39.578 DEBUG (SyncWorker_3) [xiaomi_gateway] Discovery attempt 1/5
2022-10-21 08:44:39.579 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d0002e95c40"}'
2022-10-21 08:44:39.583 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'smoke', 'sid': '158d0002e95c40', 'short_id': 28159, 'data': '{"voltage":3105,"alarm":"0"}'}
2022-10-21 08:44:39.584 DEBUG (SyncWorker_3) [xiaomi_gateway] Registering device 158d0002e95c40, smoke as: binary_sensor
2022-10-21 08:44:39.585 DEBUG (SyncWorker_3) [xiaomi_gateway] Discovery attempt 1/5
2022-10-21 08:44:39.585 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d0003971d94"}'
2022-10-21 08:44:39.589 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'sensor_magnet.aq2', 'sid': '158d0003971d94', 'short_id': 59237, 'data': '{"voltage":3035,"status":"close"}'}
2022-10-21 08:44:39.590 DEBUG (SyncWorker_3) [xiaomi_gateway] Registering device 158d0003971d94, sensor_magnet.aq2 as: binary_sensor
2022-10-21 08:44:39.591 DEBUG (SyncWorker_3) [xiaomi_gateway] Discovery attempt 1/5
2022-10-21 08:44:39.591 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d00063335ae"}'
2022-10-21 08:44:39.599 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'sensor_wleak.aq1', 'sid': '158d00063335ae', 'short_id': 30956, 'data': '{"voltage":3045}'}
2022-10-21 08:44:39.600 DEBUG (SyncWorker_3) [xiaomi_gateway] Registering device 158d00063335ae, sensor_wleak.aq1 as: binary_sensor
2022-10-21 08:44:39.600 DEBUG (SyncWorker_3) [xiaomi_gateway] Discovery attempt 1/5
2022-10-21 08:44:39.601 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d000632ee4e"}'
2022-10-21 08:44:39.604 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'sensor_wleak.aq1', 'sid': '158d000632ee4e', 'short_id': 44708, 'data': '{"voltage":3085}'}
2022-10-21 08:44:39.605 DEBUG (SyncWorker_3) [xiaomi_gateway] Registering device 158d000632ee4e, sensor_wleak.aq1 as: binary_sensor
2022-10-21 08:44:39.605 DEBUG (SyncWorker_3) [xiaomi_gateway] Discovery attempt 1/5
2022-10-21 08:44:39.606 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d0006c6e723"}'
2022-10-21 08:44:39.610 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'weather.v1', 'sid': '158d0006c6e723', 'short_id': 63528, 'data': '{"voltage":2975,"temperature":"2338","humidity":"6366","pressure":"101350"}'}
2022-10-21 08:44:39.610 DEBUG (SyncWorker_3) [xiaomi_gateway] Registering device 158d0006c6e723, weather.v1 as: sensor
2022-10-21 08:44:39.611 DEBUG (SyncWorker_3) [xiaomi_gateway] Discovery attempt 1/5
2022-10-21 08:44:39.611 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"7811dcf7870a"}'
2022-10-21 08:44:39.615 DEBUG (SyncWorker_3) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'gateway', 'sid': '7811dcf7870a', 'short_id': 0, 'data': '{"rgb":0,"illumination":987,"proto_version":"1.1.2"}'}
2022-10-21 08:44:39.615 DEBUG (SyncWorker_3) [xiaomi_gateway] Registering device 7811dcf7870a, gateway as: sensor
2022-10-21 08:44:39.616 DEBUG (SyncWorker_3) [xiaomi_gateway] Registering device 7811dcf7870a, gateway as: light
2022-10-21 08:44:41.540 INFO (MainThread) [xiaomi_gateway] XiaomiMulticast listener started

Then, I only receive the power switch, which by chance it is the first of the array/list in the previous log:

2022-10-21 08:45:44.049 DEBUG (SyncWorker_8) [xiaomi_gateway] _send_cmd >> b'{ "cmd":"read","sid":"158d00023f3f19"}'
2022-10-21 08:45:44.080 DEBUG (SyncWorker_8) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'plug', 'sid': '158d00023f3f19', 'short_id': 11435, 'data': '{"voltage":3600,"status":"off","inuse":"0","power_consumed":"1728","load_power":"0.00"}'}
2022-10-21 08:45:44.080 DEBUG (SyncWorker_8) [xiaomi_gateway] read_ack << {'cmd': 'read_ack', 'model': 'plug', 'sid': '158d00023f3f19', 'short_id': 11435, 'data': '{"voltage":3600,"status":"off","inuse":"0","power_consumed":"1728","load_power":"0.00"}'}

By the way, the gateway light is working fine. I deleted and installed again the addon + gateway config but did not solve the issue. My only valid workaround was going back to 2022.9.7.

Let me know if you need more info.

poldim commented 1 year ago

Also having the same issue. Similar setup to @alosadagrande: HA via container, upgrading to 2022.10.x makes my gateway stop receiving updates from sensors. The mi app is working fine. Downgrading to 2022.9.7 eliminates the issue.

meichthys commented 1 year ago

@poldim @alosadagrande @hanunes Can you all confirm if you are using HassOS (Home Assistant Operating System)? It appears that it is only relevant for HassOS installs, but i could be wrong.

romu1234 commented 1 year ago

@poldim @alosadagrande @hanunes Can you all confirm if you are using HassOS (Home Assistant Operating System)? It appears that it is only relevant for HassOS installs, but i could be wrong.

Confirming hassos for my situation

kanemari commented 1 year ago

im using hass.io on docker. can see a few mentions of similar setups in the comments above so I dont think this is specific to hassos.

alosadagrande commented 1 year ago

Running on a rpi3b+ with Fedora 36 for Edge as OS

NameLessJedi commented 1 year ago

I'm having same problem running ghcr.io/home-assistant/home-assistant:2022.10.3 Had to revert to 2022.9 to make it work again

poldim commented 1 year ago

@poldim @alosadagrande @hanunes

Can you all confirm if you are using HassOS (Home Assistant Operating System)?

It appears that it is only relevant for HassOS installs, but i could be wrong.

No, I'm using the standard docker core container, not hassos: Broken: image: homeassistant/home-assistant:stable Works: image: homeassistant/home-assistant:2022.9.7

anxix commented 1 year ago

Have same thing with 2022.10.5, docker on Ubuntu 20.04, with a China-model Xiaomi gateway. Sensors seem to be detected very briefly after reboot, then stop receiving events and at some point later report being disconnected. These are door and motion sensors. This happened after updating from 2022.9.7 to 2022.10.5, and I had to revert to 2022.9.7 to fix. There they work reliably, as they do in the Xiaomi app. Also tried rebooting the Xiaomi gateway, which did not achieve anything, rebooting the host machine of HA which only made it work immediately after boot as noted above.

There's probably some kind of bug in the async implementation that's switched to in 2022.10, a bit too coincidental otherwise.

meichthys commented 1 year ago

@syssi is there any other kind of logs or info we can provide to help troubleshoot this?

I would just downgrade, but since I rely on the newer HACS version that's not compatible with 2022.9.7, I would break some other things.

gitrummy commented 1 year ago

I restored my backup of 2022.9.X and HACS still works just fine as far as I can tell.

meichthys commented 1 year ago

I upgraded HACS after i updated to 2022.10.1

KmanOz commented 1 year ago

Yes same here on Docker running a new installation of HA could not find the Gateway. I had to manually enter the IP and MAC and it did find it but only ever updates once as above when HA starts. On my main HA (again on Docker) I updated to the the latest as well and there it seems to work OK.

syssi commented 1 year ago

@KmanOz I've been struggling to understand the difference between the two setups.

scoobypt commented 1 year ago

Same with a new installation of HA OS. On my other ha setup on docker updated an is ok so far.

Home Assistant 2022.10.5 Supervisor 2022.10.1 Operating System 9.3 Interface: 20221010.0 - latest I have tried the stable version and now the beta version of ha

KmanOz commented 1 year ago

@KmanOz I've been struggling to understand the difference between the two setups.

@syssi Sorry my bad. One is a completely new setup whereas the other is my standard setup which has been upgraded. Both are running on docker and exactly the same version 2022.10.4. The upgraded one is communicating fine. The new one will only communicate when the server is rebooted and only once. Hope that clears things up.

maciejwrobell commented 1 year ago

I have the same problem after updating any solution?

fastrax commented 1 year ago

Hi Team, I am hoping that this may help someone diagnose the issue. I have rolled back to 2022.9.7 as someone else said they had it working. I am too using Docker on a Ubuntu VM.

I have deleted the integration and reloaded it. I have refreshed the wire communication protocol and password in the old Mi App.

As shown in the image below, it becomes available instantly. The status of the sensors is showing as "off".

Untitled

Hope this perhaps helps! :) I am sure some clever soul will get it fixed!

KmanOz commented 1 year ago

I would just like to add that on my new installation (see above) zeroconf doesn't seem to be working. I tried manually entering zeroconf into the config but it just doesn't find anything on my network. Could this be related in some way?

hanunes commented 1 year ago

I'm not using zeroconf.

romu1234 commented 1 year ago

Never mind - issues still present.

joasara commented 1 year ago

I have the same problem after updating. I am use HASSIO any solution?

gitrummy commented 1 year ago

I upgraded HACS after i updated to 2022.10.1

Yup I did too before eventually rolling back after realising Xiaomi gateway wasn't working. HACS still working even though I saw 2022.10.X as minimum req

fastrax commented 1 year ago

Is there any additional information we can provide to support sorting this? My house is pretty much driven by these motion sensors and door sensors.

syssi commented 1 year ago

I'm still unable to reproduce the issue.I prepared a HA OS setup this morning using the Virtualbox (VDI) + bridged network (the bridged network is important because we must be able to receive multicast traffic) approach: https://www.home-assistant.io/installation/windows/#hypervisor-specific-configuration

The about page of the test setup shows the following versions:

Home Assistant 2022.10.5
Supervisor 2022.10.0
Operating System 9.3
Frontend 20221010.0 - latest

The auto-discovery was able to detect the Aqara Gateway. I've used the "Xiaomi Aqara" tile to setup the integration. I've selected "network device: any", entered the "encryption key" and pressed save. As next step I've prepared a window sensor which is triggered (opened/closed) every 5 seconds. This is what the test bench setup looks like:

a

So far I am able to receive all events:

https://user-images.githubusercontent.com/2735933/198823071-d6f1cc68-6245-4c39-9a23-82611700f952.mp4

meichthys commented 1 year ago

@syssi perhaps If you had a Remote session on one of our machines you could troubleshoot better?

syssi commented 1 year ago

A remote session would be helpful if it's a linux host with root access.

kanemari commented 1 year ago

I'm still unable to reproduce the issue.I prepared a HA OS setup this morning using the Virtualbox (VDI) + bridged network (the bridged network is important because we must be able to receive multicast traffic) approach: https://www.home-assistant.io/installation/windows/#hypervisor-specific-configuration

The about page of the test setup shows the following versions:

Home Assistant 2022.10.5
Supervisor 2022.10.0
Operating System 9.3
Frontend 20221010.0 - latest

The auto-discovery was able to detect the Aqara Gateway. I've used the "Xiaomi Aqara" tile to setup the integration. I've selected "network device: any", entered the "encryption key" and pressed save. As next step I've prepared a window sensor which is triggered (opened/closed) every 5 seconds. This is what the test bench setup looks like:

a

So far I am able to receive all events:

b.mp4

@syssi I think the majority of people can receive events for a little while after start up or restarting the xiaomi integration. I dont know exactly when it stops, but after some time the sensors stop updating and the light switch entity becomes unavailable.

With your testing does it still work after leaving the system idle for an hour or so?

jstride commented 1 year ago

I get this on kubenetes on TrueNAS with a second NIC for the vlan that the Xiaomi gateway is on (that's is set as the default in Home Assistant. I don't get any events on an upgrade/restart.


From: kanemari @.> Sent: Saturday, October 29, 2022 8:00:23 PM To: home-assistant/core @.> Cc: Jake Stride @.>; Manual @.> Subject: Re: [home-assistant/core] Xiaomi Aqara Gateway not receiving events (Issue #80249)

I'm still unable to reproduce the issue.I prepared a HA OS setup this morning using the Virtualbox (VDI) + bridged network (the bridged network is important because we must be able to receive multicast traffic) approach: https://www.home-assistant.io/installation/windows/#hypervisor-specific-configurationhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.home-assistant.io%2Finstallation%2Fwindows%2F%23hypervisor-specific-configuration&data=05%7C01%7C%7C234fe5643fbc43cb4b6b08dab9a52b4d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638026416293497995%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=eN0Aq%2BLjTnPeG3ui2IG%2BTp7zSgub7kDiizWZG4uimXw%3D&reserved=0

The about page of the test setup shows the following versions:

Home Assistant 2022.10.5 Supervisor 2022.10.0 Operating System 9.3 Frontend 20221010.0 - latest

The auto-discovery was able to detect the Aqara Gateway. I've used the "Xiaomi Aqara" tile to setup the integration. I've selected "network device: any", entered the "encryption key" and pressed save. As next step I've prepared a window sensor which is triggered (opened/closed) every 5 seconds. This is what the test bench setup looks like:

[a]https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F2735933%2F198823026-7c8a7710-4448-44fa-852a-44221bba9765.jpg&data=05%7C01%7C%7C234fe5643fbc43cb4b6b08dab9a52b4d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638026416293497995%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=94kJYz6%2BhMd%2FP%2BRScH7HILiWmdgCFaVSrjtgy6TFz98%3D&reserved=0

So far I am able to receive all events:

b.mp4

@syssihttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsyssi&data=05%7C01%7C%7C234fe5643fbc43cb4b6b08dab9a52b4d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638026416293497995%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=XJsqUTmt7NzTl0i7J550%2BSKEq4NX0gQWm7BX%2BPG8X0U%3D&reserved=0 I think the majority of people can receive events for a little while after start up or restarting the xiaomi integration. I dont know exactly when it stops, but after some time the sensors stop updating and the light switch entity becomes unavailable.

With your testing does it still work after leaving the system idle for an hour or so?

— Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fhome-assistant%2Fcore%2Fissues%2F80249%23issuecomment-1295815056&data=05%7C01%7C%7C234fe5643fbc43cb4b6b08dab9a52b4d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638026416293497995%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=L3Ze5UbHyHdUjM%2BUDDpwUdOlpl5R21EnNylbLUWMkZo%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAALOWBSF2MPSYADSRUBMVUDWFUGVPANCNFSM6AAAAAARED6SZQ&data=05%7C01%7C%7C234fe5643fbc43cb4b6b08dab9a52b4d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638026416293497995%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=wwpi2bIcuw2ff55EUWMUuXlWkOUuWBZsRs90cd4xUh4%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>

syssi commented 1 year ago

My setup is still running without issues:

c

I've unplugged the Xiaomi Gateway once. I haven't rebootet the HA instance yet.