From dcb76028c2b5b8a9108d39a0e7c590311785ce77 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Wed, 7 Sep 2022 16:44:26 -0400 Subject: [PATCH] Sensor for explicit presence detection #35 --- packages/presence.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/presence.yaml b/packages/presence.yaml index 48a3f25..3d5fe3f 100644 --- a/packages/presence.yaml +++ b/packages/presence.yaml @@ -157,6 +157,30 @@ sensor: states.person.christina_stork, ] %} {{ adults | selectattr('state','ne','home') | list | count }} + - platform: template + sensors: + family_presence: + friendly_name: "Family Presence" + value_template: >- + {% if is_state('person.tony_stork','not_home') and is_state('person.christina_stork','not_home') %} + not_home + {% elif is_state('person.tony_stork','home') or is_state('person.christina_stork','home') %} + home + {% elif is_state('person.tony_stork','unknown') or is_state('person.christina_stork','unknown') %} + error + {% else %} + other + {% endif %} + icon_template: >- + {% if is_state('person.tony_stork','not_home') and is_state('person.christina_stork','not_home') %} + mdi:home-outline + {% elif is_state('person.tony_stork','home') or is_state('person.christina_stork','home') %} + mdi:home + {% elif is_state('person.tony_stork','unknown') or is_state('person.christina_stork','unknown') %} + mdi:alert-circle + {% else %} + mdi:home-outline + {% endif %} mqtt: sensor: