Capture the room before the temporary change

To restore lights from a Home Assistant scene snapshot, capture their states first, change the lights, and then activate the captured scene. A scene is a saved set of device settings. A snapshot records the settings Home Assistant sees at that moment, so you do not have to guess what brightness the room had beforehand.

For a short task-light boost, put those steps in one script: a sequence you can run from a button or another automation. Start with two dimmable lamps you can already control from Home Assistant. The example below brightens both for 30 seconds, then restores their captured states. Once you have checked it, you can lengthen that interval.

The order matters: taking the snapshot after brightening the lights saves the brightened room. Keep the same script responsible for saving and restoring, and avoid other routines changing those lamps during the test. Home Assistant’s Create scene documentation describes the temporary capture action.

Researched from current Home Assistant documentation and the 2026.9.2 source code on September 12, 2026. The YAML syntax and initial state check were checked locally. Expected outcomes follow the documented behavior; this script was not run in a Home Assistant installation or tested on physical lamps. The cover is an AI-generated residential illustration.

Set up a short brightness boost

1. Find two individual light IDs

Open each lamp in Home Assistant and use its settings to copy the entity ID, the internal name such as light.reading_lamp. Check that each lamp turns on, turns off and dims from its normal controls. Keep mains power supplied to the smart lamps.

Use the individual light entries, even if you normally operate a room group. A light group combines its members into one control and normally reports on when any member is on. That combined state cannot describe “reading lamp on, floor lamp off.” Capturing the members preserves that distinction.

2. Create one script

  1. Open Settings → Automations & scenes → Scripts and create a new empty script.
  2. Open its menu and choose Edit in YAML. YAML is Home Assistant’s text configuration format. Paste the complete example below; do not add an outer script: line.
  3. Replace light.reading_lamp and light.floor_lamp with your IDs everywhere they appear. Each appears in the initial check, the snapshot list and the brightness action.
  4. Reserve before_reading_corner_boost for this script. If that name already belongs to a scene, choose a fresh name and change both later scene.before_reading_corner_boost references to match.
  5. Save the script. Leave the delay at 30 seconds for the first checks.

On a phone, scroll the code sideways to read full lines.

Copy the two-lamp script
alias: "Lamps - temporary brightness boost"
description: "Save two lamps, brighten briefly, then restore"
mode: single
sequence:
  - alias: "Require usable states for both lamps"
    condition: template
    value_template: >-
      {{ states('light.reading_lamp') in ['on', 'off']
         and states('light.floor_lamp') in ['on', 'off'] }}
  - alias: "Save each lamp before changing anything"
    action: scene.create
    data:
      scene_id: before_reading_corner_boost
      snapshot_entities:
        - light.reading_lamp
        - light.floor_lamp
  - alias: "Temporarily brighten both lamps"
    action: light.turn_on
    target:
      entity_id:
        - light.reading_lamp
        - light.floor_lamp
    data:
      brightness_pct: 80
  - delay: "00:00:30"
  - alias: "Restore the captured states"
    action: scene.turn_on
    target:
      entity_id: scene.before_reading_corner_boost
  - alias: "Remove this temporary scene"
    action: scene.delete
    target:
      entity_id: scene.before_reading_corner_boost

The opening check stops the sequence if either light has a missing, unknown or unavailable state. It does not prove the device will stay reachable. The snapshot then saves what Home Assistant currently reports; it does not force a new reading from the lamps. See script conditions and sequential actions.

scene_id is the short creation name. The later actions target the full entity ID beginning with scene.. Keep lowercase letters and underscores. The final delete action removes the temporary record after restoration is requested; it does not turn off the lamps. If you copy this into another room’s script, change that snapshot name as well as the light IDs.

3. Run it while you can see both lamps

Set the reading lamp to roughly 30% brightness and turn the floor lamp off through Home Assistant. Wait until their controls show those states, then run the saved script. A trace, the script’s record of executed steps, helps you see where it stopped if the result is wrong.

After the checks below pass on your lamps, change the delay to 00:05:00 for a five-minute task-light boost if useful. Add a dashboard button that runs this saved script, or call it from the action section of your chosen button automation. Keep the capture and restore steps together.

Worked example: one lamp on, one lamp off

These are expected outcomes from the example’s logic, not measurements from hardware. Brightness values are illustrative; a bulb may round the requested percentage.

