Using two Xiaomi Gateways
Moderator: leecollings
-
- Posts: 200
- Joined: Wednesday 20 November 2013 20:36
- Target OS: Linux
- Domoticz version:
- Location: The Netherlands
- Contact:
Using two Xiaomi Gateways
Hi Guys,
I am using already one Xiaomi Gateway which I am absolute happy with. I wanted to add another, but I do not seem to get it working. I tried the tip in the WiKi (https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)) but It did not work.
I have the 2nd gateway setup and working in the Xiaomi Home app.I disabled the first gateway within Domoticz. Then added the 2nd one. I enabled the first one and rebooted. While I am not receiving ay errors within the Domoticz log. I do not seem to receive a temp sensor from the 2nd Gateway. Can Domoticz handle both gateways on the same port (9898)? Or maybe somebody has an idea?
I am using already one Xiaomi Gateway which I am absolute happy with. I wanted to add another, but I do not seem to get it working. I tried the tip in the WiKi (https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)) but It did not work.
I have the 2nd gateway setup and working in the Xiaomi Home app.I disabled the first gateway within Domoticz. Then added the 2nd one. I enabled the first one and rebooted. While I am not receiving ay errors within the Domoticz log. I do not seem to receive a temp sensor from the 2nd Gateway. Can Domoticz handle both gateways on the same port (9898)? Or maybe somebody has an idea?
- sincze
- Posts: 1302
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Using two Xiaomi Gateways
I followed the wiki and 2 gateways each with their own sensors work excellent.
Had to 'enable new hardware for 5 minutes' in the settings to get the devices in Domoticz.
Had to 'enable new hardware for 5 minutes' in the settings to get the devices in Domoticz.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 200
- Joined: Wednesday 20 November 2013 20:36
- Target OS: Linux
- Domoticz version:
- Location: The Netherlands
- Contact:
Re: Using two Xiaomi Gateways
Thanks for your feedback! Great to hear it is working correctly for you!sincze wrote:I followed the wiki and 2 gateways each with their own sensors work excellent.
Had to 'enable new hardware for 5 minutes' in the settings to get the devices in Domoticz.
I know actually am receiving a few of these ertoe messages about the 2nd Gateway:
Code: Select all
2019-06-12 23:18:19.771 Error: XiaomiGateway: received data from unregisted gateway!
Anybody knows anything?
Verzonden vanaf mijn iPhone met Tapatalk
-
- Posts: 39
- Joined: Saturday 09 April 2016 13:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Using two Xiaomi Gateways
I have 3 gateways and am receiving this error on the latest beta's for months now. Everything seems to work ok. Couldn't solve it until now.krizzz wrote: ↑Wednesday 12 June 2019 23:25Thanks for your feedback! Great to hear it is working correctly for you!sincze wrote:I followed the wiki and 2 gateways each with their own sensors work excellent.
Had to 'enable new hardware for 5 minutes' in the settings to get the devices in Domoticz.
I know actually am receiving a few of these ertoe messages about the 2nd Gateway:
I have clicked the “accept new hardware devices” button but do not seem to find any new devices. What is strange to me is the message above. I have added the 2nd gateway to Domoticz already. Why is it mentioning that it is an unregisted (spot the typo) gateway.Code: Select all
2019-06-12 23:18:19.771 Error: XiaomiGateway: received data from unregisted gateway!
Anybody knows anything?
Verzonden vanaf mijn iPhone met Tapatalk
-
- Posts: 200
- Joined: Wednesday 20 November 2013 20:36
- Target OS: Linux
- Domoticz version:
- Location: The Netherlands
- Contact:
Re: Using two Xiaomi Gateways
Do you mean that you have currently 3 working Gateways? What did you do exactly to get it working?tezzlicious wrote:I have 3 gateways and am receiving this error on the latest beta's for months now. Everything seems to work ok. Couldn't solve it until now.krizzz wrote: ↑Wednesday 12 June 2019 23:25Thanks for your feedback! Great to hear it is working correctly for you!sincze wrote:I followed the wiki and 2 gateways each with their own sensors work excellent.
Had to 'enable new hardware for 5 minutes' in the settings to get the devices in Domoticz.
I know actually am receiving a few of these ertoe messages about the 2nd Gateway:
I have clicked the “accept new hardware devices” button but do not seem to find any new devices. What is strange to me is the message above. I have added the 2nd gateway to Domoticz already. Why is it mentioning that it is an unregisted (spot the typo) gateway.Code: Select all
2019-06-12 23:18:19.771 Error: XiaomiGateway: received data from unregisted gateway!
Anybody knows anything?
Verzonden vanaf mijn iPhone met Tapatalk
Verzonden vanaf mijn iPhone met Tapatalk
- sincze
- Posts: 1302
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Using two Xiaomi Gateways
First I enable new hardware for 5 minutes.
Then I paired a new motion or door sensor with one of the gateways and the new sensor showed up under devices and in the Domoticz log
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 11
- Joined: Friday 04 May 2018 10:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Using two Xiaomi Gateways
Thank you.
The problem is that I don't even see the second gateway itself between the devices. (I mean light,alarm,doorbell, etc)
The problem is that I don't even see the second gateway itself between the devices. (I mean light,alarm,doorbell, etc)
- sincze
- Posts: 1302
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Using two Xiaomi Gateways
Aha :/
Mmm first I added gateway 1.
Device showed up.
Disabled first gateway.
Restart Domoticz
Again enable new hardware.
Added second gateway.
It showed up

