From 20587cff4933c63a7f2156f4cd186fa219aa8d41 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Mon, 3 Jul 2023 17:32:26 -0400 Subject: [PATCH] Fix E's A/C getting shut off when we leave on hot days --- packages/presence.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/presence.yaml b/packages/presence.yaml index c10a71f..2c124c0 100644 --- a/packages/presence.yaml +++ b/packages/presence.yaml @@ -704,15 +704,16 @@ script: - input_boolean.white_noise_kallen_bedroom - input_boolean.white_noise_emma_bedroom - if: - - condition: not - conditions: - - condition: state - entity_id: - - input_boolean.hot_day - - binary_sensor.heat_warning - - binary_sensor.heat_threshold - - binary_sensor.heat_index_threshold - state: 'on' + - condition: template + value_template: > + {% set heat = [ + states.input_boolean.hot_day, + states.binary_sensor.heat_warning, + states.binary_sensor.heat_threshold, + states.binary_sensor.heat_index_threshold + ] %} + {% set number = heat | selectattr('state','eq','on') | list | count | int %} + {{ number == 0 }} then: - service: fan.turn_off target: