When you want to connect an IoT device to anything (or, for that matter, anything to anything), you should take a serious look at Node-RED, a free, open source visual process wiring system from IBM ...
Sequent Microsystems has created a new Raspberry Pi learning kit complete with a Node-RED tutorial providing an easy way to learn about automation control interfaces using Node-RED from simple ...