Enabled first gateway again
Restarted Domoticz
And I was up and running.
After that I started to add sensors to each gateway by:
Enable new hardware 5 minutes
Press the gw button 3 times
Press the small whole or button on the sensor.
Chinese bla bla from the gateway.
And my new sensor showed up

Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 11
- Joined: Friday 04 May 2018 10:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Using two Xiaomi Gateways
When I add the second gateway all I see in the log filtered with "gateway" word, is:
2019-08-08 18:14:11.947 Status: XiaomiGateway (ID=13): Delaying worker startup...
2019-08-08 18:14:16.947 Status: XiaomiGateway (ID=13): Selected as main Gateway
and anything new shows up in the device list

ps: the first gateway has ID=4
ps2: "enable new hardware" checked in domoticz settings
2019-08-08 18:14:11.947 Status: XiaomiGateway (ID=13): Delaying worker startup...
2019-08-08 18:14:16.947 Status: XiaomiGateway (ID=13): Selected as main Gateway
and anything new shows up in the device list

ps: the first gateway has ID=4
ps2: "enable new hardware" checked in domoticz settings
-
- Posts: 200
- Joined: Wednesday 20 November 2013 20:36
- Target OS: Linux
- Domoticz version:
- Location: The Netherlands
- Contact:
Re: Using two Xiaomi Gateways
So, I did the same procedure as mentioned a few posts above. I keep getting the error:
Verzonden vanaf mijn iPhone met Tapatalk
Code: Select all
ERROR Xiaomi Gateway: recieved data from unregisterd gateway
Verzonden vanaf mijn iPhone met Tapatalk
-
- Posts: 11
- Joined: Friday 04 May 2018 10:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Using two Xiaomi Gateways
same as me:krizzz wrote: ↑Friday 09 August 2019 19:12 So, I did the same procedure as mentioned a few posts above. I keep getting the error:Code: Select all
ERROR Xiaomi Gateway: recieved data from unregisterd gateway
Verzonden vanaf mijn iPhone met Tapatalk
2019-08-10 12:54:38.580 Status: XiaomiGateway (ID=13): Delaying worker startup...
2019-08-10 12:54:43.580 Status: XiaomiGateway (ID=13): Selected as main Gateway
2019-08-10 12:54:43.580 Status: XiaomiGateway (ID=13): Worker started...
2019-08-10 12:54:43.581 Status: XiaomiGateway (ID=13): Using 192.168.0.18 for local IP address.
2019-08-10 12:54:43.697 Error: XiaomiGateway: received data from unregisted gateway!
it looks like domoticz see the second gateway but cannot use it, and in the meanwhile it keeps receiveing messages from the first one
-
- Posts: 11
- Joined: Friday 04 May 2018 10:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Using two Xiaomi Gateways
I found the problem. Newer Xiaomi Gateways have port 9898 closed:
Starting Nmap 7.80 ( https://nmap.org ) at 2019-08-10 14:21 ora legale Europa occidentale
Nmap scan report for 192.168.0.29
Host is up (0.024s latency).
PORT STATE SERVICE
4321/udp closed rwhois
9898/udp closed monkeycom
MAC Address: 04:CF:8C:A1:30:82 (Xiaomi Electronics,co.)
Nmap done: 1 IP address (1 host up) scanned in 0.70 seconds
This is the older one I have already:
Starting Nmap 7.80 ( https://nmap.org ) at 2019-08-10 14:23 ora legale Europa occidentale
Nmap scan report for 192.168.0.9
Host is up (0.014s latency).
PORT STATE SERVICE
4321/udp open|filtered rwhois
9898/udp open monkeycom
MAC Address: 34:CE:00:91:F6:BC (Xiaomi Electronics,co.)
Nmap done: 1 IP address (1 host up) scanned in 1.90 seconds
Domoticz sunset.
Starting Nmap 7.80 ( https://nmap.org ) at 2019-08-10 14:21 ora legale Europa occidentale
Nmap scan report for 192.168.0.29
Host is up (0.024s latency).
PORT STATE SERVICE
4321/udp closed rwhois
9898/udp closed monkeycom
MAC Address: 04:CF:8C:A1:30:82 (Xiaomi Electronics,co.)
Nmap done: 1 IP address (1 host up) scanned in 0.70 seconds
This is the older one I have already:
Starting Nmap 7.80 ( https://nmap.org ) at 2019-08-10 14:23 ora legale Europa occidentale
Nmap scan report for 192.168.0.9
Host is up (0.014s latency).
PORT STATE SERVICE
4321/udp open|filtered rwhois
9898/udp open monkeycom
MAC Address: 34:CE:00:91:F6:BC (Xiaomi Electronics,co.)
Nmap done: 1 IP address (1 host up) scanned in 1.90 seconds
Domoticz sunset.
-
- Posts: 200
- Joined: Wednesday 20 November 2013 20:36
- Target OS: Linux
- Domoticz version:
- Location: The Netherlands
- Contact:
Re: Using two Xiaomi Gateways
Oh wow, good find! But now what 
Verzonden vanaf mijn iPhone met Tapatalk

Verzonden vanaf mijn iPhone met Tapatalk
-
- Posts: 11
- Joined: Friday 04 May 2018 10:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Using two Xiaomi Gateways
https://r.tapatalk.com/shareLink?url=ht ... are_type=t
We have to solder
Inviato dal mio Le X52x utilizzando Tapatalk
We have to solder
Inviato dal mio Le X52x utilizzando Tapatalk
-
- Posts: 11
- Joined: Friday 04 May 2018 10:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Using two Xiaomi Gateways
updated: I bought another one to make another try: DO NOT UPDATE your new gateway! FIRST enable the lan control (maybe check if the 9898 port is open), then update the firmware. If you update the firmware before enabling lan control, it will no longer be possible
-
- Posts: 200
- Joined: Wednesday 20 November 2013 20:36
- Target OS: Linux
- Domoticz version:
- Location: The Netherlands
- Contact:
Using two Xiaomi Gateways
And updating after enabling lan control is no problem?ilfavi wrote:updated: I bought another one to make another try: DO NOT UPDATE your new gateway! FIRST enable the lan control (maybe check if the 9898 port is open), then update the firmware. If you update the firmware before enabling lan control, it will no longer be possible
You ordered a Gateway V2?
Verzonden vanaf mijn iPhone met Tapatalk
-
- Posts: 11
- Joined: Friday 04 May 2018 10:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Using two Xiaomi Gateways
The lan control remains enabled after firmware updates. Both my gateways are V3, the old one and the new one.
-
- Posts: 200
- Joined: Wednesday 20 November 2013 20:36
- Target OS: Linux
- Domoticz version:
- Location: The Netherlands
- Contact:
Re: Using two Xiaomi Gateways
And you do not recieve the strange error in Dominica Aboutaleb receiving data from a unregisterd Gateway?
Verzonden vanaf mijn iPhone met Tapatalk
Verzonden vanaf mijn iPhone met Tapatalk
- sincze
- Posts: 1302
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Using two Xiaomi Gateways
Nice find!ilfavi wrote: ↑Friday 06 September 2019 22:39 updated: I bought another one to make another try: DO NOT UPDATE your new gateway! FIRST enable the lan control (maybe check if the 9898 port is open), then update the firmware. If you update the firmware before enabling lan control, it will no longer be possible
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Who is online
Users browsing this forum: No registered users and 1 guest