From aa098e635dbb75f699be108cf88f06322305fa1e Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Wed, 24 May 2023 00:51:40 +0200 Subject: [PATCH] Other yaml improvements --- automations/nfc.yaml | 54 +++++++++++------------ automations/night.yaml | 3 -- packages/away_mode/away_mode_climate.yaml | 12 ++--- packages/netatmo/netatmo_away.yaml | 12 ++--- 4 files changed, 39 insertions(+), 42 deletions(-) diff --git a/automations/nfc.yaml b/automations/nfc.yaml index 5ac92908..94661e32 100644 --- a/automations/nfc.yaml +++ b/automations/nfc.yaml @@ -26,35 +26,35 @@ detected_device: "{{ trigger.event.data.device_id }}" - choose: - - conditions: - - "{{ detected_tag in allowed_tags }}" - - "{{ detected_device in allowed_devices }}" - sequence: - - service: script.notify_text - data_template: - title: "Home Assistant - Lettura NFC" - message: "Letto tag NFC {{ allowed_tags[detected_tag].name }} dal dispositivo {{ allowed_devices[detected_device].name }}." - enable_telegram: false + - conditions: + - "{{ detected_tag in allowed_tags }}" + - "{{ detected_device in allowed_devices }}" + sequence: + - service: script.notify_text + data_template: + title: "Home Assistant - Lettura NFC" + message: "Letto tag NFC {{ allowed_tags[detected_tag].name }} dal dispositivo {{ allowed_devices[detected_device].name }}." + enable_telegram: false - - conditions: - - "{{ detected_tag in allowed_tags }}" - - "{{ detected_device not in allowed_devices }}" - sequence: - - service: script.notify_text - data_template: - title: "Home Assistant - Lettura NFC" - message: "Letto tag NFC {{ allowed_tags[detected_tag].name }} da dispositivo non valido ({{ detected_device }})." - enable_telegram: false + - conditions: + - "{{ detected_tag in allowed_tags }}" + - "{{ detected_device not in allowed_devices }}" + sequence: + - service: script.notify_text + data_template: + title: "Home Assistant - Lettura NFC" + message: "Letto tag NFC {{ allowed_tags[detected_tag].name }} da dispositivo non valido ({{ detected_device }})." + enable_telegram: false - - conditions: - - "{{ detected_tag not in allowed_tags }}" - - "{{ detected_device in allowed_devices }}" - sequence: - - service: script.notify_text - data_template: - title: "Home Assistant - Lettura NFC" - message: "Letto tag NFC non riconosciuto ({{ detected_tag }}) dal dispositivo {{ allowed_devices[detected_device].name }}." - enable_telegram: false + - conditions: + - "{{ detected_tag not in allowed_tags }}" + - "{{ detected_device in allowed_devices }}" + sequence: + - service: script.notify_text + data_template: + title: "Home Assistant - Lettura NFC" + message: "Letto tag NFC non riconosciuto ({{ detected_tag }}) dal dispositivo {{ allowed_devices[detected_device].name }}." + enable_telegram: false default: - service: script.notify_text diff --git a/automations/night.yaml b/automations/night.yaml index 7c0fb121..d59b6923 100644 --- a/automations/night.yaml +++ b/automations/night.yaml @@ -12,9 +12,6 @@ to: 'on' condition: [] -# condition: state -# entity_id: input_boolean.home_mode_away -# state: 'off' action: - service: cover.set_cover_position diff --git a/packages/away_mode/away_mode_climate.yaml b/packages/away_mode/away_mode_climate.yaml index 048ff03a..bf503d13 100644 --- a/packages/away_mode/away_mode_climate.yaml +++ b/packages/away_mode/away_mode_climate.yaml @@ -33,12 +33,12 @@ automation: - conditions: - condition: and conditions: - - condition: state - entity_id: input_boolean.home_mode_away - state: "off" - - condition: state - entity_id: input_boolean.central_heating - state: 'on' + - condition: state + entity_id: input_boolean.home_mode_away + state: "off" + - condition: state + entity_id: input_boolean.central_heating + state: 'on' sequence: - service: script.turn_on data: diff --git a/packages/netatmo/netatmo_away.yaml b/packages/netatmo/netatmo_away.yaml index 131cca63..ed017483 100644 --- a/packages/netatmo/netatmo_away.yaml +++ b/packages/netatmo/netatmo_away.yaml @@ -68,12 +68,12 @@ automation: - conditions: - condition: and conditions: - - condition: state - entity_id: input_boolean.central_heating - state: "on" - - condition: state - entity_id: input_boolean.home_mode_away - state: 'off' + - condition: state + entity_id: input_boolean.central_heating + state: "on" + - condition: state + entity_id: input_boolean.home_mode_away + state: 'off' sequence: - service: script.turn_on data: -- 2.47.3