diff --git a/source/_docs/automation/yaml.markdown b/source/_docs/automation/yaml.markdown index 0ae7fb06304..3ff95ef7284 100644 --- a/source/_docs/automation/yaml.markdown +++ b/source/_docs/automation/yaml.markdown @@ -21,6 +21,90 @@ automation kitchen: You can add as many labeled `automation` blocks as you want. +{% configuration %} +alias: + description: Friendly name for the automation. + required: false + type: string +id: + description: A unique id for your automation, will allow you to make changes to the name and entity_id in the UI, and will enable debug traces. + required: false + type: string +description: + description: A description of the automation. + required: false + default: '' + type: string +initial_state: + description: Used to define the state of your automation at startup. When not set, the state will be restored from the last run. + required: false + type: boolean + default: Restored from last run +trace: + description: Configuration values for the traces stored, currently only `stored_traces` can be configured. + required: false + default: {} + type: map + keys: + stored_traces: + description: The number of traces which will be stored + type: integer + default: 5 + required: false +variables: + description: Variables that will be available inside your templates, both in `condition` and `action`. + required: false + default: {} + type: map + keys: + PARAMETER_NAME: + description: The value of the variable. Any YAML is valid. Templates can also be used to pass a value to the variable. + type: any +trigger_variables: + description: Variables that will be available inside your [templates triggers](automation/trigger/#template-trigger). + required: false + default: {} + type: map + keys: + PARAMETER_NAME: + description: The value of the variable. Any YAML is valid. Only [limited templates](/docs/configuration/templating/#limited-templates) can be used. + type: any +mode: + description: "Controls what happens when the automation is invoked while it is still running from one or more previous invocations. See [Automation Modes](#automation-modes)." + required: false + type: string + default: single +max: + description: "Controls maximum number of runs executing and/or queued up to run at a time. Only valid with modes `queued` and `parallel`." + required: false + type: integer + default: 10 +max_exceeded: + description: "When `max` is exceeded (which is effectively 1 for `single` mode) a log message will be emitted to indicate this has happened. This option controls the severity level of that log message. See [Log Levels](/integrations/logger/#log-levels) for a list of valid options. Or `silent` may be specified to suppress the message from being emitted." + required: false + type: string + default: warning +action: + description: The sequence of actions to be performed in the script. + required: true + type: list +{% endconfiguration %} + +### Automation Modes + +Mode | Description +-|- +`single` | Do not start a new run. Issue a warning. +`restart` | Start a new run after first stopping previous run. +`queued` | Start a new run after all previous runs complete. Runs are guaranteed to execute in the order they were queued. +`parallel` | Start a new, independent run in parallel with previous runs. + +

+ +

+ + + ## YAML Example Example of a YAML based automation that you can add to `configuration.yaml`.