Create scene
Use this action to create a scene while Home Assistant is running, without adding it to your configuration. You can list the entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] and the states you want them to have, take a snapshot of the states they have right now, or combine both.
A scene created this way is temporary. It disappears when you reload the scenes or restart Home Assistant.
Snapshots make this action a good fit for automations that change something for a while and then put everything back the way it was.
Using this action from the user interface
If you prefer building automations and scripts visually, Home Assistant walks you through this action step by step. You pick what to target, tweak a few options, and save. No YAML knowledge required.
To create a scene from an automation or a script:
- Go to Settings > Automations & scenes.
- Open an existing automation or script, or select Create automation > Create new automation.
- If you’re setting up a new automation, add a trigger in the When section. Scripts don’t need a trigger. They run when something else calls them.
- In the Then do section, select Add action.
- From the search box, search for and select Create scene.
- Enter a Scene entity ID for the new scene, in lowercase and with underscores instead of spaces.
- Fill in Entity states, Entities snapshot, or both.
- Select Save.
This action does not support targets. In the UI, you are not prompted to choose an area, device, entity, or label.
Options in the UI
The ID of the new scene, in lowercase and with underscores instead of spaces. The scene becomes available as scene.your_id.
The entities and the state you want each of them to have. Use this when you know the states you want. If the entities are already in the states you want to store, use Entities snapshot instead.
Using this action in YAML
If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required.
In YAML, refer to this action as scene.create. A basic example looks like this:
action: scene.create
data:
scene_id: my_scene
entities:
light.tv_back_light:
state: "on"
brightness: 100
light.ceiling: "off"
This creates scene.my_scene, which sets the two lights to those states when you activate it.
To store the states the entities have right now, use a snapshot instead:
action: scene.create
data:
scene_id: before
snapshot_entities:
- climate.ecobee
- light.ceiling_lights
Options in YAML
The ID of the new scene, in lowercase and with underscores instead of spaces. The scene becomes available as scene.your_id.
A mapping of entity IDs to the state you want each of them to have. Use a plain value such as "on" for the state only, or a mapping with a state key and attributes such as brightness.
Good to know
- Set at least one of
entitiesorsnapshot_entities. You can also combine them, for example to store the current state of some entities and pick specific states for others. - If a scene with the same ID was created with this action before, it is overwritten. If a scene with that ID comes from your YAML configuration, nothing happens and a warning appears in your logs.
- Scenes created with this action are removed again by Reload scenes or by a restart. To remove one on demand, use Delete scene.
Try it yourself
Ready to test this? Open Settings > Tools > Actions, search for this action, fill in the fields, and select Perform action. You see what happens on your actual entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] without writing a line of YAML.
More examples
Real scenarios where this action shows up in automations and scripts. Copy any example and adapt it to your setup.
You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.
Automation: restore the room after a window is closed
Store the current states before turning things off, then activate the stored scene once the window is closed again.
-
Trigger: Window opened
- Target: Window
-
Action: Create scene
-
Scene entity ID:
before - Entities snapshot: thermostat and ceiling lights
-
Scene entity ID:
Show example YAML
- alias: "Window opened"
triggers:
- trigger: window.opened
target:
entity_id: binary_sensor.window
actions:
- action: scene.create
data:
scene_id: before
snapshot_entities:
- climate.ecobee
- light.ceiling_lights
- action: light.turn_off
target:
entity_id: light.ceiling_lights
- action: climate.set_hvac_mode
target:
entity_id: climate.ecobee
data:
hvac_mode: "off"
- alias: "Window closed"
triggers:
- trigger: window.closed
target:
entity_id: binary_sensor.window
actions:
- action: scene.turn_on
target:
entity_id: scene.before
Still stuck?
The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the action you’re calling and what you expected to happen, or share on our subreddit /r/homeassistant.
AI assistants like ChatGPT or Claude can also explain actions or suggest the right one when you describe what you want in plain language.
Related actions
These actions work well alongside this one:
-
Activate scene: Activates a scene.
-
Delete scene: Deletes a scene that was created on the fly.
-
Apply scene: Activates a set of entity states without defining a scene first.