I found some information to implement it in Gladys.
On Android, with the latest version of the Xiaomi app, you just need to click on the gateway and you will arrive on the green screen with a white circle. In the top right, click on the three small dots. Click on « About » then « Wireless Communication Protocol »! You will be able to activate the protocol and retrieve the token.
To find the hidden menu in Xiaomi Home in order to activate developer mode for the BLE gateway, you need to make about ten short taps on the firmware version and then a (very) long press. I hope this will be useful.