Adjust for K now carrying his own phone with him

This commit is contained in:
2023-02-04 19:39:10 -05:00
parent 3672309737
commit f77ae3380d
8 changed files with 53 additions and 31 deletions

View File

@ -186,7 +186,7 @@
description: Runs when family arrives at home
trigger:
- platform: state
entity_id: group.family
entity_id: group.adults
from: not_home
to: home
- platform: event
@ -226,7 +226,7 @@
description: Runs when the family has left home
trigger:
- platform: state
entity_id: group.family
entity_id: group.adults
from: home
to: not_home
- platform: event
@ -260,7 +260,7 @@
description: ''
trigger:
- platform: state
entity_id: group.family
entity_id: group.adults
to: not_home
for:
hours: 1

View File

@ -1,6 +1,11 @@
Family:
- person.tony_stork
- person.christina_stork
- person.kallen_stork
Adults:
- person.tony_stork
- person.christina_stork
Presence Simulation:
- light.hallway_overhead

Submodule node-red/projects/NerdFlows updated: 8a8bfadc92...2057ce3404

View File

@ -759,7 +759,7 @@ script:
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: group.family
entity_id: group.adults
state: 'home'
- condition: state
entity_id: input_boolean.vacation_mode
@ -863,7 +863,7 @@ script:
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: group.family
entity_id: group.adults
state: 'home'
- condition: state
entity_id: input_boolean.vacation_mode

View File

@ -70,7 +70,7 @@ sensor:
{% set person = states.person.tony_stork.state %}
{% if person in ['Home','home'] %}
Home
{% elif person in ['WalMart','Kroger','Chief','Meijer','Dollar General - Clinton St','Aldi'] %}
{% elif person in ['WalMart','Wal-Mart','Kroger','Chief','Meijer','Dollar General - Clinton St','Aldi'] %}
Grocery Store
{% elif person in ['Rite Aid'] %}
Pharmacy
@ -95,7 +95,7 @@ sensor:
{% set person = states.person.christina_stork.state %}
{% if person in ['Home','home'] %}
Home
{% elif person in ['WalMart','Kroger','Chief','Meijer','Dollar General - Clinton St','Aldi'] %}
{% elif person in ['WalMart','Wal-Mart','Kroger','Chief','Meijer','Dollar General - Clinton St','Aldi'] %}
Grocery Store
{% elif person in ['Rite Aid'] %}
Pharmacy
@ -119,19 +119,27 @@ sensor:
friendly_name: "Kallen"
unit_of_measurement: ""
value_template: >-
{% if is_state('input_boolean.kallen_at_school', 'on') %}
School
{% elif is_state('calendar.kallen_events', 'on') %}
{{ state_attr('calendar.kallen_events', 'message') }}
{%- elif is_state('person.tony_stork', 'home') and is_state('person.christina_stork', 'home') and is_state('input_boolean.kallen_at_school', 'off')%}
{% set person = states.person.kallen_stork.state %}
{% if person in ['Home','home'] %}
Home
{%- elif is_state('person.tony_stork', 'Hospital') and is_state('input_boolean.kallen_at_school', 'off')%}
{{ states('sensor.tina_location') }}
{%- elif is_state('person.christina_stork', 'Bob Evans') and is_state('input_boolean.kallen_at_school', 'off')%}
{{ states('sensor.tony_location') }}
{% elif person in ['WalMart','Wal-Mart','Kroger','Chief','Meijer','Dollar General - Clinton St','Aldi'] %}
Grocery Store
{% elif person in ['Rite Aid'] %}
Pharmacy
{% else %}
Unknown
{% if person in ['not_home','Stationary'] %}
{{ state_attr('device_tracker.life360_kallen_stork','address') }}
{% else %}
{{ states('person.kallen_stork') }}
{%- endif %}
{%- endif %}
icon_template: >-
{% set person = states.person.kallen_stork.state %}
{% if person in ['Home','home'] %}
mdi:home
{% else %}
mdi:car
{% endif %}
people_home:
friendly_name: "People"
unit_of_measurement: 'home'
@ -167,26 +175,34 @@ template:
- name: "Tina Home"
state: "{{ is_state('device_tracker.tinas_iphone', 'home') or is_state('device_tracker.life360_christina_stork','home') }}"
device_class: presence
- binary_sensor:
- name: "Kallen Home"
state: "{{ is_state('device_tracker.kallen_iphone','home') or is_state('device_tracker.life360_kallen_stork','home') }}"
device_class: presence
- binary_sensor:
- name: "Nerds Home"
state: >-
{% if is_state('group.family','home') %}
{% if is_state('binary_sensor.tony_home','on') or is_state('device_tracker.kallen_iphone','home') %}
{% if is_state('binary_sensor.tony_home','on') or is_state('binary_sensor.kallen_home','on') %}
true
{% else %}
false
{% endif %}
{% else %}
false
{% endif %}
device_class: presence
- binary_sensor:
- name: "Parents Home"
state: >-
{% if is_state('group.family','home') %}
{% if is_state('group.adults','home') %}
{% if is_state('binary_sensor.tony_home','on') or is_state('binary_sensor.tina_home','on') %}
true
{% else %}
false
{% endif %}
{% else %}
false
{% endif %}
device_class: presence
@ -305,7 +321,7 @@ automation:
condition:
- alias: "Are we home?"
condition: state
entity_id: group.family
entity_id: group.adults
state: "home"
action:
- alias: "Save Current Light State"
@ -392,7 +408,7 @@ script:
alias: Family Is Away
sequence:
- condition: state
entity_id: group.family
entity_id: group.adults
state: not_home
- service: notify.all_ios
data:
@ -404,7 +420,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.family','home') }}"
- wait_template: "{{ is_state('input_boolean.away_mode_skipped','on') or is_state('group.adults','home') }}"
continue_on_timeout: true
timeout:
minutes: 1
@ -415,7 +431,7 @@ script:
tag: skip-away
- if:
- condition: template
value_template: "{{ is_state('input_boolean.away_mode_skipped','on') or is_state('group.family','home') }}"
value_template: "{{ is_state('input_boolean.away_mode_skipped','on') or is_state('group.adults','home') }}"
then:
- stop: Away Mode Skipped
- service: light.turn_off

