Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions source/_integrations/scene.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,27 @@ automation:
source: HDMI 1
```

## Deleting dynamically created scenes

Any scene that you have created with the `scene.create` service can also be deleted on demand with the `scene.delete` service.

You will need to pass in the `entity_id` of such a scene. As opposed to the `scene_id` used for creation, the `entity_id` must also include the `scene` domain.

If the scene was not previously created by `scene.create`, the service call will fail and an error will appear in the logs.

```yaml
# Example automation
automation:
trigger:
platform: state
entity_id: sun.sun
to: below_horizon
action:
- service: scene.delete
data:
entity_id: scene.my_scene
```

The following example turns off some entities as soon as a window opens. The states of the entities are restored after the window is closed again.

```yaml
Expand Down