]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Added away_mode actions
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 16 Dec 2019 07:52:50 +0000 (08:52 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 16 Dec 2019 07:52:50 +0000 (08:52 +0100)
automation/away_mode.yaml [new file with mode: 0644]
automation/home_assistant.yaml

diff --git a/automation/away_mode.yaml b/automation/away_mode.yaml
new file mode 100644 (file)
index 0000000..07e8cc5
--- /dev/null
@@ -0,0 +1,58 @@
+######################################################################
+# Away Mode: Enable Action
+######################################################################
+
+- alias: "Modalità Vacanza: Azione on"
+  initial_state: 'on'
+
+  trigger:
+    platform: state
+    entity_id: input_boolean.home_mode_away
+    to: 'on'
+
+  action:
+    - service: script.notify_voice
+      data_template:
+        message: "Modalità vacanza abilitata"
+
+######################################################################
+# Away Mode: Disable Action
+######################################################################
+
+- alias: "Modalità Vacanza: Azione off"
+  initial_state: 'on'
+
+  trigger:
+    platform: state
+    entity_id: input_boolean.home_mode_away
+    to: 'off'
+
+  action:
+    - service: script.notify_voice
+      data_template:
+        message: "Modalità vacanza disabilitata"
+
+######################################################################
+# Away Mode: Disable
+######################################################################
+
+- alias: "Modalità Vacanza: Disattivazione"
+  initial_state: 'on'
+  trigger:
+    - platform: zone
+      entity_id:
+        - device_tracker.google_maps_115265981849847357125
+        - device_tracker.google_maps_103158638433668748797
+        # - device_tracker.google_maps_113099283296073047871
+      zone: zone.casa
+      event: enter
+    - platform: template
+      value_template: "{{ states('sensor.time_date') == (state_attr('input_datetime.away_mode_end', 'timestamp') | int | timestamp_custom('%H:%M, %Y-%m-%d', true)) }}"
+
+  condition: []
+
+  action:
+    - service: input_boolean.turn_off
+      data:
+        entity_id: input_boolean.home_mode_away
index 4002000de04810e5abfe11fc55037049062ad9a9..d103521d8ff7658094cb0c703b21bbd8376efb10 100644 (file)
     
     - service: script.volume_manager
 
-######################################################################
-# Home Assistant: Management Away Mode
-######################################################################
-
-- alias: "Home Assistant: Modalità Vacanza"
-  initial_state: 'on'
-  trigger:
-    - platform: zone
-      entity_id:
-        - device_tracker.google_maps_115265981849847357125
-        - device_tracker.google_maps_103158638433668748797
-        # - device_tracker.google_maps_113099283296073047871
-      zone: zone.casa
-      event: enter
-    - platform: template
-      value_template: "{{ states('sensor.time_date') == (state_attr('input_datetime.away_mode_end', 'timestamp') | int | timestamp_custom('%H:%M, %Y-%m-%d', true)) }}"
-
-  condition: []
-
-  action:
-    - service: input_boolean.turn_off
-      data:
-        entity_id: input_boolean.home_mode_away  
-
 ######################################################################
 # Home Assistant: Management of Speech Notifications
 ######################################################################