Microgrid State Estimation and IoT: Modelling Concepts and Design Algorithm