SMART BUILDINGS: COMBINING IOT , DG MONITORING & POWER OPTIMIZATION