This paper presents an Optimal Power Management System (OPMS) for smart homes in 6G environments, which are designed to enhance the sustainability of Green Internet of Everything (GIoT) applications. The system employs a brute-force search using an exact solution to identify the optimal decision for adapting power consumption to renewable power availability. Key techniques, including priority-based allocation, time-shifting, quality degradation, battery utilization and service rejection, will be adopted. Given the NP-hard nature of this problem, the brute-force approach is feasible for smaller scenarios but sets the stage for future heuristic methods in large-scale applications like smart cities. The OPMS, deployed on Multi-Access Edge Computing (MEC) nodes, integrates a novel demand response (DR) strategy to manage real-time power use effectively. Synthetic data tests achieved a 100% acceptance rate with zero reliance on non-renewable power, while real-world tests reduced non-renewable power consumption by over 90%, demonstrating the system’s flexibility. These results provide a foundation for further AI-based heuristics optimization techniques to improve scalability and power efficiency in broader smart city deployments.