diff --git a/plugins/configuration.rb b/plugins/configuration.rb index cfaccceef80..9c56deee1e2 100644 --- a/plugins/configuration.rb +++ b/plugins/configuration.rb @@ -9,7 +9,7 @@ module Jekyll TYPES = [ 'action', 'boolean', 'string', 'integer', 'float', 'time', 'template', - 'device_class', 'icon', 'map', 'list', 'date', 'datetime' + 'device_class', 'icon', 'map', 'list', 'date', 'datetime', 'any' ] MIN_DEFAULT_LENGTH = 30 diff --git a/source/_docs/automation/action.markdown b/source/_docs/automation/action.markdown index 3cbb857e014..cc8c9122757 100644 --- a/source/_docs/automation/action.markdown +++ b/source/_docs/automation/action.markdown @@ -22,15 +22,18 @@ automation: entity_id: - light.kitchen - light.living_room + automation 2: # Notify me on my mobile phone of an event trigger: platform: sun event: sunset offset: -00:30 + variables: + notification_service: notify.paulus_iphone action: # Actions are scripts so can also be a list of actions - - service: notify.notify + - service: {{ notification_service }} data: message: Beautiful sunset! - delay: 0:35 diff --git a/source/_integrations/script.markdown b/source/_integrations/script.markdown index a4a0054c88a..0498c522351 100644 --- a/source/_integrations/script.markdown +++ b/source/_integrations/script.markdown @@ -17,7 +17,7 @@ The `script` integration allows users to specify a sequence of actions to be exe The sequence of actions is specified using the [Home Assistant Script Syntax](/getting-started/scripts/). {% raw %} - + ```yaml # Example configuration.yaml entry script: @@ -51,6 +51,15 @@ description: required: false default: '' type: string +variables: + description: Variables that will be available inside your templates + required: false + default: {} + type: map + keys: + PARAMETER_NAME: + description: The value of the variable. Any YAML is valid. + type: any fields: description: Information about the parameters that the script uses; see the [Passing variables to scripts](#passing-variables-to-scripts) section below. required: false @@ -111,6 +120,8 @@ script:  alias: Wake Up icon: "mdi:party-popper" description: 'Turns on the bedroom lights and then the living room lights after a delay' + variables: + turn_on_entity: group.living_room fields: minutes: description: 'The amount of time to wait before turning on the living room lights' @@ -136,7 +147,7 @@ script:  - alias: Living room lights on service: light.turn_on data: - entity_id: group.living_room + entity_id: {{ turn_on_entity }} ``` {% endraw %}