Aqara keeps giving me this erorr: 'Invalid key' not in resp['data']['error'])

Hi guys,
I’m trying to get my aqara gateway connected with ha but I keep getting this error: ‘Invalid key’ not in resp[‘data’][‘error’]): TypeError: string indices must be integers.
Here’s my config:
xiaomi_aqara:
gateways:
- host: 192.168.xxx.xxx
mac: xx:11:DC:xx:xx:68
key: crxxxxxlrzaawlzk
Ha is running in a virtual env on linux. I tried installing ha on windows and the gateway works fine, but when I run ha on linux it stops working. It works for a split second when ha starts and then it keeps giving me that error. It only reads the sensors when ha starts, I need to restart ha all the time to get new readings.
Please help it’s driving me nuts.

Can you try this:

xiaomi_aqara:
  gateways:
    - mac:
      key: crxxxxxlrzaawlzk

So leave the mac empty and remove the host part.

Now I get:
Invalid config

The following components and platforms could not be set up:

xiaomi-aqara

2018-01-15 21:58:42 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi_aqara: Component failed to initialize.

Maybe you can have a look in this topics which seems to have some relevant info for your case.
PyXiaomiGateway Problem: {"error":"Invalid key"}.
Xiaomi gateway integration - help needed.