I’ve tried to duplicate (and edit) my people_home-template to use with my Withings Sleep Analyzers, but I’m not getting it right. What do I have to change to get it right? The purpose is to have the number of people in bed, e.g. 0, 1 or 2.
- platform: template
sensors:
people_home:
friendly_name: How many are home?
entity_id:
- person.male
- person.female
value_template: >-
{{states.person | map(attribute='state') | select('eq','home') | list | length }}
- platform: template
sensors:
in_bed:
friendly_name: How many in bed?
entity_id:
- binary_sensor.withings_in_bed_male
- binary_sensor.withings_in_bed_female
value_template: >-
{{states.binary_sensor.withings | map(attribute='state') | select('eq','on') | list | length }}