Home Assistant

Space-heater plug manager

A smart plug on a space heater runs only inside a schedule, and only when the room is occupied and someone assigned to it is home. A watt floor turns the plug off if the heater never actually draws power.

Difficulty · IntermediateSetup · 30–60 minutesHA · current stable (blueprint)
Get the pack · from $19Have us set it up

Some hardware links on this page are affiliate links. As an Amazon Associate I earn from qualifying purchases. We may earn a commission if you buy through them, at no extra cost to you. See the affiliate disclosure.

A space heater on a dumb rocker will heat an empty room until someone remembers it. This pack is the switch in front of that heater. The plug turns on when the schedule says the room is allowed to heat, a selected person is home (or close), and occupancy says someone is there. It turns off when the room has been empty for a timeout. If the plug is on and the watt sensor stays under a floor, the pack turns the plug off and sends a push. That is the “heater unplugged, or the rocker is off” case.

Entity ids are blueprint inputs (switch.heater, binary_sensor.room_occupancy, sensor.heater_power). Do not publish which room this is.

Holding a target temperature with a cycle time is versatile thermostat. A plug that simply runs for a fixed timer after you turn it on is relay auto-off timer. This pack does not read a thermostat setpoint. It decides whether the plug may be on.

What problem it solves

You want a plug-in heater available on a schedule while the room is in use, off when the room is empty, and off if it is not actually drawing power.

How it works

  1. Schedule — start time, end time, and weekdays live in the blueprint. No schedule helper. If the end time is earlier than the start time, the window crosses midnight. Outside the window the plug is turned off and occupancy cannot turn it on.
  2. People — one or more person entities. Match mode is any or all. Any means one of them home is enough. All means every selected person is home. An optional proximity sensor (distance to the home zone, under a threshold you set) counts as “close” for the any-mode check so the room can heat as someone arrives. Without that sensor, home is the only pass.
  3. Occupancy — a motion or occupancy binary_sensor turning on, inside the schedule and people checks, turns the plug on. Turning off and staying off for the vacancy timeout (pack default 15 minutes) turns the plug off. A brief gap in a PIR does not kill the heater.
  4. Override — an input_boolean. On means vacancy will not turn the plug off. The schedule off and the watt checks still will. The override is how you finish a load of damp laundry in that room without waving at the sensor. It is not a way to leave a heater on with nobody home overnight. The schedule still ends.
  5. Startup watts — after the plug turns on, wait a short settle time (pack default 45 seconds) and read power. Under the watt floor means the heater’s own switch is off or the plug is empty. Turn the plug off and notify. A heater that needs a button press after every power loss will fail this check every time. That is the point. Those heaters do not belong on a smart plug that cuts mains.
  6. Mid-run watts — if power stays under the floor for a longer window (pack default 10 minutes) while the plug is on, turn it off and notify. Many heaters cycle to zero when their own thermostat is satisfied. A short window will fight that thermostat. Raise the window, or turn the mid-run check off and keep only the startup check, if the heater is supposed to idle at zero between bursts. Set the heater’s own thermostat above the room temperature you want and let this pack be the on/off, if you want the mid-run check to mean “it died” and not “it is warm enough.”

The plug’s rating is a hard limit. The linked plug is 15 A and 1800 W. Read the heater nameplate. A 1500 W heater can sit on that plug with headroom. A 240 V baseboard or a heater over the plug’s continuous rating does not.

Hardware notes

  • Plug. A switch plus a power sensor in watts. The linked plug is a Kasa KP125M two-pack with energy monitoring. A switch-only plug cannot run the watt checks. Disable those inputs if you only have a switch, and you lose the fail-safe.
  • Occupancy. Any binary sensor. If the room has none, an HC-SR501 on an ESP32-C6 Super Mini is the same PIR pattern as the other packs. Put it where a seated person still trips it, or vacancy will win while someone is in the chair.
  • People. Person entities you already have. Proximity is optional and has no extra part in this pack.

