My NAS Docker jacobalberty/unifi image auto updated this afternoon using Watchtower and at the same time, my Aqara Gateway dropped off of Home Assistant and the Mi Home App. I’'ve reset the gateway and tried adding it to both of my SSID’s (using the Mi app) without success even though the controller shows it as a connected client and it can be pinged.
For testing, I got out my 4G WiFi router and reset the Aqara Gateway again and this time tried joining it to that and it connected first time and appeared in the Mi Home app as a device.
Anyone with with both a 5.10.24 controller and Aqara Hub having issues?
FYI, my Aqara hub is now working again in HA except for power monitoring from my Xiaomi Zigbee switches. The attributes are showing as:
I cannot get the gateway to connect back to the Mi Home app so I have no devices in their at all and unable to check the power stats that way.
P.S Also upgraded to 0.93.2 today so don’t know if that is related.
[EDIT] Spoiler. If you have issues with your Mi Home app pairing with your xiaomi hub, make sure your network DNS is set 1.1.1.1 or 8.8.8.8 etc as my issue was related to that. I had the Adblock Home add-on as the DNS an no way I could get it to pair. Changed DNS and instantly paired. I’m still stuck with HA seeing the hub but that’s a whole nother story.
Me but not only since today but 4-5 days… My gateway is working fine on Xiaomi home but not find in home assistant… (H.A 0.93.2 and Gateway 2.75.3 it’s a MIJIA v2 and aqara sensors)
Thanks. I’ve traced the problem to the Adguard Home add-on. With my DNS pointing to that, no way the Mi Home app will complete the setup process even though the gateway does actually connect to my network.
With all my mucking around though, it seems I’ve factory restored the hub and now not only do I have to re-pair 30 devices, HA will no longer connect to it even though I’ve updated the key.
Prior to my messing with the gateway and resetting it 38 times, I only had the key defined and it’s been working fine for 2yrs! Now it just does not want to connect to HA. The gateway can be pinged and is showing in my UniFi controller on that (fixed) IP address. The Mi Home app can control it and I’ve turned the LAN control on and off and reset the key several times, always updating it in my secrets file.
Is it possible the original key is persistently stored somewhere preventing connection with the new key?
When you say it doens’t want to connect - are there any errors (either the standard log, or in the syslog if you get stuff there)? Does the xiaomi_aqara.play_ringtone service show in dev_service? Does it work?
2019-05-30 17:19:02 WARNING (MainThread) [homeassistant.setup] Setup of xiaomi_aqara is taking over 10 seconds.
2019-05-30 17:19:07 ERROR (SyncWorker_12) [homeassistant.components.xiaomi_aqara] No gateway discovered
2019-05-30 17:19:07 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi_aqara: Component failed to initialize.
Where do I get the syslog from? I have no xiaomi services available at all. It was working this morning when I was trying to get the gateway to initialise in the Mi Home app and once I removed Adguard Home as the DNS, Mi Home app connected and added the gateway straight away. Seems like that at that time though, it dropped off from HA never to be seen again. I’ve tried adding the MAC, Host etc and nothing works. Maybe my gateway has died?
Seriously, you should check the troubleshooting part of the docs. The error you get has nothing to do with the key but indicates there is a connection problem:
That means that Home Assistant is not getting any response from your Xiaomi gateway. Might be a local network problem or your firewall.
Are you sure host is correct, try to remove it as it disables multicast discovery.
Thanks. I removed the host and just left the key as that they way it was for the last 2yrs but still no go. Something obviously going on with my UniFi network or the gateway itself.
depends on the platform - on my virtenv direct install on ubuntu, there is a bucket load of extra logging in /var/log/syslog that I dont get in the homeassistant.log
walaj@JonLabNUC:/home/homeassistant/.homeassistant/automations$ cat /var/log/syslog|grep hass|tail -10
May 30 18:12:55 JonLabNUC hass[14441]: 2019-05-30 18:12:55 INFO (MainThread) [homeassistant.helpers.script] Script battery_sensor_from_attributes: Running script
May 30 18:12:55 JonLabNUC hass[14441]: 2019-05-30 18:12:55 INFO (MainThread) [homeassistant.helpers.script] Script battery_sensor_from_attributes: Executing step call service
May 30 18:12:55 JonLabNUC hass[14441]: 2019-05-30 18:12:55 INFO (MainThread) [homeassistant.components.mqtt.discovery] Component has already been discovered: sensor plug_158d0002431039_battery, sending update
May 30 18:12:55 JonLabNUC hass[14441]: 2019-05-30 18:12:55 INFO (MainThread) [homeassistant.helpers.script] Script battery_sensor_from_attributes: Executing step call service
May 30 18:12:55 JonLabNUC hass[14441]: 2019-05-30 18:12:55 INFO (MainThread) [homeassistant.components.mqtt] Got update for entity with hash: ('sensor', 'plug_158d0002431039_battery') '{'name': 'WashingMachine Battery', 'state_topic': 'homeassistant/sensor/plug_158d0002431039_battery/state', 'value_template': '{{ value_json.value | int }}', 'unit_of_measurement': '%', 'device_class': 'battery', 'unique_id': 'plug_158d0002431039_battery', 'json_attributes_topic': 'homeassistant/sensor/plug_158d0002431039_battery/attributes', 'platform': 'mqtt', 'discovery_hash': ('sensor', 'plug_158d0002431039_battery')}'
May 30 18:12:55 JonLabNUC hass[14441]: 2019-05-30 18:12:55 INFO (MainThread) [homeassistant.components.mqtt] Updating component: sensor.washingmachine_battery
May 30 18:12:55 JonLabNUC hass[14441]: 2019-05-30 18:12:55 INFO (MainThread) [homeassistant.helpers.script] Script battery_sensor_from_attributes: Executing step call service
May 30 18:13:00 JonLabNUC hass[14441]: 2019-05-30 18:13:00 INFO (MainThread) [homeassistant.components.automation] Executing update_battery_status_group_members
May 30 18:13:00 JonLabNUC hass[14441]: 2019-05-30 18:13:00 INFO (MainThread) [homeassistant.helpers.script] Script update_battery_status_group_members: Running script
May 30 18:13:00 JonLabNUC hass[14441]: 2019-05-30 18:13:00 INFO (MainThread) [homeassistant.helpers.script] Script update_battery_status_group_members: Executing step call service
Probably not relevant since you’ve commented it out, but if it’s not commented out in your actual config then you have a dash before the “mac” part of your config.
My own aqara config looks as below (not real MAC values):
Is the MAC only required if you have multiple gateways?
Also might be no harm to double check the MAC value on the gateway itself and in ubiquiti. I could swear I’ve seen the MAC change for some chinese devices when I’ve hard reset them.
EDIT: also you have Xiaomi spelt incorrectly in your reference to your secrets file; is this the same spelling in the actual secrets file as well? Could be you’re not providing a valid key at all.
Thanks. I’ve tried adding all those (and fixing my spelling mistake) along with a retry at 25 but still not working even though I can ping the Aqara gateway. I’m going to try and downgrade my entire UniFi network even though it was working yesterday morning with the current firmware before I hard reset the Aqara. There is a bit of chatter on the UniFi forums about 4.0.42.10433 so I’ll give that a go.