View File

@ -121,7 +121,7 @@ automation:
at: input_datetime.master_bedroom_wakeup
condition:
- condition: state
entity_id: group.family
entity_id: group.adults
state: 'home'
- condition: state
entity_id: input_boolean.vacation_mode
@ -147,7 +147,7 @@ automation:
at: input_datetime.morning_alarm_rearm
condition:
- condition: state
entity_id: group.family
entity_id: group.adults
state: 'home'
- condition: state
entity_id: input_boolean.vacation_mode

View File

@ -1,8 +1,7 @@
binary_sensor:
- name: People Present
state: >
{{ is_state('person.tony_stork', 'home')
or is_state('person.christina_stork', 'home') }}
{{ is_state('person.tony_stork', 'home') or is_state('person.christina_stork', 'home') }}
- name: Precipitation
state: >-

View File

@ -3,7 +3,9 @@
{%- macro getReport() -%}
<p>
"Welcome home, "
{% if is_state('person.tony_stork','home') and is_state('person.christina_stork','home') %}
{% if is_state('group.family','home') %}
"Stork family."
{% elif is_state('group.adults','home') %}
"Stork family. "
{% elif is_state('person.tony_stork','home') %}
"Tony. "
@ -25,7 +27,7 @@
{% set endbefore = state_attr('input_datetime.kallen_school_day_end','timestamp') - 3600 %}
{% set endafter = state_attr('input_datetime.kallen_school_day_end','timestamp') + 3600 %}
{% set current = ((now().hour * 60 + now().minute) * 60 ) %}
{% if is_state('input_boolean.kallen_school_today_extended','on') and current > endbefore and current < endafter %}
{% if is_state('person.kallen_stork','home') and is_state('input_boolean.kallen_school_today_extended','on') and current > endbefore and current < endafter %}
"Welcome home Collin as well, "
{{ [
'I hope you had a great day at school! ',
@ -42,7 +44,7 @@
'You did not achieve eighth position this morning, did you? ',
] | random }}
{% endif %}
{% elif is_state('input_boolean.kallen_school_cancelled','on') %}
{% elif is_state('input_boolean.kallen_school_cancelled','on') and is_state('person.kallen_stork','home') %}
"I hope you are enjoying your free day off from school, Collin. "
{% endif %}
</p>