From 303b8eea0ed25286833b5401ef51108b919eb363 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 8 Oct 2019 09:59:38 -0700 Subject: [PATCH] Add scene apply docs (#10657) * Add scene apply docs * Fix lint * Fix formatting --- source/_integrations/scene.markdown | 33 ++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/source/_integrations/scene.markdown b/source/_integrations/scene.markdown index 466b815b248..2745e4825ef 100644 --- a/source/_integrations/scene.markdown +++ b/source/_integrations/scene.markdown @@ -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.