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.
- Level
- Beginner
- Active time
- 30–60 minutes
- Home Assistant required
- Yes
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: 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
switchand 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_akvariumor 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.
Need a hand?
We can set up and install everything in this project. In some regions we install it ourselves — ask us.
Contact us


