Xiaomi Mijia Smart Multi-Mode Gateway (ZNDMWG03LM) support

@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!

Hi, I don’t have access to device right now, so I’ll try to guide you by memory.

You need to assemble 2 micro switch buttons:

  1. between TP5 and GND (TP12 for example)
  2. between TP16 and GND (TP13 for example)

Switch [1] will reboot device every time you press it.
Switch [2] will interrupt communication between flash chip and CPU

Connect console cable, reboot device. Inspect boot messages, make yourself familiar with boot process. Most probably your device is rebooting constantly.

At some point you should see message like “checking kernel 1” or something like that. Immediately, once you see this message start clicking repeatedly button [2]. check will fail and it will start “checking kernel 2”: continue clicking. When it fails second time boot process will be interrupted and you will see bootloader prompt. From there you need to ENABLE rootfs check (I don’t remember exact command, just check all commands with “?” or “help”). After this - reboot and gateway should boot now, but you are not done yet.
You booted from backup rootfs, now you need to flash backup of original rootfs to gateway. When done, try to reboot and make sure you booted from primary rootfs. When ready - disable rootfs check using “boot_ctrl” command.

1 Like

@serrj-sv
Thanks for the reply, I post the result here if I successfully revive my device, thanks :+1:

I feel such a noob again…
when I run

nc -l  -p 2222 | dd of=mtd0(1,2,3...)

I get
syntax error near unexpected token `(’

What Am I missing?

got it, should probably be :grinning:

nc -l  -p 2222 | dd of=mtd0 

and

nc -l  -p 2222 | dd of=mtd1

etcetera…

Thanks for your flow. Studied it a bit and found you wrote a function that analyzes codes like 0.1.85 and 8.0.2008 and translates them into a more meaningful something like ‘temperature’ and ‘voltage’.
Is this something you deducted from looking at the numbers or is there a list somewhere of these codes and their meaning?

thanks

I didn’t find any sort of difinitive list so I watched the internal MQTT traffic and compared the logs to what I could see in the app. Temp and Humidity is easy. Battery is more obscured and I’m not 100% sure it’s correct. I just took some samples and interpolated from it to match the homekit values. I found a few hints about what other codes mean, but nothing to suggest they are interesting enough to track.

1 Like

Hi all. I wrote a custom component for this Gateway.

8 Likes

Great job, I set up the addon but HA doesn’t discover devices, gateway also not visible.
am I doing something wrong?

I thank you in advance

ok, I’ll see if I can find out more codes then. Thanks.

Awesome, works fine !

You need enter Gateway IP address and Mi Home Token as shown at video above.

i do it but doesn’t work.

Component can’t get device list. I don’t know why. Do you have the latest version of HA? And latest version Gateway firmware? Check logs.

HA version 0.114.4

Gateway 1.4.6_0012

If I have not misunderstood the component should automatically activate Telnet or I am wrong.

The component automatically activates Telnet. Check logs.

logger:
  default: warning
  logs:
    custom_components.xiaomi_gateway3: debug

Hi, thanks for the work you’ve done.
Very easy to install and to configure ! It works perfectly !
I can get all my devices informations controlled by the gateway v3. :+1:

Do you think it could be possible to get the battery levels of the devices ?

i have this device and apparently it is not compatible but at least the gateway should show as a device?

2020-08-31 10:22:54 DEBUG (Thread-3) [custom_components.xiaomi_gateway3.gateway3] 192.168.1.xx | Read devices
020-08-31 10:14:01 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for xiaomi_gateway3 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.

this happens but the gateway is not detected as an entity