--- /dev/null
+######################################################################
+# Guard Mode: Enable
+######################################################################
+
+- alias: "Modalità Guardia: Attivazione"
+ initial_state: 'on'
+
+ trigger:
+ - platform: zone
+ entity_id:
+ - device_tracker.google_maps_115265981849847357125
+ - device_tracker.google_maps_103158638433668748797
+ zone: zone.casa
+ event: leave
+ - platform: homeassistant
+ event: start
+
+ condition:
+ condition: template
+ value_template: >-
+ {{ (not is_state('device_tracker.google_maps_115265981849847357125', 'Casa')) and
+ (not is_state('device_tracker.google_maps_103158638433668748797', 'Casa')) }}
+# condition:
+# condition: and
+# conditions:
+# - condition: zone
+# entity_id: device_tracker.google_maps_115265981849847357125
+# zone: not zone.casa
+# - condition: template
+# entity_id: device_tracker.google_maps_103158638433668748797
+# zone: not zone.casa
+
+ action:
+ - service: input_boolean.turn_on
+ data_template:
+ entity_id: input_boolean.guard_mode
+
+######################################################################
+# Guard Mode: Disable
+######################################################################
+
+- alias: "Modalità Guardia: Disattivazione"
+ initial_state: 'on'
+
+ trigger:
+ - platform: zone
+ entity_id:
+ - device_tracker.google_maps_115265981849847357125
+ - device_tracker.google_maps_103158638433668748797
+ zone: zone.casa
+ event: enter
+ - platform: homeassistant
+ event: start
+
+ condition:
+ condition: and
+ 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
+
+ action:
+ - service: input_boolean.turn_off
+ data_template:
+ entity_id: input_boolean.guard_mode
+
mdi:airplane-takeoff
{% endif %}
+######################################################################
+# Binary Sensor: Guard Mode
+######################################################################
+
+- platform: template
+ sensors:
+ guard_mode:
+ friendly_name: Modalità Guardia
+ entity_id: input_boolean.guard_mode
+ value_template: >-
+ {{ is_state('input_boolean.guard_mode', 'on') }}
+ icon_template: >-
+ {% if is_state('input_boolean.guard_mode', 'on') %}
+ mdi:shield-home
+ {% else %}
+ mdi:shield-off
+ {% endif %}
+
######################################################################
# Binary Sensor: Text Notification
######################################################################
name: Vacanza
icon: mdi:airplane-takeoff
+######################################################################
+# Inputs: Guard Mode
+######################################################################
+guard_mode:
+ name: Modalità Guardia
+ icon: mdi:shield-home
+
######################################################################
# Inputs: Notification Settings
######################################################################
- device_tracker.wdd1760081v167576
- sensor.time
- binary_sensor.home_mode
+ - binary_sensor.guard_mode
- binary_sensor.speech_notifications
- binary_sensor.text_notifications
cards:
- input_boolean.home_mode_day
- input_boolean.home_mode_night
- input_boolean.home_mode_away
+ - input_boolean.guard_mode
- type: entities
title: Controlli Vari
title: "Mercedes A200d: Sensori"
show_header_toggle: false
entities:
- - lock.ff590mr_lock
+ #- lock.ff590mr_lock
+ - input_boolean.ff590mr_lock
- binary_sensor.ff590mr_locked
- binary_sensor.ff590mr_doors_closed
- binary_sensor.ff590mr_windows_closed_2