---
title: "A warm bath for the kids right on time: the heater starts before bath time"
description: "A bath time, a smart plug and an automation in Home Assistant start the bathroom heater a little before the kids and switch it off by themselves."
canonical: "https://realhomeautomations.com/en/projects/warm-bath-for-kids-on-time/"
language: en-US
updated: 2026-11-25T15:20:21+00:00
---

# A warm bath for the kids right on time: the heater starts before bath time

A bath time, a smart plug and an automation in Home Assistant start the bathroom heater a little before the kids and switch it off by themselves.

> Canonical HTML page: https://realhomeautomations.com/en/projects/warm-bath-for-kids-on-time/

- **Difficulty:** Intermediate
- **Build time:** 30–45 minutes
- **Reading time:** 3 minutes

## Tools required

- Home Assistant
- Smart plug (Sonoff S60ZBTPF 16 A)
- Electric heater for a bathroom (not sold by us)
- A 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

- Set a bath time
- Switch the heater on beforehand and have it switch off by itself


## Skill requirements

- Create helper values and a script
- Put YAML into an automation

## Project kit

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

The kids walk into a cold bathroom and complain. The heater can warm it up in advance: Home Assistant starts it a little before the usual bath time and stops it afterwards, and you don't have to remember anything.

 ## What you will get

 A heater on a smart plug that switches on by schedule before bath time, and a “Bath time now” button for the days when the time is different. The heater always switches itself off after a set time.

 ## 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 designed for a bathroom. 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 30–45 minutes.
- **Skills:** you create helper values and paste YAML.

 ## How it works

 A helper value “bath time” (`input_datetime`) says when the kids bathe. The automation starts 30 minutes before that time (an example), switches the heater on and switches it off after a time that you decide. A button on the dashboard starts it right away.

 The lead time depends on the bathroom and the heater. Measure it: run the heater and see how many minutes it takes to be pleasant.

 ## Steps

- **Create the time.** Settings → Devices &amp; services → Helpers → Create helper → Date and/or time → time only. Name “Bath time”, entity ID `input_datetime.bath_time` (an example).
- **Measure the lead time.** On a reasonable day, run the heater and write down how many minutes you wait for it. Here we use 30 minutes, the lead time Simeon uses.
- **Scheduled automation.** Edit in YAML.

 ```
alias: "Bathroom: warm-up before bath time"
mode: single
triggers:
  - trigger: time
    at:
      entity_id: input_datetime.bath_time
      offset: "-00:30:00"
actions:
  - action: switch.turn_on
    target:
      entity_id: switch.bathroom_heater_plug
  - delay: "00:50:00"
  - action: switch.turn_off
    target:
      entity_id: switch.bathroom_heater_plug
```

 30 minutes of lead time and 50 minutes until switch-off (about 80 minutes in total) are examples. Reduce “00:50:00” according to how long the bath takes.

- **“Bath time now” button.** Create a script with the same actions without the time, and put it on the dashboard.

 ```
alias: "Bathroom: warm up now"
mode: single
sequence:
  - action: switch.turn_on
    target:
      entity_id: switch.bathroom_heater_plug
  - delay: "00:45:00"
  - action: switch.turn_off
    target:
      entity_id: switch.bathroom_heater_plug
```

- **Add a safeguard.** The delay `delay` is lost on a Home Assistant restart. Use the second safeguard from the project [A heater left on](https://realhomeautomations.com/bg/projects/nagrevatel-zabraven-vklyuchen-spira-se-sam-sled-60-minuti-i-izvestyava/).

 ## Checking the result

- **Time.** Set a time a few minutes ahead to test. The heater switches on by schedule.
- **Switching off.** After the set time, the plug switches off.
- **Button.** Press “warm up now” and check the switch-off.
- **Power.** With the heater turned on, check the W in Home Assistant.

 ## If it doesn't work

- **It won't start.** The time isn't set or `offset` is set wrongly. See Traces.
- **The bathroom is cold.** Increase the lead time.
- **It stays on.** A Home Assistant restart during the `delay`. Add the second safeguard.
- **The plug is `unavailable`.** The signal is weak in the bathroom: check the nearest mains-powered Zigbee device.

 ## Limitations and switching off

- The heater runs unattended only if that is permitted and safe for it; judge it by the instructions.
- The system doesn't know whether the bathroom is already warm or whether there is a person in it.
- If Home Assistant isn't running, there is no schedule either.
- Switching off: turn off the automation and the script; 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 (time with offset)](https://www.home-assistant.io/docs/automation/trigger/), 22.11.2026
- [Home Assistant: Input datetime](https://www.home-assistant.io/integrations/input_datetime/), 22.11.2026
- [Home Assistant: scripts](https://www.home-assistant.io/docs/scripts/), 22.11.2026
- Real Home Automations catalogue: Sonoff S60ZBTPF (product description), 22.11.2026