diff --git a/automations.yaml b/automations.yaml index 51346d7..b5bb76f 100644 --- a/automations.yaml +++ b/automations.yaml @@ -209,12 +209,9 @@ description: Runs when family arrives at home trigger: - platform: state - entity_id: sensor.adults_home_fix - not_from: - - broken - - unavailable - - unknown - to: home + entity_id: + - binary_sensor.parents_home + to: 'on' condition: - condition: not conditions: @@ -239,12 +236,9 @@ description: Runs when the family has left home trigger: - platform: state - entity_id: sensor.adults_home_fix - not_from: - - broken - - unavailable - - unknown - to: not_home + entity_id: + - binary_sensor.parents_home + to: 'off' condition: - condition: state entity_id: input_boolean.guest_mode @@ -263,8 +257,8 @@ description: '' trigger: - platform: state - entity_id: group.adults - to: not_home + entity_id: binary_sensor.parents_home + to: 'off' for: hours: 1 minutes: 0 diff --git a/packages/emmalynn.yaml b/packages/emmalynn.yaml index 985ea26..e802c40 100644 --- a/packages/emmalynn.yaml +++ b/packages/emmalynn.yaml @@ -86,8 +86,8 @@ automation: id: sleep-off condition: - condition: state - entity_id: group.adults - state: 'home' + entity_id: binary_sensor.parents_home + state: 'on' action: - choose: - conditions: diff --git a/packages/notify.yaml b/packages/notify.yaml index 70e1162..4b89122 100644 --- a/packages/notify.yaml +++ b/packages/notify.yaml @@ -1006,8 +1006,8 @@ script: - condition: template value_template: "{{ type in ['weather','Weather'] and is_state('binary_sensor.audible_weather_alerts_allowed','on') }}" - condition: state - entity_id: group.adults - state: 'home' + entity_id: binary_sensor.parents_home + state: 'on' - condition: state entity_id: input_boolean.vacation_mode state: 'off' @@ -1155,8 +1155,8 @@ script: entity_id: input_boolean.audible_notifications state: 'on' - condition: state - entity_id: group.adults - state: 'home' + entity_id: binary_sensor.parents_home + state: 'on' - condition: state entity_id: input_boolean.vacation_mode state: 'off' diff --git a/packages/presence.yaml b/packages/presence.yaml index 31dfabc..3f779c6 100644 --- a/packages/presence.yaml +++ b/packages/presence.yaml @@ -168,13 +168,17 @@ template: unique_id: 2419e826-b276-434c-b5c6-e42c065a73ff state: "{{ is_state('device_tracker.kallen_iphone','home') or is_state('device_tracker.life360_kallen_stork','home') }}" device_class: presence - - name: "Nerds Home" - unique_id: 2672a6a2-4be4-495c-b479-ffc7c6df67d2 - state: "{{ is_state('group.family','home') and (is_state('person.tony_stork','home') or is_state('person.kallen_stork','home')) }}" - device_class: presence - name: "Parents Home" unique_id: 8de02d19-60a6-436d-9187-1cfc70d6c297 - state: "{{ is_state('group.adults','home') and (is_state('person.tony_stork','home') or is_state('person.christina_stork','home')) }}" + state: "{{ is_state('binary_sensor.tony_home','on') or is_state('binary_sensor.tina_home','on') }}" + device_class: presence + - name: "Family Home" + unique_id: c1ec8744-3d76-4887-a0f2-572459bba8a2 + state: "{{ is_state('binary_sensor.tony_home','on') or is_state('binary_sensor.tina_home','on') or (is_state('binary_sensor.parents_home','on') and is_state('binary_sensor.kallen_home','on')) }}" + device_class: presence + - name: "Nerds Home" + unique_id: 2672a6a2-4be4-495c-b479-ffc7c6df67d2 + state: "{{ is_state('binary_sensor.tony_home','on') or is_state('binary_sensor.kallen_home','on') }}" device_class: presence - name: "Basement Occupied" unique_id: 20039c29-8b9d-436d-ba6c-8f2c2bda1db0 @@ -252,42 +256,6 @@ template: {{ sleeping | selectattr('state','eq','on') | list | count }} unit_of_measurement: '' icon: mdi:sleep - - unique_id: c63364fb-c3cb-44a6-8fba-5d63e3f9c981 - name: "Adults Home Fix" - state: > - {% if states('person.tony_stork') in ['unknown','unavailable'] or states('person.christina_stork') in ['unknown','unavailable'] %} - broken - {% elif is_state('group.adults','home') %} - home - {% elif is_state('group.adults','not_home') %} - not_home - {% endif %} - icon: > - {% if states('person.tony_stork') in ['unknown','unavailable'] or states('person.christina_stork') in ['unknown','unavailable'] %} - mdi:alert-circle - {% elif is_state('group.adults','home') %} - mdi:home - {% elif is_state('group.adults','not_home') %} - mdi:home-outline - {% endif %} - - unique_id: f27a1a56-0c7e-46ee-9f21-a48cc1a0421c - name: "Family Home Fix" - state: > - {% if states('person.tony_stork') in ['unknown','unavailable'] or states('person.christina_stork') in ['unknown','unavailable'] or states('person.kallen_stork') in ['unknown','unavailable'] %} - broken - {% elif is_state('group.family','home') %} - home - {% elif is_state('group.family','not_home') %} - not_home - {% endif %} - icon: > - {% if states('person.tony_stork') in ['unknown','unavailable'] or states('person.christina_stork') in ['unknown','unavailable'] or states('person.kallen_stork') in ['unknown','unavailable'] %} - mdi:alert-circle - {% elif is_state('group.family','home') %} - mdi:home - {% elif is_state('group.family','not_home') %} - mdi:home-outline - {% endif %} - unique_id: 2620a9d0-01f0-4af4-8438-a0c860735aab name: "Tony" state: >- @@ -563,8 +531,8 @@ automation: # condition: # - alias: "Are we home?" # condition: state - # entity_id: group.adults - # state: "home" + # entity_id: binary_sensor.parents_home + # state: "on" # action: # - alias: "Save Current Light State" # service: scene.create @@ -672,11 +640,8 @@ automation: {{ is_state('input_boolean.vacation_mode','off') and (tony >= 90) and (tina >= 90) }} id: leave-radius - platform: state - entity_id: group.adults - not_from: - - 'unknown' - - 'unavailable' - to: 'home' + entity_id: binary_sensor.parents_home + to: 'on' id: arrive-home condition: - condition: state @@ -846,8 +811,8 @@ script: alias: Family Is Away sequence: - condition: state - entity_id: group.adults - state: not_home + entity_id: binary_sensor.parents_home + state: 'off' - service: script.text_notify data: who: > @@ -864,7 +829,7 @@ script: - action: "SKIP_AWAY" title: Skip Away Mode icon: mdi:debug-step-over - - wait_template: "{{ is_state('input_boolean.away_mode_skipped','on') or is_state('group.adults','home') }}" + - wait_template: "{{ is_state('input_boolean.away_mode_skipped','on') or is_state('binary_sensor.parents_home','off') }}" continue_on_timeout: true timeout: minutes: 1 diff --git a/packages/security.yaml b/packages/security.yaml index f1231ba..c90d360 100644 --- a/packages/security.yaml +++ b/packages/security.yaml @@ -224,8 +224,8 @@ automation: id: wakeup condition: - condition: state - entity_id: group.adults - state: 'home' + entity_id: binary_sensor.parents_home + state: 'on' - condition: state entity_id: input_boolean.vacation_mode state: 'off' @@ -279,8 +279,8 @@ automation: at: input_datetime.morning_alarm_rearm condition: - condition: state - entity_id: group.adults - state: 'home' + entity_id: binary_sensor.parents_home + state: 'on' - condition: state entity_id: input_boolean.vacation_mode state: 'off' @@ -447,8 +447,8 @@ automation: notification_id: lockdown_issue - if: - condition: state - entity_id: group.adults - state: 'not_home' + entity_id: binary_sensor.parents_home + state: 'off' then: - service: alarm_control_panel.alarm_arm_away target: