From 75c5a7b565ad2c50345ca95011b459046804691e Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Wed, 11 Mar 2020 23:14:49 +0200 Subject: [PATCH] Add window suggestions --- packages/routines/coming_home.yaml | 4 ++-- templates/partials/window_suggestions.yaml | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 templates/partials/window_suggestions.yaml diff --git a/packages/routines/coming_home.yaml b/packages/routines/coming_home.yaml index 212c5f0..c74878a 100644 --- a/packages/routines/coming_home.yaml +++ b/packages/routines/coming_home.yaml @@ -29,8 +29,8 @@ script: partials: - !include ../../templates/partials/greeting.yaml - !include ../../templates/partials/time.yaml - - "Here's the current status:" - - !include ../../templates/partials/window_check.yaml + # - "Here's the current status:" // TODO: figure out if there will be anything to say? + - !include ../../templates/partials/window_suggestions.yaml - wait_template: "{{ is_state('input_boolean.sarah_talking', 'off') }}" timeout: 00:02:00 - delay: 00:00:01 diff --git a/templates/partials/window_suggestions.yaml b/templates/partials/window_suggestions.yaml new file mode 100644 index 0000000..6be1f7d --- /dev/null +++ b/templates/partials/window_suggestions.yaml @@ -0,0 +1,15 @@ +>- + + {%- if states('sensor.dark_sky_temperature') < states('sensor.bedroom_weather_temperature') -%} + + {%- if is_state('binary_sensor.bedroom_right_window_on_off', 'off') + and states('sensor.bedroom_weather_temperature') > 22 + You should probably open the master bedroom window to cool down a bit. + {%- endif -%} + + {%- if is_state('binary_sensor.bedroom_right_window_on_off', 'on') + and states('sensor.bedroom_weather_temperature') < 18 + You should probably close the master bedroom window, it's getting chilly. + {%- endif -%} + + {% -endif -%}