Hassio missing Xiaomi sensor update/event

Hello everybody,

I am using Hassio on a raspi and I am really enjoying it so far.
I have different aqara sensors (temperature, door, switch) all connected to the Xiaomi gateway. I see all the sensors in Hassio but it seems that sometimes (and quite often) I am missing update for the gateway:

  • For example, I have a node red automation script that do stuff when the aqara switch is clicked. Well maybe 2 out of 3 times I clicked the switch, nothing happens in Home assistant.
  • When I open a door with a sensor, sometimes the state of the door doesn’t change in home assistant (it keeps displaying the door closed).

I have the xiaomi android app and I see every event in there so it is not a problem with the sensors.

Any idea what this could be ?

Thanks,
Nico

I’ve had issues like this in the past.

Short story: I setup a second RPi with Hassio purley for Node Red and everything works flawsley.

Longer Story:
After months of head scratching and moving my Xiaomi Gateway next to my router incase it was a WiFi signal issue I tripped over a post where the general feeling was Node Red wasn’t quite as quick to respond as automations.
With further testing I moved some back to automations, which worked as expected but with a small delay. I then completely disabled Node Red and delays in my automations were gone.
Still bugging me because of the flexibility Node Red offers i found the Events: All node was just triggering way to often.
The Events: All node is now setup to filter button clicks, which may be enough without the second RPi
Capture
Not sure if it makes much difference but I only have the node in once and use a switch for all buttons then use links where I want separate flows.

Things to keep in mind.

  • WiFi signal on the Xiaomi Gateway
  • Distance of Xiaomi devices from the gateway
  • WiFi Channel if you can change it to 1 or 6, 11 Will interfere with the Zigbee network
  • RPi Resources. Incase you had the same issue as me

Thanks for your reply,

It’s a shame that getting rid of node red did the trick for you, I like it …
I have the event type set exactly as yours with a switch after.

When the events are triggered, there is, indeed, some delay but nothing I can’t live with. My main problem is updates (like button clicks or door sensor status) that never arrive into Home assistant, like the message is lost somehow.

For the other points:

  • The gateway and the RPI are very close to each other and to my router, so wifi signal shouldn’t be an issue
  • The most distant sensor is maybe 10 meters away from the gateway and I don’t have thick walls (and there is no problem with the xiaomi app).
  • Wifi channel was set to auto and it seems it was on the 11th channel. I changed that, we’ll see … :slight_smile:

For me getting rid of node red was a short term solution just to remove a layer of complexity. However i only really struggled with the buttons. You mentioned sensors, which sounds like your zigbee network could have been the issue. Channel 11 definitely interferes with zigbee mesh so hopefully that will solve your issue.

My main problem is updates (like button clicks or door sensor status) that never arrive into Home assistant, like the message is lost somehow.

Another conformation of this being a zigbee mesh issue that would be if the MiHome app struggled to see the changes in sensors too.

If OP is having similar problems with me, i dont think zigbee issues is the reason why it s not updating.
Xiaomi app update just fine. It is just hassio not getting/not showing update timely.