mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 00:06:51 +00:00
Add stop/error script/automation action (#22338)
This commit is contained in:
parent
91f28433ab
commit
88dd32b169
@ -710,6 +710,29 @@ automation:
|
||||
|
||||
{% endraw %}
|
||||
|
||||
## Stopping a script sequence
|
||||
|
||||
It is possible to halt a script sequence at any point. Using the `stop` or
|
||||
`error` action.
|
||||
|
||||
Both actions take a text as input explaining the reason for halting the
|
||||
sequence. This text will be logged and shows up in the automations and
|
||||
script traces.
|
||||
|
||||
`stop` can be useful to halt a script halfway through a sequence when,
|
||||
for example, a condition is not met.
|
||||
|
||||
```yaml
|
||||
- stop: "Stop running the rest of the sequence"
|
||||
```
|
||||
|
||||
The `error` action stops a script as well, but marks the automation
|
||||
or script as failed to run.
|
||||
|
||||
```yaml
|
||||
- error: "Well, that was unexpected!"
|
||||
```
|
||||
|
||||
[Script component]: /integrations/script/
|
||||
[automations]: /getting-started/automation-action/
|
||||
[Alexa/Amazon Echo]: /integrations/alexa/
|
||||
|
Loading…
x
Reference in New Issue
Block a user