Raspberry pi based thermostat