mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-24 09:46:59 +00:00
Add scene apply docs (#10657)
* Add scene apply docs * Fix lint * Fix formatting
This commit is contained in:
parent
dfee71b20c
commit
303b8eea0e
@ -50,14 +50,41 @@ Scenes can be activated using the service `scene.turn_on` (there is no 'scene.tu
|
||||
|
||||
```yaml
|
||||
# Example automation
|
||||
...
|
||||
automation:
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: device_tracker.sweetheart
|
||||
from: 'not_home'
|
||||
to: 'home'
|
||||
from: "not_home"
|
||||
to: "home"
|
||||
action:
|
||||
service: scene.turn_on
|
||||
entity_id: scene.romantic
|
||||
```
|
||||
|
||||
## Applying a scene without defining it
|
||||
|
||||
With the `scene.apply` service you are able to apply a scene without first defining it via configuration. Instead, you pass the states as part of the service data. The format of the data is the same as the `entities` field in a configuration.
|
||||
|
||||
```yaml
|
||||
# Example automation
|
||||
automation:
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: device_tracker.sweetheart
|
||||
from: "not_home"
|
||||
to: "home"
|
||||
action:
|
||||
service: scene.apply
|
||||
data:
|
||||
entities:
|
||||
light.tv_back_light:
|
||||
state: on
|
||||
brightness: 100
|
||||
light.ceiling: off
|
||||
media_player.sony_bravia_tv:
|
||||
source: HDMI 1
|
||||
```
|
||||
|
||||
## Reloading scenes
|
||||
|
||||
Whenever you make a change to your scene configuration, you can call the `scene.reload` service to reload the scenes.
|
||||
|
Loading…
x
Reference in New Issue
Block a user