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

xiaomi_aqara: Invalid config in frontend, component failed to initialize #17629

Closed martinfrancois closed 5 years ago

martinfrancois commented 5 years ago

Home Assistant release with the issue: 0.80.2

Last working Home Assistant release (if known): 0.78.x

Operating environment (Hass.io/Docker/Windows/etc.): Hass.io

Component/platform: xiaomi-aqara

Description of problem: I didn't change the config in a while, still after updating IIRC to 0.79.x and still with 0.80.2 in the frontend, it says: Invalid config and Please check your config. However, if I check my config in the Configuration validation it says Configuration valid!. Additionally, everything I have setup related to xiaomi-aqara is currently not working. No sensors are recognized, no switches trigger automations. I checked my xiaomi key and it is still the same as in the app. I can see the gateway without issues in the app and see the state of the individual sensors.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

xiaomi_aqara:
  gateways:
    - key: !secret xiaomi_key

Traceback (if applicable):

2018-10-19 19:22:18 INFO (MainThread) [homeassistant.loader] Loaded xiaomi_aqara from homeassistant.components.xiaomi_aqara
2018-10-19 19:22:18 INFO (MainThread) [homeassistant.setup] Setting up xiaomi_aqara
2018-10-19 19:22:18 INFO (SyncWorker_1) [homeassistant.components.xiaomi_aqara] Discovering Xiaomi Gateways (Try 1)
2018-10-19 19:22:23 INFO (SyncWorker_1) [homeassistant.components.xiaomi_aqara] Discovering Xiaomi Gateways (Try 2)
2018-10-19 19:22:28 WARNING (MainThread) [homeassistant.setup] Setup of xiaomi_aqara is taking over 10 seconds.
2018-10-19 19:22:28 INFO (SyncWorker_1) [xiaomi_gateway] Gateway discovery finished in 5 seconds
2018-10-19 19:22:28 INFO (SyncWorker_1) [homeassistant.components.xiaomi_aqara] Discovering Xiaomi Gateways (Try 3)
2018-10-19 19:22:33 INFO (SyncWorker_1) [xiaomi_gateway] Gateway discovery finished in 5 seconds
2018-10-19 19:22:33 ERROR (SyncWorker_1) [homeassistant.components.xiaomi_aqara] No gateway discovered
2018-10-19 19:22:33 INFO (MainThread) [homeassistant.setup] Setup of domain xiaomi_aqara took 15.5 seconds.
2018-10-19 19:22:33 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi_aqara: Component failed to initialize.
2018-10-19 19:22:33 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 22.41s
2018-10-19 19:22:33 INFO (MainThread) [homeassistant.core] Starting Home Assistant

Additional information:

dshokouhi commented 5 years ago

Looks like it had an issue discovering the gateway, did anything change on your network recently? Discovery of the gateway requires your router to support multicast. You can also try to define your mac or host as well.

hliang0813 commented 5 years ago

Same problem, after updated firmwire of Xiaomi Gateway. Seems like protocol changed ?

martinfrancois commented 5 years ago

So, I noticed that indeed without my knowledge some things in my network changed... Defining the mac address in the config didn't help (at least not on its own), I also had to change things around in my network. I think what is most likely, is that having home assisstant in a different subnet than the xiaomi gateway caused it not to work. But now it works again, so thanks!