#Home (non)presence detection via UI

1 messages · Page 1 of 1 (latest)

little oasis
#

I am looking for a automation solution for when two specific users are not home to trigger an automation.

I am a little lost on what I should use.

I would assume I am looking for a state of Home or nothome on each person

I am attempting to do it via UI, assume such a basic thing would be there.

I could tie it to device, but to not have to change it in the future I would rather use person.Name

fast osprey
#

Group them, and use the group? That'd be YAML.

#

A template binary sensor could be done in the UI though

fickle forge
#

I use zone.home == 0 rather than person entities. You can do this with a numeric_state trigger with the zone as the entity.

little oasis
fickle forge
#

That’s when no one is present. Sorry. I completely missed the first sentence. (Not the first time that’s happened lol).

Yeah, you’ll want home/not_home on the person entities.

little oasis
fickle forge
#

Not sure what you mean... like, testing is a person is home or away?

little oasis
#

Without using yaml.

fickle forge
#

Like that?

#

Or this:

little oasis
#

Does that trigger only when yout state changes?

fickle forge
#

Yes

little oasis
# fickle forge Yes

Is there any to to trigger when:
David is away & Joan is away.

Rather then:

David has went away & Joan has went away. (Wouldn't trigger if Joan went away first)

fickle forge
#

You could use a template trigger for that.

#

{{ not states('person.dave', 'home') and not states('person.joan', 'home') }}

#

I wouldn't use away as state only because if you have zones setup and they are in one of those zones, the state would be the zone name and not just away or not_home.

little oasis
#

I feel like that should be something that's possible to set up from the UI :X

But thank you very much, looking at that code it looks like what I was looking for

fickle forge
#

You can do it in the UI using a template trigger.

#

You don't have to drop to YAML to do it.

little oasis
#

I know that, I mean not even using templates

fickle forge
#

Ahhhh... Well, you could try something with conditions. So, have both of them as triggers and then in the conditions, add both of them as being away. That could also work, but it feels convoluted and messy. A simple template trigger does wonders.

little oasis
little oasis
#
description: Turns off the lights when Pavla and Sam are away.
triggers:
  - trigger: template
    value_template: >-
      {{ not states('person.pavla_mottlova', 'home') and not states('person.samuel_john_king', 'home') }}
    for:
      hours: 0
      minutes: 30
      seconds: 0
conditions: []
actions:
  - action: light.turn_off
    metadata: {}
    data: {}
    target:
      floor_id: upstairs
mode: single

That does not seem to trigger.

fickle forge
#

Interesting... if you run that template through dev tools > template editor, what does it return with?

little oasis
#
false
This template listens for the following state changed events:

Entity: person.pavla_mottlova```
#

both of us are at 'work' zones

fast osprey
#

states('person.pavla_mottlova', 'home')

#

is_state('person.pavla_mottlova', 'home')

fickle forge
#

Ugh... that was my fault.

#

Thanks Tinkerer

fast osprey
#

Tsk tsk... (not that I've never got templates wrong)

little oasis
#

that returns true now =]

fickle forge
#

lol I banged that out yesterday sitting in a meeting 😉

little oasis
#

I tried gpt. it claimed everything was wrong except that 😄

fickle forge
#

yeah, gpt is often wrong

little oasis
#

'home assistant gpt, some addon thing'
it has helped me a lot with photoshop scripts