Snippet

The pack ships a blueprint. Schedule, people, and the watt waits are shortened here.

mode: restart

trigger:
  - platform: state
    entity_id: !input occupancy
    to: "on"
    id: occupied
  - platform: state
    entity_id: !input occupancy
    to: "off"
    for: !input vacant_for
    id: vacant
  - platform: time
    at: !input schedule_end
    id: schedule_off

condition: []

action:
  - choose:
      - conditions:
          - condition: trigger
            id: occupied
          - condition: time
            after: !input schedule_start
            before: !input schedule_end
            weekday: !input weekdays
          - condition: state
            entity_id: !input people
            state: "home"
        sequence:
          - action: switch.turn_on
            target:
              entity_id: !input heater_switch
          - delay: !input settle_for
          - condition: numeric_state
            entity_id: !input power_sensor
            below: !input watt_floor
          - action: switch.turn_off
            target:
              entity_id: !input heater_switch
          - action: notify.send_message
            target:
              entity_id: !input notify_target
            data:
              title: "Heater plug off"
              message: "The heater plug was on and power stayed under the floor."
      - conditions:
          - condition: trigger
            id: schedule_off
        sequence:
          - action: switch.turn_off
            target:
              entity_id: !input heater_switch
      - conditions:
          - condition: trigger
            id: vacant
          - condition: state
            entity_id: !input override
            state: "off"
        sequence:
          - action: switch.turn_off
            target:
              entity_id: !input heater_switch

A midnight-crossing schedule is a template condition in the full blueprint, because after / before on one time condition does not wrap. The mid-run watt trigger is separate so a heater that later falls under the floor still trips.

Setup outline

  1. Put the energy-monitoring plug on the heater. Confirm watts in Developer Tools while the heater is running and while it is idle. Note the idle number. Set the watt floor above idle noise and below a real heat cycle.
  2. Confirm occupancy. Wave, sit still for the vacancy timeout, and watch the binary sensor. A PIR that clears while you sit still needs a longer vacancy timeout.
  3. Import the blueprint. Select the switch, the power sensor, occupancy, people, match mode, schedule, vacancy timeout, watt floor, settle time, and the notify target.
  4. Inside the schedule, with a person home, trip occupancy. The plug should come on. If watts stay under the floor, it should turn off and the phone should get one message.
  5. Leave the room. After the vacancy timeout the plug should turn off. Turn the override on and confirm vacancy no longer turns it off. Turn the override off. Set the clock past the schedule end and confirm the plug turns off anyway.

Troubleshooting

  • It never turns on. Outside the schedule, nobody in the people list is home, or match mode is all and one person is away. Proximity does not override all-mode.
  • It turns off while the room is warm and the heater is cycling. The mid-run window is shorter than the heater’s own off period. Lengthen it or disable the mid-run check. The startup check should stay.
  • It turns on and immediately off. The heater needs a local button press after mains returns, so watts stay at zero. This pack cannot press that button. Use a heater that resumes heat when mains returns, or leave the watt check off and accept that an unplugged heater looks “on.”
  • Vacancy fights the override. The override boolean is off, or the off path is the schedule end, which ignores the override. Check which trigger id is in the trace.
  • Watts read in kilowatts. The floor is in watts. A sensor that reports 1.2 while the heater runs is kilowatts. A floor of 20 will never see a fault, and a floor of 20 with a watts sensor is correct. Match the unit.
  • The plug is warm. The heater is at or over the plug’s rating. Move the heater to a circuit and a plug that can carry the nameplate. This blueprint does not make a 15 A plug safe for a larger load.

Credits

Based on the community blueprint Smart Climate Switch with Occupancy Control (schedule, occupancy, proximity, and a power fail-safe on a plug). This write-up is an original overview of that on/off manager, with the startup watt check kept separate from a longer mid-run window so a cycling heater is not treated as unplugged. It is not a paste of that blueprint.

Changelog

v1.0 · Oct 26, 2026: First publish.