From: Giorgio Ravera Date: Thu, 1 Oct 2020 10:29:17 +0000 (+0200) Subject: Shorthand notation for template conditions. X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=bb485967f955b82590850a53b33eeb074111ed8f;p=homeassistant.git Shorthand notation for template conditions. --- diff --git a/automations/doors.yaml b/automations/doors.yaml index a566eb09..e37a14b3 100644 --- a/automations/doors.yaml +++ b/automations/doors.yaml @@ -16,11 +16,7 @@ entity_id: binary_sensor.main_door_contact to: 'on' - condition: - - condition: numeric_state - entity_id: sun.sun - value_template: "{{ state_attr('sun.sun', 'elevation') }}" - below: -10 + condition: "{{ (state_attr('sun.sun', 'elevation') | int) < 10 }}" action: - delay: 00:00:01 diff --git a/packages/alarm/guard_mode.yaml b/packages/alarm/guard_mode.yaml index 5c425cd5..8743736b 100644 --- a/packages/alarm/guard_mode.yaml +++ b/packages/alarm/guard_mode.yaml @@ -44,10 +44,7 @@ automation: - platform: homeassistant event: start - condition: - condition: template - value_template: >- - {{ not is_state('group.residents', 'home') }} + condition: "{{ not is_state('group.residents', 'home') }}" action: - service: input_boolean.turn_on @@ -66,10 +63,7 @@ automation: - platform: homeassistant event: start - condition: - condition: template - value_template: >- - {{ is_state('group.residents', 'home') }} + condition: "{{ is_state('group.residents', 'home') }}" action: - service: input_boolean.turn_off