I’m currently using two automation with either a trigger or a condition based on my presence or absence from home.
Before the existence of the person component, and since I have multiple zones configured, I used a binary_sensor as the combination of my two device_tracker entities (ping and google_maps).
Now with 0.88 and the new person component, it basically looks like this:
binary_sensor:
- platform: template
sensors:
manu:
device_class: occupancy
value_template: >
{{ is_state('person.manu', 'home') }}
And then I use it in my automations.
- as a trigger in one:
trigger:
platform: state
entity_id: binary_sensor.manu
from: 'on'
to: 'off'
for:
minutes: 5
- and as a condition in another one:
condition:
- condition: state
entity_id: binary_sensor.manu
state: 'off'
for:
minutes: 2
I would like to get rid of this binary_sensor (one less entity !), but unless I miss something, I cannot right now because it would mean:
-
trigger case: because of subway, I might be detected from going directly from ‘home’ to ‘work’ (or somewhere else) without going through ‘not home’. Which means I would have to list all possibilities in the trigger:
- from ‘home’ to ‘not_home’,
- from ‘home’ to ‘work’,
- etc.
- condition case: it’s basically the same, I would have to write a big or and enumerate all possibilities: ‘not_home’, ‘work’, etc.
And well… adding a new zone would break it all and be a pain in term of maintenance.
Am I missing something here ?
Thx in advance