Use a small routine you can stop easily
For Home Assistant vacation lighting, begin with a few existing lamps and an explicit on/off control. Use a fixed schedule if that meets your needs; add modest randomness if you want some variation. You do not need to install an app or replay your entire household’s activity just to vary two lamps.
The example here runs from 6 pm until 11 pm. At each half-hour, it waits a randomly chosen zero to five minutes, turns on one of two lamps, and turns the other off. It can choose the same lamp again, so a visible change is not guaranteed every time. At 11 pm it requests both off. Ending Vacation lighting also requests both off once, then leaves normal control alone.
Choose spare living-room and bedroom lamps that nobody depends on for safe movement. Tell a sitter or returning household member to turn the toggle off before using those lamps normally. The example does not detect people or restore earlier brightness settings.
Researched from current Home Assistant documentation and the linked project documentation on September 16, 2026. The two-lamp schedule is an illustrative configuration. The configuration was validated with Home Assistant 2026.9.2, and its action logic was checked in an isolated engine with simulated lamp services and time. This did not test live trigger scheduling or physical devices. The cover is an AI-generated residential illustration.
1. Choose a schedule, random routine, or history replay
Our practical default is the native example below when you want two lamps and behavior you can inspect. Choose a larger tool only when its extra controls solve a specific need.
On a small screen, swipe the table sideways to read every column.
| Approach | Choose it when | What to check |
|---|---|---|
| Fixed on/off schedule | You want the least setup and already have suitable evening lighting. | Make both the start and stop conditional on the intended household mode. Randomness has no proven security advantage in this guide. |
| Native random routine below | You want two selected lamps, bounded variation, and one visible stop control. | It uses fixed local hours, chooses one lamp at a time, and ends with both off. It does not replay actual occupancy. |
| Holiday & Away Lighting blueprint | You want configurable sequences, durations, and more lights without writing the whole routine. | A blueprint is a reusable automation recipe. This is community-maintained, with version-dependent options; inspect its current inputs and test its exit behavior. |
| Presence Simulation | You specifically want selected devices to replay earlier activity. | It is a custom integration, usually installed through HACS, the community package manager. History must be available for those entities and retained longer than the selected look-back period. |
For history replay, confirm that the chosen days contain ordinary lighting activity. Do not delete existing history as a setup step. Keep the selection to lamps even if a tool also supports covers, switches, or media players. Neither a saved history nor a running simulation proves that a command reached a real device.
2. Pick the lamps and create the toggle
- Check normal control first. Turn each chosen lamp on and off from Home Assistant. Keep a physical control available and leave smart bulbs powered so they can receive commands.
- Find the two entity IDs. An entity is Home Assistant’s individual control or reading. Open each lamp’s entity settings and note its ID, such as
light.living_room_lamp. This recipe requires twolight.entities; aswitch.entity cannot be pasted into alight.turn_onaction unchanged. - Create the helper. Open Settings → Devices & services → Helpers → Create helper → Toggle. Name it Vacation lighting, confirm its ID is
input_boolean.vacation_lighting, and add it to your dashboard. Leave it off during setup. - Reserve these lamps for the routine while it is on. Prevent ordinary motion or bedtime routines from sending competing commands to the same lamps during Vacation lighting. Check vendor-app schedules too. Keep other household controls and safety systems independent.
The Toggle helper normally restores its previous state after a restart; an explicitly configured YAML initial value changes that behavior. A helper is just a saved setting—it does not control lamps until an automation reads it.
If you already use a whole-home Vacation state, decide how it should control this dedicated lighting toggle and document that relationship. Do not introduce a second competing definition of who is home. Our house-modes guide explains the difference between a deliberate trip mode and ordinary Home/Away tracking.
3. Add the two-lamp automation
Go to Settings → Automations & scenes → Create automation → Create new automation. Open its menu, choose Edit in YAML, and replace the new automation’s contents with the following. YAML is the text form of the editor; preserve its indentation.
Replace every occurrence of both lamp IDs, including the quoted IDs inside the templates. If your helper has a different ID, replace that everywhere too. These are ordinary light.turn_on and light.turn_off commands; the routine does not require dimming or color support.
Complete vacation lighting automation
alias: Vacation lighting - two lamps
description: Random evening lamp choice with an explicit stop
triggers:
- trigger: time_pattern
minutes: "/30"
id: tick
- trigger: time
at: "23:00:00"
id: bedtime
- trigger: state
entity_id: input_boolean.vacation_lighting
from: "off"
to: "on"
id: enabled
- trigger: state
entity_id: input_boolean.vacation_lighting
from: "on"
to: "off"
id: disabled
- trigger: homeassistant
event: start
id: startup
conditions: []
actions:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.vacation_lighting
state: "on"
- condition: time
after: "18:00:00"
before: "23:00:00"
sequence:
- delay:
minutes: "{{ range(0, 6) | random }}"
- condition: state
entity_id: input_boolean.vacation_lighting
state: "on"
- condition: time
after: "18:00:00"
before: "23:00:00"
- variables:
chosen: >-
{{ ['light.living_room_lamp',
'light.bedroom_lamp'] | random }}
- action: light.turn_on
target:
entity_id: "{{ chosen }}"
- action: light.turn_off
target:
entity_id: >-
{{ 'light.bedroom_lamp'
if chosen == 'light.living_room_lamp'
else 'light.living_room_lamp' }}
default:
- if:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.vacation_lighting
state: "on"
- condition: trigger
id: disabled
then:
- action: light.turn_off
target:
entity_id:
- light.living_room_lamp
- light.bedroom_lamp
mode: restart
The times use Home Assistant’s configured time zone. To change the window, update both after values, both before values, and the bedtime trigger’s at value. This example uses 6 pm even if the sun has not set. Pick hours that suit your home before enabling it.
minutes: "/30" means the clock’s :00 and :30 marks, not 30 minutes after the last run. The range’s upper bound is excluded, so range(0, 6) gives delays from zero through five minutes. The random lamp choice is saved once in chosen; both actions use that same choice.
Leave the automation enabled. Use the Vacation lighting helper to end the trip. Disabling the automation itself stops its processing; it does not run this recipe’s lamp-off cleanup. The restart mode stops a pending run when a new trigger arrives, including switching the helper off. The empty top-level conditions: [] lets the stop trigger reach the cleanup branch. The on/off and time checks belong inside the actions, as shown. These behaviors follow Home Assistant’s run-mode documentation and script syntax.
At 11 pm the time window is closed: Home Assistant treats the start time as inclusive and the end as exclusive. The explicit bedtime trigger and the half-hour trigger may both fire then; both lead to the same off request.
4. Check the expected behavior
This is a worked example of the logic, not a record of measured device responses. Assume both lamps are reachable and no other routine controls them.
On a small screen, swipe the table sideways to read every column.
| Situation | Expected result | Why it matters |
|---|---|---|
| Toggle on at 6:12 pm | After a zero-to-five-minute delay, one lamp is on and the other is off. | You need not wait for 6:30 to begin. |
| 6:30 picks the living-room lamp again | After the new delay, that lamp stays on; the bedroom lamp stays off. | A repeated random choice is normal. |
| Toggle off while waiting | The waiting run is canceled and both lamps receive an off command. | The old delay should not turn a lamp back on later. |
| 11 pm, with Vacation lighting on | Both lamps receive an off command, with no random delay. | The cutoff does not wait for another cycle to finish. |
| Server restarts at 8:10 pm, toggle restores on | Startup begins a fresh random choice and delay. | It does not resume the old countdown or replay missed changes. |
| Server returns at 11:10 pm, toggle restores on | Startup requests both lamps off. | A missed bedtime is checked against the current time. |
| Toggle already off; a later half-hour or startup occurs | This automation leaves the lamps alone. | A returning person can use them normally after stopping the routine. |
While the toggle remains on outside the evening window, half-hour checks request both lamps off again. This is intentional for dedicated vacation lamps. Turn the toggle off before using them normally during the day. A lamp unavailable during an off request may remain on; the next scheduled check is only another attempt, not a guarantee.
A server restart discards an in-progress wait. The startup trigger starts fresh. Reloading automations also interrupts an active run, but does not fire the startup trigger; the next half-hour check handles the current state. If the helper is off after downtime, the routine deliberately leaves existing lamp states alone—check them manually if the earlier stop command could not be delivered.
5. Rehearse before leaving
- Use only the two non-essential lamps. Keep normal room lighting on while testing. For a daytime rehearsal, temporarily set both copies of the start/end window to include at least the next ten minutes, and set the bedtime trigger to that same temporary end time.
- Test the start. Turn Vacation lighting on and allow up to five minutes. One selected lamp should be on and the other off. Open the automation’s Traces—its record of each run—to see the delay, chosen lamp, and actions.
- Test cancellation. For a repeatable check, temporarily replace the random delay with
minutes: 1. Save, turn the helper off and on, then off during that minute. Both lamps should turn off, and neither should turn on when the minute expires. - Test the actual cutoff. Turn the helper on within your temporary window and let the end time pass naturally. Both lamps should turn off. With the helper off afterward, turn a lamp on normally and verify the next half-hour check leaves it alone.
- Restore the final settings. Put back the random delay and all five time values. Leave the helper off until the house is ready. Show another household member where to stop it.
Home Assistant’s Run actions command skips triggers and top-level conditions. It can help inspect this recipe’s internal branches, but cannot prove that the time trigger or off event works. Use the real helper changes and cutoff rehearsal above. Check startup behavior during your next planned maintenance restart rather than interrupting the home just for a lighting test.
If the lights do something unexpected
On a small screen, swipe the table sideways to read every column.
| What you see | Check first | Next step |
|---|---|---|
| No light after enabling | The current time, helper ID, lamp IDs, and the trace’s delay or error. | Wait for the bounded delay, then try normal lamp control. Do not re-pair a device as the first check. |
| A lamp turns back on after stopping | The off-event trace and any other automation or vendor schedule. | Confirm mode: restart, no top-level Vacation-on condition, and one owner for these lamps. |
| Lights stay on after bedtime | Server uptime, automation enabled state, device availability, and all three end-time values. | Stop the helper and control the lamps normally. Fix the failed action or time mismatch before the trip. |
| Manual changes keep getting overwritten | Whether Vacation lighting is still on. | Switch it off; both lamps turn off once. Then set the light you want. |
| History replay has nothing useful to copy | Whether the chosen entities have retained activity for the look-back period. | Use the native routine while gathering suitable history; do not assume installing a custom integration creates past data. |
For a missed run versus a failed device action, follow our automation troubleshooting checklist. If you want a temporary lighting effect to restore the exact previous state instead of ending with both lamps off, see the recent scene snapshot and restore guide; that is a different behavior from this trip routine.
Keep local operation and security claims separate
The automation runs on your Home Assistant server. For it to control lamps during an internet outage, their integration—the connection between Home Assistant and the devices—must also work locally. A cloud-dependent lamp connection still needs internet. If the server, radio, network, or lamp loses power, commands can fail.
Use this only for selected lighting. Do not include heaters, cooking appliances, locks, garage doors, alarms, or anything whose unattended operation could cause harm. Keep normal security arrangements in place. This guide has not measured whether random lights deter intruders.
A useful handoff is one sentence: “Turn Vacation lighting off before using these lamps; it switches them off once, then leaves them to you.” Tara’s home automation kit with coordinated local routines is the relevant planning path when you want household controls and their exceptions documented together.
Common questions
Do I need HACS or an app for vacation lighting?
No. The two-lamp example uses Home Assistant’s built-in helpers, triggers, conditions and light actions. HACS is an optional community package manager for custom integrations such as Presence Simulation; it is not required for this recipe.
Does this automatically stop when I come home?
No. Turn Vacation lighting off before using the selected lamps normally or having a sitter use them. It cancels a pending run and requests both lamps off once. Automatic arrival detection would need a separate, tested rule that also accounts for visitors.
Will it restore the lights to their previous state?
No. Ending the routine requests both selected lamps off. It does not save their earlier brightness or color, and it leaves them alone on later scheduled checks while the helper is off.
What happens if Home Assistant is down at bedtime?
The routine cannot send an off command while the server is down. When it starts again, it checks the current time and requests both lamps off if Vacation lighting restores on outside the evening window. If the helper is off, check the lamps manually. Device availability still determines whether a command succeeds.
