mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 15:26:59 +00:00
Update automation-condition.markdown
This commit is contained in:
parent
23372151fc
commit
fad06bc075
@ -20,4 +20,24 @@ automation:
|
||||
|
||||
The available conditions for an automation are the same as for the script syntax. So see that page for a [full list of available conditions][script-condition].
|
||||
|
||||
Example of using condition:
|
||||
|
||||
```yaml
|
||||
- alias: 'Enciende Despacho'
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: sensor.mini_despacho
|
||||
to: 'ON'
|
||||
condition:
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: template
|
||||
value_template: '{{ states.sun.sun.attributes.elevation < 4 }}'
|
||||
- condition: template
|
||||
value_template: '{{ states.sensor.sensorluz_7_0.state < 10 }}'
|
||||
action:
|
||||
- service: scene.turn_on
|
||||
entity_id: scene.DespiertaDespacho
|
||||
```
|
||||
|
||||
[script-condition]: /getting-started/scripts-conditions/
|
||||
|
Loading…
x
Reference in New Issue
Block a user