input_datetime: last_time_home_tony: name: Tony Last Seen has_date: true has_time: true icon: mdi:binoculars last_time_home_tina: name: Tina Last Seen has_date: true has_time: true icon: mdi:binoculars last_time_home_kallen: name: Kallen Last Seen has_date: true has_time: true icon: mdi:binoculars input_boolean: kallen_awake: name: Kallen Awake icon: mdi:eye-check 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 ['Home','home'] %} Home {% elif person in ['WalMart','Kroger','Chief','Meijer','Dollar General - Clinton St','Aldi'] %} Grocery Store {% elif person in ['Rite Aid'] %} Pharmacy {% else %} {% if person in ['not_home','Stationary'] %} {{ state_attr('device_tracker.life360_tony_stork','address') }} {% else %} {{ states('person.tony_stork') }} {%- endif %} {%- endif %} icon_template: >- {% set person = states.person.tony_stork.state %} {% if person in ['Home','home'] %} mdi:home {% else %} mdi:car {% endif %} - platform: template sensors: tina_location: friendly_name: "Tina" unit_of_measurement: "" value_template: >- {% 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'] %} Grocery Store {% elif person in ['Rite Aid'] %} Pharmacy {% elif person in ['Bob Evans','BobEvans'] 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 %} icon_template: >- {% set person = states.person.christina_stork.state %} {% if person in ['Home','home'] %} mdi:home {% else %} mdi:car {% 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', 'Bob Evans') and is_state('input_boolean.kallen_school', 'off')%} {{ states('sensor.tony_location') }} {% else %} Unknown {%- endif %} - platform: template sensors: tony_home: icon_template: >- {% if is_state('device_tracker.tony_s_iphone', 'home') or is_state('device_tracker.life360_tony_stork','home') %} mdi:home {% else %} mdi:car {% endif %} value_template: >- {{ is_state('device_tracker.tony_s_iphone', 'home') or is_state('device_tracker.life360_tony_stork','home') }} - platform: template sensors: tina_home: icon_template: >- {% if is_state('device_tracker.tinas_iphone', 'home') or is_state('device_tracker.life360_christina_stork','home') %} mdi:home {% else %} mdi:car {% endif %} value_template: >- {{ is_state('device_tracker.tinas_iphone', 'home') or is_state('device_tracker.life360_christina_stork','home') }} - platform: template sensors: people_home: friendly_name: "People" unit_of_measurement: 'home' value_template: >- {{ states['person'] | selectattr('state','eq','home') | list | count }} - platform: template sensors: people_away: friendly_name: "People" unit_of_measurement: 'away' value_template: >- {% set people = [ states.person.tony_stork, states.person.christina_stork, states.person.kallen_stork, ] %} {{ people | selectattr('state','ne','home') | list | count }} mqtt: sensor: - name: "Family Status" state_topic: "house/family/status" payload_available: "online" payload_not_available: "offline" - name: "Family Arrived" state_topic: "house/family/arrived" payload_available: "online" payload_not_available: "offline" 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: input_boolean.turn_on entity_id: input_boolean.kallen_awake - 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 - id: 94b57d79-efe0-4f34-b5e3-baeaa5eea9f4 alias: Kallen Asleep trigger: - platform: time at: input_datetime.kallen_bedtime action: - service: input_boolean.turn_off entity_id: input_boolean.kallen_awake script: family_is_away: alias: Family Is Away sequence: - condition: state entity_id: group.family state: not_home - service: light.turn_off target: area_id: - basement_studio - furnace_room - kallen_bedroom - living_room - master_bedroom - mud_room - emma_bedroom - upstairs_hallway - dining_room - downstairs_bathroom - upstairs_bathroom - service: fan.turn_off target: area_id: - basement_studio - kallen_bedroom - master_bedroom - emma_bedroom - delay: seconds: 5 - service: switch.turn_on target: entity_id: - switch.adaptive_lighting_basement_studio - switch.adaptive_lighting_living_room - switch.adaptive_lighting_downstairs_bathroom - switch.adaptive_lighting_dining_room - switch.adaptive_lighting_tina_lamp - switch.adaptive_lighting_mud_room - switch.adaptive_lighting_upstairs_hallway - switch.adaptive_lighting_upstairs_bathroom - switch.adaptive_lighting_master_bedroom - switch.adaptive_lighting_kallen_bedroom - switch.adaptive_lighting_emma_bedroom - service: input_text.set_value target: entity_id: - input_text.basement_studio_selected_scene - input_text.living_room_selected_scene - input_text.downstairs_bathroom_selected_scene - input_text.mud_room_selected_scene - input_text.tina_lamp_selected_scene - input_text.upstairs_hallway_selected_scene - input_text.upstairs_bathroom_selected_scene - input_text.master_bedroom_selected_scene - input_text.kallen_bedroom_selected_scene - input_text.emma_bedroom_selected_scene data: value: Adaptive - service: input_text.set_value target: entity_id: input_text.dining_room_lamp_selected_scene data: value: Full - service: media_player.turn_off target: entity_id: media_player.living_room_tv - service: script.security_arm_away mode: single icon: mdi:shield-lock family_is_home_day: alias: Family Is Home Day sequence: - service: switch.turn_off target: entity_id: switch.presence_simulation - service: script.security_disarm - service: switch.turn_off target: entity_id: - switch.basement_echo_dot_do_not_disturb_switch - switch.living_room_echo_dot_do_not_disturb_switch - switch.master_bedroom_echo_dot_do_not_disturb_switch - if: - condition: template value_template: > {% set weather = states('weather.iron_nerd_weather_station') %} {% if weather in ['cloudy','partlycloudy','rainy','snowy','hail','lightning','lightning-rainy','pouring','snowy-rainy'] %} true {% else %} false {% endif %} then: - service: light.turn_on target: area_id: - living_room - dining_room - mud_room - delay: hours: 0 minutes: 0 seconds: 3 milliseconds: 0 - service: input_select.select_option target: entity_id: - input_select.living_room_scenes - input_select.tina_lamp_scenes - input_select.mud_room_scenes data: option: Adaptive - service: input_select.select_option target: entity_id: input_select.dining_room_lamp_scenes data: option: Full - service: light.turn_off target: area_id: - furnace_room - kallen_bedroom - emma_bedroom - master_bedroom - upstairs_hallway - basement_studio - downstairs_bathroom - upstairs_bathroom - service: script.welcome_home mode: single icon: mdi:home-account family_is_home_night: alias: Family Is Home Night sequence: - service: switch.turn_off target: entity_id: switch.presence_simulation - service: script.security_disarm - service: switch.turn_off target: entity_id: - switch.basement_echo_dot_do_not_disturb_switch - switch.living_room_echo_dot_do_not_disturb_switch - switch.master_bedroom_echo_dot_do_not_disturb_switch - service: light.turn_on target: area_id: - living_room - dining_room - mud_room - delay: hours: 0 minutes: 0 seconds: 3 milliseconds: 0 - service: input_select.select_option target: entity_id: - input_select.living_room_scenes - input_select.tina_lamp_scenes - input_select.mud_room_scenes data: option: Adaptive - service: input_select.select_option target: entity_id: input_select.dining_room_lamp_scenes data: option: Full - service: light.turn_off target: area_id: - furnace_room - kallen_bedroom - emma_bedroom - master_bedroom - upstairs_hallway - basement_studio - downstairs_bathroom - upstairs_bathroom - service: script.welcome_home mode: single icon: mdi:home-account