From d534709793ef6e736963035a9a6abfacff6b0c71 Mon Sep 17 00:00:00 2001 From: Mahasri Kalavala Date: Tue, 29 Nov 2022 20:48:51 -0500 Subject: [PATCH] minor updates --- lovelace/00_myhome_view.yaml | 8 ++-- packages/batteries.yaml | 16 ++++---- packages/cameras.yaml | 6 +-- packages/homesecurity.yaml | 14 +++---- packages/led_notify.yaml | 16 ++++---- packages/zones.yaml | 72 +++++++++++++++++++++++++++--------- templates/home_status.yaml | 2 +- 7 files changed, 86 insertions(+), 48 deletions(-) diff --git a/lovelace/00_myhome_view.yaml b/lovelace/00_myhome_view.yaml index 74f7a9f..1de76cc 100644 --- a/lovelace/00_myhome_view.yaml +++ b/lovelace/00_myhome_view.yaml @@ -84,13 +84,13 @@ cards: title: Kalavala Family show_header_toggle: false entities: - - entity: device_tracker.mallika + - entity: device_tracker.life360_mallika name: Mallika's Location - - entity: device_tracker.suresh + - entity: device_tracker.life360_suresh name: Suresh's Location - - entity: device_tracker.srinika + - entity: device_tracker.life360_srinika name: Srinika's Location - - entity: device_tracker.hasika + - entity: device_tracker.life360_hasika name: Hasika's Location - entity: input_boolean.home_mode_away name: Home Away Status diff --git a/packages/batteries.yaml b/packages/batteries.yaml index fd3bcc9..589d01f 100644 --- a/packages/batteries.yaml +++ b/packages/batteries.yaml @@ -387,10 +387,10 @@ # trigger: # platform: numeric_state # entity_id: -# - device_tracker.suresh -# - device_tracker.mallika -# - device_tracker.srinika -# - device_tracker.hasika +# - device_tracker.life360_suresh +# - device_tracker.life360_mallika +# - device_tracker.life360_srinika +# - device_tracker.life360_hasika # value_template: "{{ state.attributes.battery }}" # below: 25 # condition: @@ -438,10 +438,10 @@ # trigger: # - platform: state # entity_id: -# - device_tracker.mallika -# - device_tracker.suresh -# - device_tracker.srinika -# - device_tracker.hasika +# - device_tracker.life360_mallika +# - device_tracker.life360_suresh +# - device_tracker.life360_srinika +# - device_tracker.life360_hasika # from: "not_home" # to: "home" # for: "00:05:00" diff --git a/packages/cameras.yaml b/packages/cameras.yaml index 9bbf27b..248444f 100644 --- a/packages/cameras.yaml +++ b/packages/cameras.yaml @@ -780,7 +780,7 @@ automation: .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" - condition: template - value_template: "{{ states('device_tracker.suresh') == 'home' }}" + value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}" - service: notify.ios_devices data_template: @@ -872,7 +872,7 @@ automation: .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" - condition: template - value_template: "{{ states('device_tracker.suresh') == 'home' }}" + value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}" - service: notify.ios_devices data_template: message: "Check Driveway camera!" @@ -962,7 +962,7 @@ automation: .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" - condition: template - value_template: "{{ states('device_tracker.suresh') == 'home' }}" + value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}" - service: notify.ios_devices data_template: message: "Check Patio camera!" diff --git a/packages/homesecurity.yaml b/packages/homesecurity.yaml index 8eafbd4..53ffba1 100644 --- a/packages/homesecurity.yaml +++ b/packages/homesecurity.yaml @@ -164,13 +164,13 @@ automation: condition: - condition: template value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}" - - condition: template - value_template: > - {%- if state_attr('automation.notify_home_security_status_change', 'last_triggered') -%} - {{ (as_timestamp(now()) - as_timestamp(state_attr('automation.notify_home_security_status_change', 'last_triggered'))) > 90 }} - {%- else -%} - true - {%- endif -%} + # - condition: template + # value_template: > + # {%- if state_attr('automation.notify_home_security_status_change', 'last_triggered') -%} + # {{ (as_timestamp(now()) - as_timestamp(state_attr('automation.notify_home_security_status_change', 'last_triggered'))) > 90 }} + # {%- else -%} + # true + # {%- endif -%} action: - service: script.notify_me data_template: diff --git a/packages/led_notify.yaml b/packages/led_notify.yaml index 0428bbf..b9844b4 100644 --- a/packages/led_notify.yaml +++ b/packages/led_notify.yaml @@ -60,10 +60,10 @@ automation: trigger: - platform: state entity_id: - - device_tracker.mallika - - device_tracker.suresh - - device_tracker.srinika - - device_tracker.hasika + - device_tracker.life360_mallika + - device_tracker.life360_suresh + - device_tracker.life360_srinika + - device_tracker.life360_hasika from: "not_home" to: "home" for: "00:02:00" @@ -77,10 +77,10 @@ automation: trigger: - platform: zone entity_id: - - device_tracker.hasika - - device_tracker.mallika - - device_tracker.srinika - - device_tracker.suresh + - device_tracker.life360_hasika + - device_tracker.life360_mallika + - device_tracker.life360_srinika + - device_tracker.life360_suresh zone: zone.home event: enter condition: diff --git a/packages/zones.yaml b/packages/zones.yaml index a796c2e..458bc79 100644 --- a/packages/zones.yaml +++ b/packages/zones.yaml @@ -20,7 +20,7 @@ input_boolean: proximity: home: - devices: device_tracker.suresh + devices: device_tracker.life360_suresh tolerance: 50 unit_of_measurement: mi @@ -43,10 +43,10 @@ automation: trigger: - platform: zone entity_id: - - device_tracker.hasika - - device_tracker.mallika - - device_tracker.srinika - - device_tracker.suresh + - device_tracker.life360_hasika + - device_tracker.life360_mallika + - device_tracker.life360_srinika + - device_tracker.life360_suresh zone: zone.home event: enter condition: @@ -68,10 +68,10 @@ automation: trigger: - platform: zone entity_id: - - device_tracker.hasika - - device_tracker.mallika - - device_tracker.srinika - - device_tracker.suresh + - device_tracker.life360_hasika + - device_tracker.life360_mallika + - device_tracker.life360_srinika + - device_tracker.life360_suresh zone: zone.home event: leave condition: @@ -98,10 +98,10 @@ automation: trigger: - platform: state entity_id: - - device_tracker.mallika - - device_tracker.suresh - - device_tracker.srinika - - device_tracker.hasika + - device_tracker.life360_mallika + - device_tracker.life360_suresh + - device_tracker.life360_srinika + - device_tracker.life360_hasika from: "not_home" to: "home" for: "00:02:00" @@ -135,10 +135,10 @@ automation: seconds: "/30" action: - service_template: >- - {%- set suresh = states('device_tracker.suresh') -%} - {%- set mallika = states('device_tracker.mallika') -%} - {%- set srinika = states('device_tracker.srinika') -%} - {%- set hasika = states('device_tracker.hasika') -%} + {%- set suresh = states('device_tracker.life360_suresh') -%} + {%- set mallika = states('device_tracker.life360_mallika') -%} + {%- set srinika = states('device_tracker.life360_srinika') -%} + {%- set hasika = states('device_tracker.life360_hasika') -%} {{ 'input_boolean.turn_on' if suresh != "home" and mallika != "home" and srinika != "home" and hasika != "home" else 'input_boolean.turn_off' }} entity_id: input_boolean.home_mode_away @@ -168,3 +168,41 @@ automation: - service: script.notify_me data_template: message: "Suresh is on his way home, he is within the 5 miles range. Should be home soon!" + +#################################################################################### + - alias: Srinika Left Home + initial_state: true + trigger: + - platform: state + entity_id: device_tracker.life360_srinika + from: "home" + to: "not_home" + for: "00:02:00" + action: + - service: switch.turn_off + entity_id: + - switch.srinika_bedroom + - switch.srinika_bedroom_fan + - switch.srinika_bedroom_fan_light + - light.srinika_led_dimmer_switch + - switch.srinika_bedroom_closet + - switch.srinika_bedroom_accent_lights + +#################################################################################### + - alias: Hasika Left Home + initial_state: true + trigger: + - platform: state + entity_id: device_tracker.life360_hasika + from: "home" + to: "not_home" + for: "00:02:00" + action: + - service: switch.turn_off + entity_id: + - switch.hasika_bedroom + - switch.hasika_bedroom_fan + - switch.hasika_bedroom_fan_light + - light.hasika_led_dimmer_switch + - switch.hasika_bedroom_closet + - switch.hasika_bed_accent diff --git a/templates/home_status.yaml b/templates/home_status.yaml index cf7bbeb..e7bef4f 100644 --- a/templates/home_status.yaml +++ b/templates/home_status.yaml @@ -164,7 +164,7 @@ {# Drone Flying Weather #} {%- macro drone_weather() -%} {% if states('binary_sensor.good_weather_to_fly_drones')| lower == "on" and - states('device_tracker.suresh') == "home" and + states('device_tracker.life360_suresh') == "home" and states('sun.sun') == "above_horizon" %} It is now a great weather to fly drone outside. {% endif %}