A solution for Xiaomi Smart Home Gateway 2 (DGNWG02LM, lumi.gateway.v3, chinese version), tested on firmware 1.4.1_17:
To enable developer mode or so called “LAN function” in Xiaomi Gateway 2 after the ability to do this was removed from Xiaomi Home App, use xiaomi-cloud-tokens-extractor and miiocli tools.
-
You need to extract a token of your gateway from Xiaomi Cloud using xiaomi-cloud-tokens-extractor - just pull it, run and enter your cloud credentials. As output you will get a list of your devices and their tokens.
-
Use previously extracted token as parameter for miiocli tool command to set manualy Developer Key in your Gateway (key value can be a random 16 bytes long alpha-numeric string), example:
miiocli gateway --ip 192.168.1.7 --token 652e1b285fef684209500a22d5be62f8 set_developer_key f40e1b285fes682r09100
As you got an output…
Running command set_developer_key
[‘ok’]
… your gateway is in developer or “LAN function” mode.