]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Fixed Central Heating de-activation.
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Sun, 16 May 2021 17:13:06 +0000 (19:13 +0200)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Sun, 16 May 2021 17:13:06 +0000 (19:13 +0200)
packages/central_heating.yaml

index 168fc7db0ecc3ecd5862ebc9a859e061cf66d82f..71532f41e92dce9832a9e7eea863613934fdd04c 100644 (file)
@@ -26,7 +26,7 @@ input_boolean:
     icon: mdi:home-thermometer
 
 ######################################################################
-# Central Heating    
+# Central Heating
 ######################################################################
 
 automation:
@@ -41,19 +41,13 @@ automation:
         event: start
       - platform: time
         at: '00:00:00'
-      - platform: state
-        entity_id: input_boolean.central_heating
-        to: 'on'
-      - platform: state
-        entity_id: input_boolean.central_heating
-        to: 'off'
 
     condition: []
 
     action:
       - choose:
         # Switch on
-        - conditions: "{{ now().month == 11 and now().day == 1 }}"
+        - conditions: "{{ now().month == 11 and now().day == 1 and is_state('input_boolean.central_heating', 'off') }}"
           sequence:
             - service: input_boolean.turn_on
               data_template:
@@ -62,11 +56,11 @@ automation:
               data_template:
                 title: "Home Assistant - Riscaldamento Centralizzato"
                 message: "Il riscaldamento centralizzato รจ stato acceso"
-      
+
         # Switch off
-        - conditions: "{{ now().month == 4 and now().day == 15 }}"
+        - conditions: "{{ now().month == 5 and now().day == 15 and is_state('input_boolean.central_heating', 'on')}}"
           sequence:
-            - service: input_boolean.turn_on
+            - service: input_boolean.turn_off
               data_template:
                 entity_id: input_boolean.central_heating
             - service: script.notify_text