You can most likely also do this from within openHAB miio binding.
While miio binding has nothing specific to the lumi gateway, it should be possible to send commands to it and get the token from the Xiaomi cloud.
The lumi would show as unsupported device, but will have a command channel There you can send the command like: enable_telnet_service
. The miio binding will then indeed send ‘{“id”:0,“method”:“enable_telnet_service”, “params”:}’ to the lumi device.
After that, you don’t need the miio binding anymore to control the lumi.
I don’t have a lumi device to test this, but would be surprised if it would be so different to other devices that it wont work