I was using zone.home to track how many persons are at home and trigger two automations “First person gets home” and “Last person is leaving”. This was working fine, I just checked if zone.home is >1 or <1.
But then I added my Tesla to HomeAssistant and it is also handled as a person. So both automations are not really working anymore if my car is staying at home.
I then decided to create a helper, which is only tracking me and my gf (not the tesla)
{{is_state('person.a','home') or is_state('person.b','home')}}
But somehow I can not use this template to check if the last person is leaving home. I tested following trigger:
platform: state
entity_id:
- binary_sensor.someone_home
to: "false"
for:
hours: 0
minutes: 5
seconds: 0
What am I doing wrong? Is there a better solution?
My Skoda Enyaq is has a device tracker and can be followed on the map, but is not a person. If the device tracker is in a zone, it will show it but is not counted. Is the Tesla integration adding the extra person or are you? If so, simply don’t. A car is not a person.
If it is unavoidable, there are two options: create a sensor that is 1 when the car is home, and 0 when not. Then test the state of zone home (nr of people there) against that sensor. Or create a group of persons and check the state of that.
I agree that a car should not be a person, the reason for me was that I wanted to see a picture of the car when viewing the map - I could not find a better solution for this…
I will look into creating a group of person for me and my gf.
If the Tesla integration does not set a picture for the device tracker, you could most likely set is with the customize integration by settng entity_picture to the image you want.