Downgraded all wireless and switches, still no go. Tried every combination of key, mac, host without success. Can ping gateway and control it from Mi Home App. Re-generated api key several times in app, updated config and restarted, still no go. Lost now.
I’ve now ordered a Conbee II from Amazon so I’ll be offline with 30 odd sensors for 2 weeks while I await its arrival. Be nice not to have to rely on the Xiaomi Hub.
Yep, it seems the gateway reset has screwed it up. In my efforts to get it talking to the Mi Home app which wasn’t really necessary now that I think about it, HA will no longer talk to it. I even sparked up another HA instance on a Pi to test and that couldn’t see it either. Lesson learnt. If it ain’t broke…
I’ll switch to Deconz and see if that is a better long-term solution.
Nope, nothing useful when I changed the log to debug. I had the same issue with non-visibility of the xiaomi hub when I tried installing HA in Docker on my NAS many months ago. It’s the reason I gave up with Docker for HA and Node Red.
I’m now running HassOS on NUC i3 and apart from this (not so little) issue today, it’s been rock solid.
SOLVED! Turns out an update effects the gateway when it’s reset or something along those lines and the UDP ports required for HA access get closed.
From a Linux machine on the network, run this command.
sudo nmap -sU 192.168.xx.xx -p 9898,4321
If both ports say closed, you have to crack the unit open, solder three wires and connect a serial converter to send it a command via PuTTy. Fortunately I’m a hardware guy and I’ve flashed many Sonoff’s and other devices so I’m well versed at this.
There is also another HA thread with tons of information on this issue here.
Once done, you should get the following back:
pi@pi-plantgateway:~ $ sudo nmap -sU 10.0.1.20 -p 9898,4321
Starting Nmap 7.40 ( https://nmap.org ) at 2019-06-01 23:34 NZST
Nmap scan report for 10.0.1.20
Host is up (-0.12s latency).
PORT STATE SERVICE
4321/udp open|filtered rwhois
9898/udp open monkeycom
MAC Address: 34:CE:00:00:00:00 (Unknown)
Glad you got it sorted. So resetting your hub switched off the developer mode, and when enabling developer mode again the firmware bug was preventing the ports from being opened? I had thought that developer mode was persistent across a reset, so that’s a bummer.
I’ll have to keep the SSID of my network the same so I don’t ever have to reset the device… Although I’ve soldered and flashed sonoffs, my actual soldering skills aren’t that great and I don’t like the idea of connecting a mains-powered device to my laptop USB port.
I lost track as I reset the damn Aqara gateway so many times trying to get it working. I had two issues.
After resetting, I could not get the gateway to appear in the mi Home app even though it was actually connected to my network. This was DNS related and your DNS should ideally be 8.8.8.8 when joining the gateway to the app.
My 2nd issue was lack of visibility to HA which turns out to be blocked port so after one of the resets, the ports got blocked and I didn’t realise.
A simply soft 5s soft network reset may not result in the problems I encountered?
N.B As a side note, my colours on my gateway light are now back to front after the reset. Red is Blue and vice versa so something went screwy.
I rebuilt my Home Assistant server in an attempt to resolve some folder and file permission errors as well as cleaning up old code. I followed a different guide than the one I had used before. I could see the gateway, I could turn the light on and off, and my temperature and door sensors would read at startup, but then refuse to update.
The solution was my Docker-compose YAML file.
My old config had