Enabling Optimal Energy Management with Minimal IoT Requirements