diff --git a/source/_docs/ecosystem.markdowm b/source/_docs/ecosystem.markdown similarity index 100% rename from source/_docs/ecosystem.markdowm rename to source/_docs/ecosystem.markdown diff --git a/source/_docs/scene.markdown b/source/_docs/scene.markdown new file mode 100644 index 00000000000..bd1e21f61c5 --- /dev/null +++ b/source/_docs/scene.markdown @@ -0,0 +1,88 @@ +--- +title: "Scenes" +description: "Instructions on how to setup scenes within Home Assistant." +--- + +You can create scenes that capture the states you want certain entities to be. For example, a scene can specify that light A should be turned on and light B should be bright red. + +```yaml +# Example configuration.yaml entry +scene: + - name: Romantic + entities: + light.tv_back_light: on + light.ceiling: + state: on + xy_color: [0.33, 0.66] + brightness: 200 + - name: Movies + entities: + light.tv_back_light: + state: on + brightness: 125 + light.ceiling: off + media_player.sony_bravia_tv: + state: on + source: HDMI 1 + state: on +``` + +{% configuration %} +name: + description: Friendly name of scene. + required: true + type: string +entities: + description: Entities to control and their desired state. + required: true + type: list +{% endconfiguration %} + +As you can see, there are two ways to define the states of each `entity_id`: + +- Define the `state` directly with the entity. Be aware, that `state` needs to be defined. +- Define a complex state with its attributes. You can see all attributes available for a particular entity under `developer-tools -> state`. + +Scenes can be activated using the service `scene.turn_on` (there is no 'scene.turn_off' service). + +```yaml +# Example automation +automation: + trigger: + platform: state + entity_id: device_tracker.sweetheart + 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: + state: on + 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. diff --git a/source/_docs/scene/editor.markdown b/source/_docs/scene/editor.markdown new file mode 100644 index 00000000000..fefe1e41050 --- /dev/null +++ b/source/_docs/scene/editor.markdown @@ -0,0 +1,77 @@ +--- +title: "Scenes Editor" +description: "Instructions on how to use the scenes editor." +--- + +In Home Assistant 0.102 we introduced the first version of our scene editor. If you just created a new configuration with Home Assistant, then you're all set! Go to the UI and enjoy. + +From the UI choose **Configuration** which is located in the sidebar, then click on **Scenes** to go to the scene editor. Press the **+** sign in the lower right corner to get started. + +Choose a meaningful name for your scene. + +

+ +

+ +Select all the devices (and/or entities when in advanced mode) you want to include in your scene. +The state of your devices will be saved, so it can be restored when you are finished creating your scene. +Set the state of the devices to how you want them to be in your scene, this can be done by clicking on it and edit the state from the popup, or any other method that changes the state. +On the moment you save the scene, all the states of your devices are stored in the scene. +When you leave the editor the states of the devices are restored to the state from before you started editing. + +## Updating your configuration to use the editor + +First, check that you have activated the configuration editor. + +```yaml +# Activate the configuration editor +config: +``` + +The scene editor reads and writes to the file `scenes.yaml` in the root of your [configuration](/docs/configuration/) folder. +Currently, both the name of this file and its location are fixed. +Make sure that you have set up the scene integration to read from it: + +```yaml +# Configuration.yaml example +scene: !include scenes.yaml +``` + +If you still want to use your old scene section, add a label to the old entry: + +```yaml +scene old: + - name: ... +``` + +You can use the `scene:` and `scene old:` sections at the same time: + +- `scene old:` to keep your manual designed scenes +- `scene:` to save the scene created by the online editor + +```yaml +scene: !include scenes.yaml +scene old: !include_dir_merge_list scenes +``` + +## Migrating your scenes to `scenes.yaml` + +If you want to migrate your old scenes to use the editor, you'll have to copy them to `scenes.yaml`. Make sure that `scenes.yaml` remains a list! For each scene that you copy over, you'll have to add an `id`. This can be any string as long as it's unique. + +For example: + +```yaml +# Example scenes.yaml entry +- id: my_unique_id # <-- Required for editor to work. + name: Romantic + entities: + light.tv_back_light: on + light.ceiling: + state: on + xy_color: [0.33, 0.66] + brightness: 200 +``` + +
+Any comments in the YAML file will be lost and templates will be reformatted when you update an automation via the editor. +
diff --git a/source/_docs/ecosystem/scenegen.markdown b/source/_docs/scene/scenegen.markdown similarity index 100% rename from source/_docs/ecosystem/scenegen.markdown rename to source/_docs/scene/scenegen.markdown diff --git a/source/_includes/asides/docs_navigation.html b/source/_includes/asides/docs_navigation.html index 0ce9be273b6..8f54340183b 100644 --- a/source/_includes/asides/docs_navigation.html +++ b/source/_includes/asides/docs_navigation.html @@ -1,7 +1,7 @@
-
+

