---
title: "The aquarium on autopilot: light on a schedule, remote control and recovery after a power cut"
description: "The aquarium lamp turns on and off on a schedule through a smart plug, and after a power cut Home Assistant restores the right state. The plug controls only the lighting, not the filter and not the heater."
canonical: "https://realhomeautomations.com/en/projects/aquarium-on-autopilot/"
language: en-US
updated: 2026-11-25T15:20:31+00:00
---

# The aquarium on autopilot: light on a schedule, remote control and recovery after a power cut

The aquarium lamp turns on and off on a schedule through a smart plug, and after a power cut Home Assistant restores the right state. The plug controls only the lighting, not the filter and not the heater.

> Canonical HTML page: https://realhomeautomations.com/en/projects/aquarium-on-autopilot/

- **Difficulty:** Beginner
- **Build time:** 30–60 minutes
- **Reading time:** 3 minutes

## Tools required

- Smart plug (Sonoff S60ZBTPF, 1 piece, for the aquarium lamp)
- Home Assistant (with the plug connected)
- Aquarium lamp (its power must be within the limits of the plug)
- Zigbee hub or adapter (or Home Assistant with a Zigbee adapter; not included in the product)


## What readers will learn

- Make a light schedule with the Schedule helper
- Turn the lamp on and off manually from the phone
- Restore the right state after a power cut


## Skill requirements

- Add a Zigbee plug in Home Assistant
- Create a helper and an automation

## Project kit

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

The light in the aquarium should come on at the same time every day. Turning it on by hand gets forgotten, and a power cut in the late afternoon can leave the lamp off all day. A smart plug and one schedule in Home Assistant solve both.

 ## What you will get

 The lamp turns on and off on a schedule, can also be turned on from the phone, and after a power cut Home Assistant puts it back in the state the schedule requires.

 Project boundary: the plug controls **only the lighting**. The filter, the air pump and the heater stay on constant power and on their own protections. Stopping the filter disrupts its work, and a heater is controlled by its own thermostat.

 ## What we need

- 1 piece [Sonoff S60ZBTPF](https://realhomeautomations.com/bg/produkt/sonoff-s60zbtpf-zigbee-smart-plug/): a Zigbee plug up to 16 A with power measurement. Home Assistant is needed.
- A low-power aquarium lamp.
- Home Assistant and a phone with the Home Assistant app.

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

 ## How it works

 In Home Assistant you create a helper **Schedule** with the hours of the light. An automation watches its state: at "on" it turns the plug on, at "off" it turns it off. It also runs when Home Assistant starts, and when the plug comes back from `unavailable`. That way, after a power cut the system checks what is needed and does it.

 ## Steps

- Add the plug in Home Assistant. You expect an entity `switch` and power sensors.
- **Settings → Devices & services → Helpers → Create helper → Schedule.** Set the name "Aquarium light" and two intervals, for example 10:00–12:00 and 17:00–23:00 (as at Simeon's). The entity ID will be `schedule.svetlina_akvarium` or similar.
- Create an automation. The entity IDs are examples:

 ```
alias: Aquarium - light on a schedule
mode: single
triggers:
  - trigger: state
    entity_id: schedule.aquarium_light
  - trigger: state
    entity_id: switch.aquarium_light_plug
    from: unavailable
  - trigger: homeassistant
    event: start
actions:
  - choose:
      - conditions:
          - condition: state
            entity_id: schedule.aquarium_light
            state: "on"
        sequence:
          - action: switch.turn_on
            target:
              entity_id: switch.aquarium_light_plug
    default:
      - action: switch.turn_off
        target:
          entity_id: switch.aquarium_light_plug
```

- Manual turn-on: from the app or the dashboard card. The next change of the schedule will return the plug to the schedule.
- After a power cut the plug stays off. The automation runs at the start of Home Assistant and brings the lamp to the state the schedule needs. Simeon also has a separate automation that only switches the plug off if Home Assistant starts or reconnects outside the schedule.

 ## Checking the result

- Change the schedule to the minute and check that the plug turns on and off.
- Cut the power to the plug (pull it out) and put it back: the state should match the schedule.
- Restart Home Assistant: the state again matches the schedule.

 ## If it doesn't work

- The lamp doesn't respond → the plug is `unavailable` → check the Zigbee connection.
- The light is wrong after a power cut → the automation didn't start → check the three triggers.
- The plug turns off by itself → overload protection → check the power of the lamp.

 ## Limitations

- If Home Assistant or the Zigbee network stops, the lamp stays in its last state.
- The light is not "care for the fish". Choose the hours according to the needs of your aquarium.

 ## Sources and verification status

 Checked against the documentation on 22.11.2026.

- [Sonoff S60ZBTPF: manufacturer's help](https://help.sonoff.tech/docs/s60zbtpf)
- [Home Assistant: Schedule](https://www.home-assistant.io/integrations/schedule/)
- [Home Assistant: Choose action](https://www.home-assistant.io/docs/scripts/#choose-a-group-of-actions)