Code for SmartHome control using a Rasp Pi