The Android Automotive (not Android Auto, or maybe that does the same) companion app used to give coordinates that easily showed the location on a map card on the dashboard. That has changed a long time ago and I have been trying to fix it ever since. Without any result. I’m missing something.
The companion app provides a sensor with a geocoded location:
There is an attribute with comma separated digital coordinates (location). I understand I need to create a device_tracker with those coordinates to be able to show on a map card. But I just can’t find a way to create a working device_tracker for this. I have seen may examples of similar challenges, but can’t get anything to work.
I had spend hours trying to understand the device_tracker.see service already. I have spend a few more and now I finally got it.
I added below automation to call the device_tracker.see service. It creates/updates device_tracker.polestar_1565_location when the geocode location sensor from the P2 companion app is updated.
#
# AUTOMATIONS
#
automation:
# Create device tracker for the Polestar 2
- description: Get GPS location from Geolocated sensor
alias: POLESTAR - Update GPS location
id: 31156193A3
trigger:
- platform: state
entity_id: sensor.polestar_geocoded_location
condition: []
action:
- service: device_tracker.see
data:
dev_id: polestar_1565_location
gps: "{{ state_attr('sensor.polestar_geocoded_location', 'location') }}"
mode: single
# END