3 min read

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.

Level
Intermediate
Active time
30–45 minutes
Home Assistant required
Yes

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

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

  1. Create the time. Settings → Devices & services → Helpers → Create helper → Date and/or time → time only. Name “Bath time”, entity ID input_datetime.bath_time (an example).
  2. 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.
  3. 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.

  1. “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
  1. Add a safeguard. The delay delay is lost on a Home Assistant restart. Use the second safeguard from the project A heater left on.

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.

Need a hand?

We can set up and install everything in this project. In some regions we install it ourselves — ask us.

Contact us

Related projects

Sonoff S60ZBTPF Zigbee Smart Plug

16,90 €
View parts

What you need

Requires a Zigbee hub or Home Assistant with a Zigbee adapter.

Added to cart

Real Home Automations

Sign in to your account

With a code sent to your email

Continue with Google
or

By continuing, you accept the Terms and Conditions and the Privacy Policy.