IoT Sensor Integration for Digital Control of Buildings in a Smart Grid Ecosystem