Another option would be to use something like Zigate (zigate.fr) which is a vendor neutral, open source gateway that I’m using myself.
I use it for the Xiaomi stuff since I didn’t want a gateway that’d phone home and I liked the idea of it being open. There’s a custom component for it that’s being developed. I’ve used this combination for a while and it’s working brilliantly. Basically it’s plug-and-play.
Range is good and I use it with a round Xiaomi button to turn oft all the lights when I go to bed for example.
Edit: by the way, the Xiaomi button can do up to four clicks for an action, giving you four functions to build into it.