---
title: "A heater left on: it switches itself off after 60 minutes and notifies you"
description: "A smart plug and two automations in Home Assistant switch the heater off after an hour, guard against a restart and notify you if the plug loses its connection. Before that, compare the power of the heater with the plug."
canonical: "https://realhomeautomations.com/en/projects/heater-left-on-auto-off-after-60-minutes/"
language: en-US
updated: 2026-11-25T15:20:20+00:00
---

# A heater left on: it switches itself off after 60 minutes and notifies you

A smart plug and two automations in Home Assistant switch the heater off after an hour, guard against a restart and notify you if the plug loses its connection. Before that, compare the power of the heater with the plug.

> Canonical HTML page: https://realhomeautomations.com/en/projects/heater-left-on-auto-off-after-60-minutes/

- **Difficulty:** Beginner
- **Build time:** 20–30 minutes
- **Reading time:** 4 minutes

## Tools required

- Home Assistant
- Smart plug (Sonoff S60ZBTPF 16 A)
- Electric heater (we don't sell it)
- Phone with the Home Assistant app (with notifications allowed)
- Zigbee hub or adapter (or Home Assistant with a Zigbee adapter; not included in the product)


## What readers will learn

- To compare the power of the heater with the plug
- To switch the heater off after 60 minutes
- To know what happens on a restart or a lost connection


## Skill requirements

- To paste YAML into automations
- To find a switch entity in Home Assistant

## Project kit

- [Sonoff S60ZBTPF Zigbee Smart Plug](https://realhomeautomations.com/en/product/sonoff-s60zbtpf-zigbee-smart-plug/index.md)

You go out and the heater has been left on. This project switches it off by itself after 60 minutes and sends you a notification.

 ## What you will get

 A heater on a smart plug that switches off automatically after one hour and notifies you. A notification also comes if the plug loses its connection while the heater is on: then Home Assistant can't switch it off and you have to do it by hand.

 ## What we need

- [Sonoff S60ZBTPF 16 A Zigbee smart plug](https://realhomeautomations.com/bg/produkt/sonoff-s60zbtpf-zigbee-smart-plug/): one for the heater.
- An electric heater. We don't sell it.
- Home Assistant and a phone with the Home Assistant app.

 You need a Zigbee hub or Home Assistant with a Zigbee adapter.

- **Setup time:** about 20–30 minutes.
- **Skills:** you paste YAML into automations.

 ## How it works

 Two automations. The first watches the plug: if it is `on` for 60 minutes without interruption, it switches it off and sends you a notification. The second guards against cases where the first doesn't help: after a Home Assistant restart it doesn't know how long the heater has been on, so it switches the plug off if it stayed `on`. And it notifies you if the plug has been `unavailable` for five minutes while it was on.

 Simeon uses the same 60 minutes for his heater: a safety automation switches it off after 60 minutes of running and sends a notification.

 ## Steps

- **Find the plug.** In Settings → Devices &amp; services copy the `switch.…` for the plug (example: `switch.heater_plug`). Check that you can switch it on and off from Home Assistant.
- **First automation.** Edit in YAML.

 ```
alias: "Heater: switch off after 60 minutes"
mode: single
triggers:
  - trigger: state
    entity_id: switch.heater_plug
    to: "on"
    for: "01:00:00"
actions:
  - action: switch.turn_off
    target:
      entity_id: switch.heater_plug
  - action: notify.mobile_app_telefon
    data:
      title: "The heater is switched off"
      message: "It was on for 60 minutes and we switched it off."
```

- **Second automation.**

 ```
alias: "Heater: protection on restart and lost connection"
mode: single
triggers:
  - trigger: homeassistant
    event: start
    id: restart
  - trigger: state
    entity_id: switch.heater_plug
    to: "unavailable"
    for: "00:05:00"
    id: offline
actions:
  - choose:
      - conditions:
          - condition: trigger
            id: restart
          - condition: state
            entity_id: switch.heater_plug
            state: "on"
        sequence:
          - action: switch.turn_off
            target:
              entity_id: switch.heater_plug
          - action: notify.mobile_app_telefon
            data:
              message: "Home Assistant restarted: the heater was switched off."
      - conditions:
          - condition: trigger
            id: offline
        sequence:
          - action: notify.mobile_app_telefon
            data:
              message: "The heater's plug is unavailable. Check it by hand."
```

 `switch.heater_plug`, `notify.mobile_app_telefon` and 60 minutes are examples. If the heater had a reason to run longer, increase "01:00:00".

 ## Checking the result

- **Normal.** Switch the heater on: after 60 minutes the plug is off, a notification.
- **Quick test.** Change "01:00:00" to "00:00:30", check and change it back.
- **Lost connection.** When the plug stays `unavailable` for five minutes: a notification.

 ## If it doesn't work

- **It doesn't switch off.** Home Assistant has restarted: the second automation is for that. Check the Traces too.
- **It switches off earlier.** Another automation or a manual switch-off. The timer is interrupted on `off`.
- **The notification doesn't come.** The notification service is wrong.
- **It starts at every switch-on.** That is expected: the hour counts from the last switch-on.

 ## Limitations and switching off

- If the plug is unavailable, Home Assistant can't switch it off. That is what the notification is for.
- Switching off: switch off the two automations; the plug stays an ordinary one.

 ## Sources and verification status

 The material follows the Home Assistant documentation, read on 22.11.2026. The topic is from Simeon's list of ideas.

- [Home Assistant: automations, triggers](https://www.home-assistant.io/docs/automation/trigger/), 22.11.2026
- [Home Assistant: automations, conditions](https://www.home-assistant.io/docs/automation/condition/), 22.11.2026
- [Home Assistant: Companion App, notifications](https://companion.home-assistant.io/docs/notifications/notifications-basic), 22.11.2026
- Real Home Automations catalogue: Sonoff S60ZBTPF (product description), 22.11.2026