mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-25 02:07:15 +00:00
Allow disabling specific triggers/actions/conditions (#22401)
This commit is contained in:
parent
fc41d1c77f
commit
f36774bfc9
@ -879,3 +879,23 @@ automation:
|
|||||||
- sensor.two
|
- sensor.two
|
||||||
- sensor.three
|
- sensor.three
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Disabling a trigger
|
||||||
|
|
||||||
|
Every individual trigger in an automation can be disabled, without removing it.
|
||||||
|
To do so, add `enabled: false` to the trigger. For example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Example script with a disabled trigger
|
||||||
|
automation:
|
||||||
|
trigger:
|
||||||
|
# This trigger will not trigger, as it is disabled.
|
||||||
|
# This automation does not run when the sun is set.
|
||||||
|
- enabled: false
|
||||||
|
platform: sun
|
||||||
|
event: sunset
|
||||||
|
|
||||||
|
# This trigger will fire, as it is not disabled.
|
||||||
|
- platform: time
|
||||||
|
at: "15:32:00"
|
||||||
|
```
|
||||||
|
@ -816,6 +816,31 @@ it encounters an error; it will continue to the next action.
|
|||||||
Please note that `continue_on_error` will not suppress/ignore misconfiguration
|
Please note that `continue_on_error` will not suppress/ignore misconfiguration
|
||||||
or errors that Home Assistant does not handle.
|
or errors that Home Assistant does not handle.
|
||||||
|
|
||||||
|
## Disabling an action
|
||||||
|
|
||||||
|
Every individual action in a sequence can be disabled, without removing it.
|
||||||
|
To do so, add `enabled: false` to the action. For example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Example script with a disabled action
|
||||||
|
script:
|
||||||
|
example_script:
|
||||||
|
sequence:
|
||||||
|
# This action will not run, as it is disabled.
|
||||||
|
# The message will not be sent.
|
||||||
|
- enabled: false
|
||||||
|
alias: "Notify that ceiling light is being turned on"
|
||||||
|
service: notify.notify
|
||||||
|
data:
|
||||||
|
message: "Turning on the ceiling light!"
|
||||||
|
|
||||||
|
# This action will run, as it is not disabled
|
||||||
|
- alias: "Turn on ceiling light"
|
||||||
|
service: light.turn_on
|
||||||
|
target:
|
||||||
|
entity_id: light.ceiling
|
||||||
|
```
|
||||||
|
|
||||||
[Script component]: /integrations/script/
|
[Script component]: /integrations/script/
|
||||||
[automations]: /getting-started/automation-action/
|
[automations]: /getting-started/automation-action/
|
||||||
[Alexa/Amazon Echo]: /integrations/alexa/
|
[Alexa/Amazon Echo]: /integrations/alexa/
|
||||||
|
@ -630,3 +630,22 @@ condition:
|
|||||||
```
|
```
|
||||||
|
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
|
## Disabling a condition
|
||||||
|
|
||||||
|
Every individual condition can be disabled, without removing it.
|
||||||
|
To do so, add `enabled: false` to the condition configuration.
|
||||||
|
|
||||||
|
This can be useful if you want to temporarily disable a condition, for example,
|
||||||
|
for testing. A disabled condition will always pass.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# This condition will always pass, as it is disabled.
|
||||||
|
condition:
|
||||||
|
enabled: false
|
||||||
|
condition: state
|
||||||
|
entity_id: sun.sun
|
||||||
|
state: "above_horizon"
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user