People

Misc examples focused around people.

People Home

Creates a sensor indicating how many people are home.

sensor:
- platform: template
sensors:
people_home:
friendly_name: "People"
unit_of_measurement: 'home'
value_template: >
{{ states['person'] | selectattr('state','eq','home')
| list | count }}

People Not Home

Creates a sensor indicating how many people are not home.

sensor:
- platform: template
sensors:
people_away:
friendly_name: "People"
unit_of_measurement: 'away'
value_template: >
{{ states['person'] | selectattr('state','ne','home')
| list | count }}

People Not Home (Specific)

Creates a sensor indicating how many specific people are not home.

Usage Ideas
  • Count kids who are not home
  • Count frequent guests who are away
sensor:
- platform: template
sensors:
kids_away:
friendly_name: "Kids"
unit_of_measurement: 'away'
value_template: >
{% set kids = [
states.person.jay,
states.person.bob,
] %}
{{ kids | selectattr('state','ne','home') | list | count }}