Smart Grid in IoT-Enabled Spaces