Xiaomi Mijia Smart Multi-Mode Gateway (ZNDMWG03LM) support

I have followed the instruction to modify the filesystem. Unlucky, it couldn’t boot up again. :disappointed_relieved: What could I do?

Hi Kevin!

Can you explain how you opened 9898
What version of the Mi Home app?
What firmware on Mi Gateway?

Exact procedure

I followed the directions already posted for telnet. I did not open 9898, it was open on its own and only for a while after adding to the mi home app. App version is 5.7.5, firmware is whatever is 1.4.6_0030 (current version). The “developer mode” option is nowhere to be found but this still worked:

php miio-cli.php --ip $ip --token $token --sendcmd '{"id":0,"method":"enable_telnet_service", "params":[]}'

for me, I delete the gateway from the mi home app. I then added the device from scratch using standard manufacturer procedures. In home assistant, I added a homekit-controller integration via the UI and used the homekit code on the QR sticker on the bottom of the gateway (I typed the digits rather than scan the QR) and it worked. I also did this two weeks ago, but it stopped updating after 10 days. No idea if it will stop again as I’m only 5 days in this time. That’s why I used the telnet hack above and set up MQTT to be open, which is also shown above (comment out the bind 127.0.0.1 line as mentioned in step 5 of post #60 in this thread)

Pretty hard to open, i used pry tools of thin metal like this:

The bottom:

Inside after opening:

The empty shell with antennas:

Top of the print board:

Bottom of the board:

Where can I connect the UART to send "psm-set network.open_pf3 "

You can’t. As serrj-sv mention above, that command does not exist on this device

As this device is using mqtt internally, you can try using serrj-sv’s method. Telnet into this device and patch mqtt to Home assistant.


I dont remember which one Tx which RX, just try swap.
UART setting: 38400 8n1, disable flow control.
Rx is DISABLED by default, it means you can see system messages, but CANNOT type anything.
To fix it run via telnet:
echo enable > /sys/class/tty/tty/enable

1 Like

It is possible to fix, but its not easy. You’ll have to open device and solder UART. If you feel confident I’ll guide you what to do

Same problem here, glad to hear there’s a possible way to fix it.

Hi. Maybe you can also help me to fix my broken gateway v2 (with radio). It stopped working. I soldered UART and looks like one of partitions is corrupted, maybe there is a method to reflash it.
I see:

## [1] = psm start = 0x6000 size = 0x4000

## [2] = appfw start = 0xa000 size = 0x96000

## [3] = userdata start = 0xa0000 size = 0xa000

## [4] = mcufw start = 0xaa000 size = 0x60000

## [5] = wififw start = 0x10a000 size = 0x30000

## [6] = wififw start = 0x13a000 size = 0x30000

## [7] = appfw start = 0x16a000 size = 0x96000

## [8] = musicfw start = 0x200000 size = 0xe00000
[psmu] Error: failed to init PSM status code -1

When I enter ‘help’ there are only 3 commands available:

# help

help
system-conf
echo <on/off>
# system-conf

Someone checked if telnet works on version 1.4.5_0016?
I am currently on version 1.4.4_0003. Everything works fine.

@kevindf I see you have version 1.4.6_0030 and the telnet is working?

I already confirmed that it is working as this was stated in the procedure that I followed. I remain with the port closed, but MQTT opened up to the network and still using node red to process and report to Home Assistant using the flow I already shared. I’ve since had some momentary losses of data from the standard Homekit connection (came back after a day or two), but MQTT hasn’t failed. I’m expecting a few more HT sensors in the coming days to add into the system.

@kevindf

Is it possible to manage devices, such as light bulbs (IKEA Tradfri) with the same configuration of this gateway as you (Node-Red + MQTT+ZNDMWG03LM)?
or are only sensors available?

I only have Xiaomi sensors currently, plus some bluetooth devices (which have nothing to do with the gateway). I would love to extend range via a tradfri extender but I cannot see it in the Mi Home app, so I’m not sure if it can even be added let alone if it shows up in mqtt. Not sure if I want to buy one without some better hint that there is a chance of it working. I recently added a mi sensor and it was immediately there, so it’s a question quickly answered if/when hardware is in hand :slight_smile: Worst case, I may look at migrating to a conbee and deConz

I have IKEA light bulbs connected to this gateway via the official MiHome app, but they are not thrown into HomeKit, they are only managed from the MiHome app.
Here I was hoping that using such a pwned gateway configuration i will be able to add these devices to the HomeKit via HA + Node-Red

@kevindf

I used your flow (for HT and illumination sensors) for try to see messages from/to ikea bulbs, and i see they there (debug in Node-Red).
but then I don’t understand what need to do to make them appear in HA :slight_smile:

sorry for the stupid question, but could you give me a couple of recommendations or links so I can figure out where to go next? :grimacing:

The flow takes the gateway MQTT and spits out something for your own broker (can format to suit your needs). For HA, I just add MQTT platform sensors:

If you need more info on how to process the non-mi data, check the debug nodes for the payload info as this is what you need to have exposed to your own broker for HA .

Hello, I have the same problem. Did you find a solution ?

Thanks

@serrj-sv The link to the modified apk ask for a username and password :frowning: Does any one know of an alternative?

1 Like

@realjax

The password is 3402847392 with no username require

You can also link to the download page directly without a password if you visit the author’s website here, might need google translate or something similar if you can’t read Russian.

1 Like

Many thanks!