Device location trigger

Hi,

I’m using Locative to automate the opening of the garage for myself and one other person in the house.
I’ve grouped us both, and the condition in my automation is that the group state is home.
This only seems to work correctly when we’re both away, and one person comes home. If someone is home already, the automation doesn’t fire.

group:
  Location:
    - device_tracker.5bbb9df945ce4e59b12bfa31a04305d2
    - device_tracker.6c92342076c840c4950843a04588c990

- alias: Garage Open Auto
  trigger:
    platform: state
    entity_id: group.location
    state: home
  condition:
    platform: state
    entity_id: sensor.garage_state
    state: 'Closed'
  action:
    service: switch.turn_on
    entity_id: switch.garage_door

Any thoughts?
Thx
JP

You can try something like this:

- alias: Garage Open Auto
  trigger:
    platform: state
    entity_id: device_tracker.5bbb9df945ce4e59b12bfa31a04305d2, device_tracker.6c92342076c840c4950843a04588c990
    to: 'home'
  condition:
    platform: state
    entity_id: sensor.garage_state
    state: 'Closed'
  action:
    service: switch.turn_on
    entity_id: switch.garage_door
1 Like

That did the trick…!

Thx
James

In your case, group.location was “home” when that first person showed up. Hass sees changes to the state, so “home” continued to be “home” when the second person arrived and no event gets triggered.

As I thought. Thanks for confirming.
JP