]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Added themes automations.
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 19 Feb 2019 15:52:05 +0000 (16:52 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Thu, 21 Feb 2019 12:22:56 +0000 (13:22 +0100)
automation/home_assistant.yaml
automation/themes.yaml [new file with mode: 0644]

index a7f3f92ecafd309b3107cb11e7597b67b9679a7a..753c54c7f8686f564a4917e461a3db748af76990 100644 (file)
             input_boolean.home_mode_day
           {% else %}
             input_boolean.home_mode_night
-          {% endif %}
-
-    - service: frontend.set_theme
-      data_template:
-        name: >-
-          {% if now().strftime('%H')|int >= 8 and now().strftime('%H')|int < 23 %}
-            default
-          {% else %}
-            midnight
-          {% endif %}        
+          {% endif %}      
 
 ######################################################################
 # Home Assistant: Management of Speech Notifications
 
   action:
     - service_template: >-
-          {% if trigger.to_state.state == 'on' %}
-            input_boolean.turn_off
-          {% else %}
-            input_boolean.turn_on
-          {% endif %}
+        {% if trigger.to_state.state == 'on' %}
+          input_boolean.turn_off
+        {% else %}
+          input_boolean.turn_on
+        {% endif %}
       data:
         entity_id: input_boolean.speech_notifications
    
diff --git a/automation/themes.yaml b/automation/themes.yaml
new file mode 100644 (file)
index 0000000..3aae6ac
--- /dev/null
@@ -0,0 +1,22 @@
+######################################################################
+# Themes: Management of Day/Night Mode
+######################################################################
+
+- alias: "Temi: Modalità giorno/Notte"
+  initial_state: 'on'
+
+  trigger:
+    - platform: state
+      entity_id: input_boolean.home_mode_night
+      to: 'on'
+    - platform: state
+      entity_id: input_boolean.home_mode_night
+      to: 'off'
+    - service: frontend.set_theme
+      data_template:
+        name: >-
+          {% if now().strftime('%H')|int >= 8 and now().strftime('%H')|int < 23 %}
+            default
+          {% else %}
+            midnight
+          {% endif %}