182 lines
5.4 KiB
YAML
182 lines
5.4 KiB
YAML
input_datetime:
|
|
last_time_home_tony:
|
|
name: Tony Last Seen
|
|
has_date: true
|
|
has_time: true
|
|
last_time_home_tina:
|
|
name: Tina Last Seen
|
|
has_date: true
|
|
has_time: true
|
|
last_time_home_kallen:
|
|
name: Kallen Last Seen
|
|
has_date: true
|
|
has_time: true
|
|
|
|
proximity:
|
|
home_tony:
|
|
devices:
|
|
- device_tracker.tony_s_iphone
|
|
zone: home
|
|
tolerance: 5
|
|
unit_of_measurement: mi
|
|
home_tina:
|
|
devices:
|
|
- device_tracker.tinas_iphone
|
|
zone: home
|
|
tolerance: 5
|
|
unit_of_measurement: mi
|
|
home:
|
|
devices:
|
|
- device_tracker.tony_s_iphone
|
|
- device_tracker.tinas_iphone
|
|
zone: home
|
|
tolerance: 5
|
|
unit_of_measurement: mi
|
|
|
|
sensor:
|
|
- platform: template
|
|
sensors:
|
|
tony_location:
|
|
friendly_name: "Tony"
|
|
unit_of_measurement: ""
|
|
value_template: >-
|
|
{% set person = states.person.tony_stork.state %}
|
|
{%- if person in ['Wal-Mart','Kroger','Chief','Meijer'] %}
|
|
Grocery Store
|
|
{% else %}
|
|
{% if person in ['not_home','Stationary'] %}
|
|
{{ state_attr('device_tracker.life360_tony_stork','address') }}
|
|
{% else %}
|
|
{{ states('person.tony_stork') }}
|
|
{%- endif %}
|
|
{%- endif %}
|
|
- platform: template
|
|
sensors:
|
|
tina_location:
|
|
friendly_name: "Tina"
|
|
unit_of_measurement: ""
|
|
value_template: >-
|
|
{% set person = states.person.christina_stork.state %}
|
|
{%- if person in ['Wal-Mart','Kroger','Chief','Meijer'] %}
|
|
Grocery Store
|
|
{% elif person in ['Chipotle'] and is_state('input_boolean.work_today','on') %}
|
|
Work
|
|
{% else %}
|
|
{% if person in ['not_home','Stationary'] %}
|
|
{{ state_attr('device_tracker.life360_christina_stork','address') }}
|
|
{% else %}
|
|
{{ states('person.christina_stork') }}
|
|
{%- endif %}
|
|
{%- endif %}
|
|
- platform: template
|
|
sensors:
|
|
kallen_location:
|
|
friendly_name: "Kallen"
|
|
unit_of_measurement: ""
|
|
value_template: >-
|
|
{% if is_state('input_boolean.kallen_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_school', 'off')%}
|
|
home
|
|
{%- elif is_state('person.tony_stork', 'Hospital') and is_state('input_boolean.kallen_school', 'off')%}
|
|
{{ states('sensor.tina_location') }}
|
|
{%- elif is_state('person.christina_stork', 'Chipotle') and is_state('input_boolean.kallen_school', 'off')%}
|
|
{{ states('sensor.tony_location') }}
|
|
{% else %}
|
|
Unknown
|
|
{%- endif %}
|
|
- platform: mqtt
|
|
name: "Family Status"
|
|
state_topic: "house/family/status"
|
|
payload_available: "online"
|
|
payload_not_available: "offline"
|
|
- platform: mqtt
|
|
name: "Family Arrived"
|
|
state_topic: "house/family/arrived"
|
|
payload_available: "online"
|
|
payload_not_available: "offline"
|
|
- platform: template
|
|
sensors:
|
|
tony_home:
|
|
value_template: >-
|
|
{{ is_state('device_tracker.tony_s_iphone', 'home') or is_state('device_tracker.tony_s_iphone_app', 'home') or is_state('device_tracker.life360_tony_stork','home') }}
|
|
- platform: template
|
|
sensors:
|
|
tina_home:
|
|
value_template: >-
|
|
{{ is_state('device_tracker.tinas_iphone', 'home') or is_state('device_tracker.tinas_iphone_app', 'home') or is_state('device_tracker.life360_christina_stork','home') }}
|
|
|
|
automation:
|
|
- id: kallen_at_school
|
|
alias: Kallen is at School
|
|
trigger:
|
|
- entity_id: person.tony_stork
|
|
event: leave
|
|
platform: zone
|
|
zone: zone.school
|
|
- entity_id: person.christina_stork
|
|
event: leave
|
|
platform: zone
|
|
zone: zone.school
|
|
- entity_id: person.kallen_stork
|
|
event: enter
|
|
platform: zone
|
|
zone: zone.school
|
|
condition:
|
|
- condition: time
|
|
before: "11:30:00"
|
|
weekday:
|
|
- mon
|
|
- tue
|
|
- wed
|
|
- thu
|
|
- fri
|
|
- condition: state
|
|
entity_id: input_boolean.kallen_school
|
|
state: "off"
|
|
action:
|
|
- service: input_boolean.turn_on
|
|
entity_id: input_boolean.kallen_school
|
|
- service: script.text_alert
|
|
data:
|
|
who: parents
|
|
message: "Kallen has been dropped off at school."
|
|
initial_state: true
|
|
|
|
- id: kallen_left_school
|
|
alias: Kallen left School
|
|
trigger:
|
|
- entity_id: person.tony_stork
|
|
event: leave
|
|
platform: zone
|
|
zone: zone.school
|
|
- entity_id: person.christina_stork
|
|
event: leave
|
|
platform: zone
|
|
zone: zone.school
|
|
- entity_id: person.kallen_stork
|
|
event: leave
|
|
platform: zone
|
|
zone: zone.school
|
|
condition:
|
|
- condition: time
|
|
after: "11:30:02"
|
|
weekday:
|
|
- mon
|
|
- tue
|
|
- wed
|
|
- thu
|
|
- fri
|
|
- condition: state
|
|
entity_id: input_boolean.kallen_school
|
|
state: "on"
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
entity_id: input_boolean.kallen_school
|
|
- service: script.text_alert
|
|
data:
|
|
who: parents
|
|
message: "Kallen has been picked up from school."
|
|
initial_state: true |