Smart Integration of IoT and Control in Electrical Systems