!! Please note - this module is no longer maintained !!
I recommend Home Assistant as the platform for integration. Works really well.
Node.js module for Xiaomi smart home (also branded as Aquara)
Use this module to get data from Xiaomi sensors - temperature/humidity, magnet switch, button (switch), motion sensor
Note that you need to switch on the developer mode - HOWTO. The link is in Chinese, but good enough with google translate and screenshots.
This code is based on works of Jonathan Schemoul, HackSpark.fr
npm install --save node-xiaomi-smart-home
see examples in JavaScript and TypeScript in examples