Topics

- +
  • + {% active_link /docs/scene/ Scenes %} +
      +
    • {% active_link /docs/scene/editor/ Editor %}
    • +
    • {% active_link /docs/scene/scenegen/ scenegen %}
    • +
    +
  • {% active_link /docs/tools/ Tools and Helpers %}
      @@ -102,21 +150,40 @@
    • {% active_link /docs/security/ Security %}
        -
      • {% active_link /docs/security/webserver/ Web server fingerprint %}
      • +
      • + {% active_link /docs/security/webserver/ Web server fingerprint %} +
      • {% active_link /docs/security/porosity/ Porosity %}
    • {% active_link /docs/z-wave/ Z-Wave %}
        -
      • {% active_link /docs/z-wave/installation/ Configuring the Z-Wave component %}
      • +
      • + {% active_link /docs/z-wave/installation/ Configuring the Z-Wave + component %} +
      • {% active_link /docs/z-wave/adding/ Adding devices %}
      • -
      • {% active_link /docs/z-wave/control-panel/ The Z-Wave control panel %}
      • +
      • + {% active_link /docs/z-wave/control-panel/ The Z-Wave control panel + %} +
      • {% active_link /docs/z-wave/controllers/ Controllers %}
      • -
      • {% active_link /docs/z-wave/devices/ Devices %} and {% active_link /docs/z-wave/entities/ Entities %}
      • -
      • {% active_link /docs/z-wave/query-stage/ Query Stages %} for devices
      • -
      • {% active_link /docs/z-wave/device-specific/ Device Specific %} configuration
      • -
      • {% active_link /docs/z-wave/events/ Events %} and {% active_link /docs/z-wave/services/ Services %}
      • +
      • + {% active_link /docs/z-wave/devices/ Devices %} and {% active_link + /docs/z-wave/entities/ Entities %} +
      • +
      • + {% active_link /docs/z-wave/query-stage/ Query Stages %} for devices +
      • +
      • + {% active_link /docs/z-wave/device-specific/ Device Specific %} + configuration +
      • +
      • + {% active_link /docs/z-wave/events/ Events %} and {% active_link + /docs/z-wave/services/ Services %} +
    • @@ -126,7 +193,10 @@
    • {% active_link /docs/mqtt/certificate/ Certificate %}
    • {% active_link /docs/mqtt/discovery/ Discovery %}
    • {% active_link /docs/mqtt/service/ Publish service %}
    • -
    • {% active_link /docs/mqtt/birth_will/ Birth and last will messages %}
    • +
    • + {% active_link /docs/mqtt/birth_will/ Birth and last will messages + %} +
    • {% active_link /docs/mqtt/testing/ Testing your setup %}
    • {% active_link /docs/mqtt/logging/ Logging %}
    • {% active_link /docs/mqtt/processing_json/ Processing JSON %}
    • @@ -135,21 +205,52 @@
    • {% active_link /docs/ecosystem/ios/ iOS %}
        -
      • {% active_link /docs/ecosystem/ios/notifications/basic/ Basic notifications %}
      • +
      • + {% active_link /docs/ecosystem/ios/notifications/basic/ Basic + notifications %} +
        • -
        • {% active_link /docs/ecosystem/ios/notifications/sounds/ Sounds %}
        • -
        • {% active_link /docs/ecosystem/ios/notifications/architecture/ Architecture %}
        • -
        • {% active_link /docs/ecosystem/ios/notifications/privacy_security_rate_limits/ Privacy, rate limiting and security %}
        • +
        • + {% active_link /docs/ecosystem/ios/notifications/sounds/ Sounds %} +
        • +
        • + {% active_link /docs/ecosystem/ios/notifications/architecture/ + Architecture %} +
        • +
        • + {% active_link + /docs/ecosystem/ios/notifications/privacy_security_rate_limits/ + Privacy, rate limiting and security %} +
      • Advanced notifications
        • -
        • {% active_link /docs/ecosystem/ios/notifications/attachments/ Attachments %}
        • -
        • {% active_link /docs/ecosystem/ios/notifications/content_extensions/ Dynamic content %}
        • -
        • {% active_link /docs/ecosystem/ios/notifications/actions/ Actionable notifications %}
        • -
        • {% active_link /docs/ecosystem/ios/notifications/requesting_location_updates/ Requesting location updates %}
        • +
        • + {% active_link /docs/ecosystem/ios/notifications/attachments/ + Attachments %} +
        • +
        • + {% active_link + /docs/ecosystem/ios/notifications/content_extensions/ Dynamic + content %} +
        • +
        • + {% active_link /docs/ecosystem/ios/notifications/actions/ + Actionable notifications %} +
        • +
        • + {% active_link + /docs/ecosystem/ios/notifications/requesting_location_updates/ + Requesting location updates %} +
        -
      • {% active_link /docs/ecosystem/ios/location/ Location Tracking %}
      • -
      • {% active_link /docs/ecosystem/ios/integration/ Integration with other apps %}
      • +
      • + {% active_link /docs/ecosystem/ios/location/ Location Tracking %} +
      • +
      • + {% active_link /docs/ecosystem/ios/integration/ Integration with + other apps %} +
    • @@ -158,8 +259,12 @@
    • {% active_link /docs/autostart/ Autostart %}
        -
      • {% active_link /docs/autostart/systemd/ systemd (Linux) %}
      • -
      • {% active_link /docs/autostart/upstart/ Upstart (Linux) %}
      • +
      • + {% active_link /docs/autostart/systemd/ systemd (Linux) %} +
      • +
      • + {% active_link /docs/autostart/upstart/ Upstart (Linux) %} +
      • {% active_link /docs/autostart/init.d/ init.d (Linux) %}
      • {% active_link /docs/autostart/macos/ macOS %}
      • {% active_link /docs/autostart/synology/ Synology NAS %}
      • @@ -175,11 +280,21 @@ {% active_link /docs/ecosystem/notebooks/ Notebooks %}
        • {% active_link /docs/ecosystem/notebooks/ Introduction %}
        • -
        • {% active_link /docs/ecosystem/notebooks/installation/ Installation %}
        • +
        • + {% active_link /docs/ecosystem/notebooks/installation/ + Installation %} +
        • {% active_link /docs/ecosystem/notebooks/graph/ Graph %}
        • -
        • {% active_link /docs/ecosystem/notebooks/api/ Home Assistant API %}
        • -
        • {% active_link /docs/ecosystem/notebooks/database/ Database %}
        • -
        • {% active_link /docs/ecosystem/notebooks/stats/ Statistics %}
        • +
        • + {% active_link /docs/ecosystem/notebooks/api/ Home Assistant API + %} +
        • +
        • + {% active_link /docs/ecosystem/notebooks/database/ Database %} +
        • +
        • + {% active_link /docs/ecosystem/notebooks/stats/ Statistics %} +
      • @@ -189,30 +304,56 @@
      • {% active_link /docs/ecosystem/caddy/ Caddy Server %}
      • {% active_link /docs/ecosystem/haproxy/ HAProxy %}
      • {% active_link /docs/ecosystem/nginx/ NGINX %}
      • -
      • {% active_link /docs/ecosystem/nginx_subdomain/ NGINX with subdomain%}
      • +
      • + {% active_link /docs/ecosystem/nginx_subdomain/ NGINX with + subdomain%} +
      • {% active_link /docs/ecosystem/tor/ Tor Onion Service %}
    • {% active_link /docs/ecosystem/certificates/ Certificates %}
        -
      • {% active_link /docs/ecosystem/certificates/tls_self_signed_certificate/ Self-signed certificate %}
      • -
      • {% active_link /docs/ecosystem/certificates/tls_domain_certificate/ Certificate domain owners %}
      • -
      • {% active_link /docs/ecosystem/certificates/lets_encrypt/ Let's Encrypt (detailed) %}
      • +
      • + {% active_link + /docs/ecosystem/certificates/tls_self_signed_certificate/ + Self-signed certificate %} +
      • +
      • + {% active_link + /docs/ecosystem/certificates/tls_domain_certificate/ Certificate + domain owners %} +
      • +
      • + {% active_link /docs/ecosystem/certificates/lets_encrypt/ Let's + Encrypt (detailed) %} +
    • Backup
        -
      • {% active_link /docs/ecosystem/backup/backup_github/ Backup to GitHub %}
      • -
      • {% active_link /docs/ecosystem/backup/backup_dropbox/ Backup to Dropbox %}
      • -
      • {% active_link /docs/ecosystem/backup/backup_usb/ Backup to USB device %}
      • +
      • + {% active_link /docs/ecosystem/backup/backup_github/ Backup to + GitHub %} +
      • +
      • + {% active_link /docs/ecosystem/backup/backup_dropbox/ Backup to + Dropbox %} +
      • +
      • + {% active_link /docs/ecosystem/backup/backup_usb/ Backup to USB + device %} +
    • -
    • {% active_link /docs/ecosystem/scenegen/ scenegen %}
    • {% active_link /docs/ecosystem/synology/ Synology %}
    • -
    • {% active_link /docs/ecosystem/hass-configurator/ HASS Configurator %}
    • +
    • + {% active_link /docs/ecosystem/hass-configurator/ HASS Configurator + %} +
    +
  • diff --git a/source/images/docs/scenes/editor.png b/source/images/docs/scenes/editor.png new file mode 100644 index 00000000000..168f48b012b Binary files /dev/null and b/source/images/docs/scenes/editor.png differ