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 ...
Raspberry Pi’s line of low-cost single-board computers may not be the only game in town, but their $35 price tags, high level of community support, and small size make them ideal for DIY projects… ...