Xiaomi Aqara Gateway - Got error element in data {"error":"Invalid key"}

Since last night my Xiaomi Wireless buttons have stopped working.

I can see a number of “Got error element in data {“error”:“Invalid key”}” errors in my logs.

I’ve tried

  • update HA to latest version 0.103.6
  • testing the buttons work in MiHome app
  • resetting the key in Mihome app

I can trigger the xiaomi_aqara.play_ringtone service without any errors but my Buttons and Door Sensors are not working.

Any ideas?

I also get this same error in logfile, however my Aqara temperature sensors stop reporting and buttons stop working. Temporary fix is to restart HA, until it breaks again.

i got this configuration:

######################################################
#                                                    #
# Xiaomi configuratie
#                                                    #
######################################################

xiaomi_aqara:
  discovery_retry: 5
  gateways:
    - key: !secret xiaomi_key

where did you retreive your key ?

Hi,

I have the same problem since yesterday
My sensors aren’t reporting anymore : “invalid key”
So I restart HA and it works again for a while, until it breaks again :confused:

Any ideas ?

EDIT : Gateway light control is still working, only sensors aren’t reporting
EDIT 2 : I tried to change my key, but the problem is still there… it works for 2 minutes and then it brokes.

I managed to fix mine by rebooting my wifi AP. I determined it was a wifi problem by looking in the mihome app which showed high packet loss.

Not sure what was upsetting the Wifi because rebooting the Gateway didn’t solve it. It needed a wifi reboot.

After some tests, it still doesn’t work

I tried to reboot my WiFi AP, I tried to switch WiFi channels…
Nothing helped

I don’t think that it’s a connexion problem because it works well using Mi Home Application.

Since yesterday afternoon everything is working again and it still works today…
I didn’t do anything, I wasn’t at home :upside_down_face:
Nothing has changed

“Informatic is magic” :sweat_smile:

I have the same problem: the gateway is discovered, but all sensors doesn’t work.

Using HA on virtualbox.

Any time I turn on the gateway light (that works), this message appears in the log:

Logger: xiaomi_gateway
Source: /usr/local/lib/python3.8/site-packages/xiaomi_gateway/__init__.py:432
First occurred: 19:05:15 (2 occurrences)
Last logged: 19:06:47

Got error element in data {"error":"Invalid key"}'

Someone have found a solution?

Thanks

And here I am in 2022 having this problem - but only since 2022.6.0

Has this ever been resolved?

My openhab installation on my raspberry pi is working great. I am a noobie on Home Assistant, and all I get is battery status at first, then …

Got error element in data {“error”:“Invalid key”}

One note, is I am running a dual network. wired and wireless. I want to set my wireless connection to default but don’t know how.

Craig