]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Review after zone changes
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 4 Feb 2020 20:50:51 +0000 (21:50 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 4 Feb 2020 20:50:51 +0000 (21:50 +0100)
automation/away_mode.yaml
automation/guard_mode.yaml
automation/speech.yaml
script/speech_engine.yaml

index 07e8cc5f821ce8083358640970fbcd56617cdca0..174110686e81e0682909c51960f7ea027a65ebcb 100644 (file)
@@ -6,9 +6,9 @@
   initial_state: 'on'
 
   trigger:
-    platform: state
-    entity_id: input_boolean.home_mode_away
-    to: 'on'
+    platform: state
+      entity_id: input_boolean.home_mode_away
+      to: 'on'
 
   action:
     - service: script.notify_voice
@@ -23,9 +23,9 @@
   initial_state: 'on'
 
   trigger:
-    platform: state
-    entity_id: input_boolean.home_mode_away
-    to: 'off'
+    platform: state
+      entity_id: input_boolean.home_mode_away
+      to: 'off'
 
   action:
     - service: script.notify_voice
   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: state
+      entity_id: group.residents
+      to: 'home'
     - 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)) }}"
 
index c2a6f2ea9917bfdc3fce33d6f9d30dc1c2b056e5..f046938fb4f9a111011eaadbfd37eb22d5846dd7 100644 (file)
@@ -6,20 +6,16 @@
   initial_state: 'on'
 
   trigger:
-    - platform: zone
-      entity_id: 
-        - device_tracker.google_maps_115265981849847357125
-        - device_tracker.google_maps_103158638433668748797
-      zone: zone.casa
-      event: leave
+    - platform: state
+      entity_id: group.residents
+      from: 'home'
     - platform: homeassistant
       event: start  
 
   condition:
     condition: template
     value_template: >-
-      {{ (not is_state('device_tracker.google_maps_115265981849847357125', state_attr('zone.casa', 'friendly_name'))) and
-         (not is_state('device_tracker.google_maps_103158638433668748797', state_attr('zone.casa', 'friendly_name'))) }}
+       {{ not is_state('group.residents', 'home') }}
 
   action:
     - service: input_boolean.turn_on
   initial_state: 'on'
 
   trigger:
-    - platform: zone
-      entity_id: 
-        - device_tracker.google_maps_115265981849847357125
-        - device_tracker.google_maps_103158638433668748797
-      zone: zone.casa
-      event: enter
+    - platform: state
+      entity_id: group.residents
+      to: 'home'
     - platform: homeassistant
       event: start 
 
   condition:
-    condition: or    
-    conditions:
-      - condition: zone
-        entity_id: device_tracker.google_maps_115265981849847357125
-        zone: zone.casa
-      - condition: zone
-        entity_id: device_tracker.google_maps_103158638433668748797
-        zone: zone.casa
+    condition: template
+    value_template: >-
+       {{ is_state('group.residents', 'home') }}
 
   action:
     - service: input_boolean.turn_off
index 0f68c6eeb0d80554736fa33474db04f9a823500c..1c46fe379fd9b26621c85f5ebdc50b06dd516a0b 100644 (file)
@@ -14,7 +14,7 @@
         - device_tracker.google_maps_115265981849847357125
         - device_tracker.google_maps_103158638433668748797
         # - device_tracker.google_maps_113099283296073047871
-      zone: zone.casa
+      zone: zone.home
       event: enter
 #    - platform: state
 #      entity_id: 
 #      timeout: '00:30:00'
 #      continue_on_timeout: 'false'
 
-    - wait_template: >-
-        {% if is_state('binary_sensor.porta_casa_stato', 'on') %}
-          true
-        {% else %}
-          false
-        {% endif %}
-
+    - wait_template: "{{ is_state('binary_sensor.porta_casa_stato', 'on') }}"
       timeout: '00:30:00'
       continue_on_timeout: 'false'
 
index bd9ed063d0ad867f42a88cc306664dbae8dc0598..8a53f9634ff99bea576f34287c1df91d4855872b 100644 (file)
@@ -106,7 +106,7 @@ speech_engine:
           
           {# Car Status #}
           {%- macro status_car() -%}
-            {% if is_state('device_tracker.wdd1760081v167576', state_attr('zone.casa', 'friendly_name')) %}
+            {% if is_state('device_tracker.wdd1760081v167576', state_attr('zone.home', 'friendly_name')) %}
               {% set car_position = "in garage" %}
             {% else %}
               {% set car_position = "fuori" %}