mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Add scene.delete service for dynamically created scenes (with scene.create) (#26504)
* Add scene.delete service * remove unneeded newline * Update docs to match changes upstream2b691285ee
* Revert "Update docs to match changes upstream" This reverts commit 502c4f8afc309e25e61f74fd837c4253e296dce6. The reason is the reversal of the upstream functionality7f0108059b
--------- Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
6a8f51b94f
commit
1d77078397
@ -192,6 +192,27 @@ automation:
|
|||||||
source: HDMI 1
|
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.
|
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
|
```yaml
|
||||||
|
Loading…
x
Reference in New Issue
Block a user