Smarth thermostat and domotic gateway