Xiaomi gateway issue

The gateway light can always be controlled even with an invalid key. Check the troubleshooting part of the docs and move the gateway to the same subnet as that is most likely causing the problem.