The advancement of renewable energy infrastructure in smart buildings (e.g., photovoltaic) has highlighted the importance of energy self-consumption by energy-demanding IoT-enabled devices (e.g., heating/cooling, electromobility, and appliances), which refers to the process of intelligently consuming energy at the time it is available. This stabilizes the energy grid, minimizes energy dissipation on power lines but more importantly is good for the environment as energy from fossil sources with a high CO2 footprint is minimized. On the other hand, user comfort levels expressed in the form of Rule Automation Workflows (RAW) , are usually not aligned with renewable production patterns. In this work, we propose an innovative framework, coined IoT Meta-Control Firewall (IMCF + ) , which aims to bridge this gap and balance the trade-off between comfort, energy consumption, and CO2 emissions. The IMCF + framework incorporates an innovative Green Planner (GP) algorithm, which is an AI-inspired algorithm that schedules energy consumption with a variety of amortization strategies. We have implemented IMCF + and GP as part of a complete IoT ecosystem in openHAB and our extensive evaluation shows that we achieve a CO2 reduction of 45–59% to satisfy the comfort of a variety of user groups with only a moderate ≈ 3% in reducing their comfort levels.