Xiaomi Gateway and ghost device

Recently, I started to move all my Xiaomi sensor/device from The Gateway Xiamoi to Zigbee2mqtt.

I am in the middle of this, so I have an hybrid situation:
plugs and windows sensors are on the mqtt
movement sensors are still on the xiaomi gw.

This Aqara plug is already on mqtt and it’s working but HA, also, still see it with the discover enabled.
If the Gateway is on when HA restart I find these lines in my core.entity_registry:

    {
        "config_entry_id": null,
        "device_id": null,
        "disabled_by": null,
        "entity_id": "switch.plug_158d0001bc2dbe",
        "name": null,
        "platform": "xiaomi_aqara",
        "unique_id": "status158d0001bc2dbe"
    }

With the gateway disconnected I don’t see it anymore.
In the MiHome app I already disconnected the plug and I don’t see it on any server.

EDIT:
I try to delete every row with enitity_id=‘switch.plug_158d0001bc2dbe’ from the DB, but it still pops up.

How to get rid of it ?

Is there a way to delete an entity or, at least, say to HA: “Don’t check this entity?”
My log is filled by :

Update of switch.plug_158d0001bc2dbe is taking over 10 seconds

Of course it takes more than 10 seconds: it doesn’t exit, anymore! :rofl:

did you manage to resolve this issue? I got the same issue. deleted 3 plugs (both from xiaomi and HA entity registry) but they keep showing up in HA. driving me mad.

Nope!
Still there after all these months!
Almost forgot… :innocent:

Ok, i figured, you can remove those orphan devices with xiaomi.remove service call. Important thing is, if you have more than one hub, you need to call the service for each hub.

1 Like

Hi! I have the same issues and it persists even after using the remove device service. I have a few aqara light switches and after removing them both in the app and using home assistant service, i can still see them in the app.

The issue is, when i relocate them to another hub, it still shows up under the integration of the original hub.

Any suggestions on how to clean this up?

hello.
I have the same problem.
I migrate from xiaomi aqara to zigbee2mqtt. and i dont want to delete the aqara integration because i use the gateway as light and speaker.
But the integration have a lot of devices.
If i run the service xiaomi.remove in each gateway (i have 3). nothings happen. the device still present

Did you managed to get yours sorted? I am facing same issue now that I have migrated some devices to Z2M. The “Xiaomi Gateway (Aqara): Remove device” does not seem to remove anything.

i delete all the devices in xiaomi app. and the i delete de xiaomi gateway in home assistant, and add again.
This works for me, nothing other option works :frowning:

Wow! Looks like I will only do this after I fully migrate whatever I want to Z2M. I was also thinking to delete them from core.entity_registry but was a little afraid it might mess things up. Thanks @DAVIZINHO

1 Like