Scroll sideways on a phone to read all three columns.

StepReading lampFloor lamp
Before the scriptOn at about 30%Off
Snapshot createdIts on state and reported light settings are savedIts off state is saved
Temporary changeOn at about 80%On at about 80%
Another call during the waitNo new run starts. The original snapshot and original deadline stay in place.
Restore after the delayRequested back to its captured on state and brightnessRequested back to off

Now swap the starting states and run again. Also try both lamps off. The point is to check each lamp independently, not merely that the room looks dimmer afterward. A call made after the script has finished starts a new boost and captures a fresh snapshot.

Check one more thing: after the floor lamp returns to off, turn it on normally. It may come on at the temporary 80% level. That does not mean its off state failed to restore. Home Assistant’s light restoration code sends an off command for a captured off state; it does not also program the bulb’s next-on brightness. If next-on brightness matters, set it explicitly in the routine that normally turns that lamp on.

Why this script uses single mode

A second press should not redefine what “before” means. In this example, mode: single ignores another call while the script is still running. Home Assistant may log a warning for that ignored call; it is expected. The script modes documentation explains the other choices.

Changing this example to restart would stop the first run and capture the already-bright lamps on the second run. Using parallel would let runs share and overwrite the same snapshot name. queued would perform another boost afterward. Keep single mode for this fixed-duration recipe.

Single mode only coordinates calls to this script. Another automation using the same scene name can still overwrite it, and another lighting routine can still change the lamps. If several triggers need this behavior, have them call this one script. Give a separate room script its own snapshot name.

Decide how interruption and manual changes should behave

This script restores the starting settings even if somebody adjusts a lamp during the wait. Use it only where that behavior is acceptable. For longer cleaning sessions, a clearly named, saved “Normal lighting” scene and a deliberate return button are easier to recover after interruption. That returns to a chosen preset, rather than recreating an arbitrary earlier room state.

If the household needs a manual change to take priority, first design a manual override for the lighting automation. Simply restoring a snapshot cannot identify who changed the lamp. Keep this convenience script away from lights needed for safe movement if an unexpected return to off would be a problem.

A Home Assistant restart or a scene reload removes dynamically created scenes. Stopping this script also prevents its remaining delay and restore steps from running. Use the ordinary lamp controls to recover the room; this example provides no automatic recovery. For lights changing after a mains outage, use the separate guide to smart-light power-on behavior.

Troubleshoot the result you actually see

Scroll sideways for the likely cause and next step.

What happensCheckWhat to do
Nothing brightensThe initial condition and each lamp’s reported stateFix the IDs or unavailable light first. Run the saved script from its beginning.
Both lamps return to onWas a room group captured instead of its members?List each individual lamp in the snapshot and brightness action.
The restored brightness is still 80%Was the snapshot taken after the boost, or overwritten by another run?Capture first; keep single mode and reserve the snapshot name.
An initially off lamp is bright at its next switch-onDid it correctly return to off first?Specify brightness in its normal turn-on routine. Off-state restoration does not set next-on memory.
The scene is missingWas it already deleted, or did scenes reload or Home Assistant restart?Successful runs delete it on purpose. After interruption, recover using normal controls.
Only some settings returnEach lamp’s reported settings, connection and the script traceTest the same brightness or color command directly. A scene cannot supply unsupported features or repair a connection.

A command failure can stop the sequence before restoration or cleanup. Conversely, a completed trace is not proof that every bulb physically changed. Watch the lamps during the first checks, and check their reported states afterward. If the device connection itself is unreliable, resolve that before relying on a timed return.

Other practical questions

Will a scene snapshot survive a Home Assistant restart?

No. A scene made with scene.create is temporary and is removed by a restart or scene reload. This script has no recovery after interruption. For a long cleaning session, use an explicitly saved normal scene and a clear way to activate it again.

Can it restore brightness and color?

For a light that was on, Home Assistant can send the captured brightness and supported color setting back through its light integration. The device must report the relevant settings and accept those commands. A light that was off returns to off; its next-on brightness is a separate limitation.

Does a scene know whether it is active?

No. A scene’s state is not an on/off indicator of the room’s appearance. It records activation information. Another command can change the lamps afterward, so inspect the individual lights when checking restoration.

For Tara’s home automation kit with coordinated local routines, the useful handoff is the same: a named control, a predictable return, and a clear recovery step when the routine is interrupted.