An innovative Home and Building Automation design tool for Nanogrids Applications