From 1fe258ec11dee822aa1d5d7ce70c9cc670d97e1d Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Wed, 20 May 2020 22:11:49 +0300 Subject: [PATCH] Use condition: not --- .../home_dashboard/bathroom_dashboard.yaml | 3 +++ .../packages/devices/living_room/toshiba_ac.yaml | 7 +++++-- config/packages/modules/github.yaml | 7 +++++-- .../modules/lighting/by_rooms/hallway.yaml | 14 ++++++++++---- .../modules/lighting/by_rooms/kitchen.yaml | 14 ++++++++++---- config/packages/modules/speech.yaml | 7 +++++-- 6 files changed, 38 insertions(+), 14 deletions(-) diff --git a/config/lovelace/home_dashboard/bathroom_dashboard.yaml b/config/lovelace/home_dashboard/bathroom_dashboard.yaml index e2690e9..4b2435f 100644 --- a/config/lovelace/home_dashboard/bathroom_dashboard.yaml +++ b/config/lovelace/home_dashboard/bathroom_dashboard.yaml @@ -16,6 +16,9 @@ cards: - type: vertical-stack cards: + - type: entities + entities: + - media_player.bathroom - type: custom:decluttering-card template: media_with_controls variables: diff --git a/config/packages/devices/living_room/toshiba_ac.yaml b/config/packages/devices/living_room/toshiba_ac.yaml index b0583ab..fb1a341 100644 --- a/config/packages/devices/living_room/toshiba_ac.yaml +++ b/config/packages/devices/living_room/toshiba_ac.yaml @@ -99,8 +99,11 @@ automation: from: "off" to: "on" condition: - condition: template - value_template: "{{ not is_state('climate.toshiba_ac', 'off') }}" + condition: not + conditions: + - condition: state + entity_id: climate.toshiba_ac + state: 'off' action: - service: climate.turn_off entity_id: climate.toshiba_ac diff --git a/config/packages/modules/github.yaml b/config/packages/modules/github.yaml index d2b9b16..28e9d25 100644 --- a/config/packages/modules/github.yaml +++ b/config/packages/modules/github.yaml @@ -48,8 +48,11 @@ automation: - sensor.time_picker_card_downloads - sensor.folder_card_downloads condition: - condition: template - value_template: "{{ not is_state('input_select.house_mode', 'night') }}" + condition: not + conditions: + - condition: state + entity_id: input_select.house_mode + state: 'night' action: - service: script.say data_template: diff --git a/config/packages/modules/lighting/by_rooms/hallway.yaml b/config/packages/modules/lighting/by_rooms/hallway.yaml index f9c5644..87dfdc3 100644 --- a/config/packages/modules/lighting/by_rooms/hallway.yaml +++ b/config/packages/modules/lighting/by_rooms/hallway.yaml @@ -33,8 +33,11 @@ automation: entity_id: binary_sensor.motion_2_ias_zone to: "on" condition: - condition: template - value_template: "{{ not is_state('input_select.house_mode', 'day') }}" + condition: not + conditions: + - condition: state + entity_id: input_select.house_mode + state: 'day' action: - service: light.turn_on entity_id: light.light_lohas_6 @@ -53,8 +56,11 @@ automation: for: minutes: 5 condition: - condition: template - value_template: "{{ not is_state('input_select.house_mode', 'day') }}" + condition: not + conditions: + - condition: state + entity_id: input_select.house_mode + state: 'day' action: - service: light.turn_on entity_id: diff --git a/config/packages/modules/lighting/by_rooms/kitchen.yaml b/config/packages/modules/lighting/by_rooms/kitchen.yaml index 4be38e5..fb2773c 100644 --- a/config/packages/modules/lighting/by_rooms/kitchen.yaml +++ b/config/packages/modules/lighting/by_rooms/kitchen.yaml @@ -56,8 +56,11 @@ automation: entity_id: binary_sensor.motion_1_ias_zone to: "on" condition: - - condition: template - value_template: "{{ not is_state('input_select.house_mode', 'day') }}" + - condition: not + conditions: + - condition: state + entity_id: input_select.house_mode + state: 'day' - condition: state entity_id: input_boolean.georgi_home state: "on" @@ -77,8 +80,11 @@ automation: for: minutes: 5 condition: - condition: template - value_template: "{{ not is_state('input_select.house_mode', 'day') }}" + condition: not + conditions: + - condition: state + entity_id: input_select.house_mode + state: 'day' action: - service: light.turn_on entity_id: light.light_le_12 diff --git a/config/packages/modules/speech.yaml b/config/packages/modules/speech.yaml index f8eeeb0..5bfe4f5 100644 --- a/config/packages/modules/speech.yaml +++ b/config/packages/modules/speech.yaml @@ -30,8 +30,11 @@ script: alias: Speech ยท Say sequence: # Don't talk while in night mode. - - condition: template - value_template: "{{ not is_state('input_select.house_mode', 'night') }}" + - condition: not + conditions: + - condition: state + entity_id: input_select.house_mode + state: 'night' # Combine partials for speech message. - service: script.say_discretely data_template: