Automation using the new 'person' component

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

Both to and from are optional. If your wanting from anything to home. Then only use the to: home for your coming home trigger.
If you want to anything from home. Then use just from: home for your leaving trigger

thx for the answer @pentaclchad!
Unfortunatly, I can’t do that in my case.
Because in both cases, I use a for:.

first example

Updating the first example with your propsal:

  trigger:
    platform: state
    entity_id: person.manu
    from: 'home'
    for:
      minutes: 5

this is not valid, because the for: condition requires a to: in the trigger.
I would have to list all possible values, which is not a long-lasting solution.

second example

And for the second example above, the solution would be to use a template condition, but this one doesn’t accept a for: at all.

I’m intrigued. Does it take you less than 5 mins to get to work? If not you should always transition through ‘not_home’

my case is different: at the time, I used to go into the subway, underground, directly from home and then to work.