I want to create an automation to open the garage door when a user comes home in the car. The users have the Android Companion App and they expose the Android Auto sensor. I’m using this as the heuristic to know they are in the car when they arrive.
I trigger the automation based on the person entering the home zone. At that point, I want a condition that uses that person’s device’s Android Auto sensor. If they are connected to Android Auto, then the condition is met and the garage door opens.
alias: Garage arrival
description: ""
- platform: state
entity_id:
- person.alice
- person.bob
to: home
alias: The car returns home
id: car_return
action:
- choose:
- conditions:
- condition: trigger
id: car_return
- condition: state
entity_id: <the android auto sensor of the person who triggered this>
state: "on"
sequence:
- device_id: 1e26c93b3dbd46291bf969d4cc7f9e90
domain: cover
entity_id: cover.garage_door
type: open
I can’t figure out how to associate the Android Auto sensor with the person. I looked at the trigger variables that are created from the state trigger, but couldn’t seem to make the connection between binary_sensor.pixel_6_android_auto and person.bob.
That is one approach that would work. What I was hoping to achieve is to not have to hardcode the person’s device sensor. If Alice gets a new phone, I don’t want to have to remember to go update automations and templates.
Ah, good point. Thanks for the help! I’ll standardize the device names to be device agnostic and then use some logic around matching the person to the device’s android auto sensor.