diff --git a/source/getting-started/automation-action.markdown b/source/getting-started/automation-action.markdown index b08c9678a93..b099686bde8 100644 --- a/source/getting-started/automation-action.markdown +++ b/source/getting-started/automation-action.markdown @@ -47,3 +47,24 @@ automation 2: data: message: Oh wow you really missed something great. ``` + + +Conditions can also be part of an action: + +```yaml +automation: +- alias: 'Enciende Despacho' + trigger: + platform: state + entity_id: sensor.mini_despacho + to: 'ON' + action: + - condition: or + conditions: + - condition: template + value_template: '{{ states.sun.sun.attributes.elevation < 4 }}' + - condition: template + value_template: '{{ states.sensor.sensorluz_7_0.state < 10 }}' + - service: scene.turn_on + entity_id: scene.DespiertaDespacho +```