Added template location sensors

This commit is contained in:
2022-04-25 23:03:13 -04:00
parent 76808cdc31
commit e99cc40249

View File

@ -34,6 +34,59 @@ proximity:
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'] %}
{{ 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('binary_sensor.tina_work','on') %}
Work
{% else %}
{% if person in ['not_home'] %}
{{ 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"