Add scene apply docs (#10657)

* Add scene apply docs

* Fix lint

* Fix formatting
This commit is contained in:
Paulus Schoutsen 2019-10-08 09:59:38 -07:00 committed by GitHub
parent dfee71b20c
commit 303b8eea0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.