A Safer Home Assistant Automation for Space Heaters

How to build a temperature-controlled heater automation with safety checks for sensor failures, stale data, and peak electricity hours.