Dynamic Location in zones

Hi,

I am new, so maybe my questions is stupid. But although doing research, I was not able to find a solution.

I have added a component to monitor my husqvarna automower. Now I want to add the location of the automower in the map via the zones.

I have the following entity, which has an array which includes the position of the mower:

device_tracker.automower_g_152302615160200415

{
  "gps_accuracy": 0,
  "vendor": "Husqvarna",
  "source_type": "gps",
  "icon": "mdi:sleep",
  "friendly_name": "Mähschweinchen",
  "id": "automower_g_152302615160200415",
  "status": "Parked manually",
  "longitude": 14.12345678784323,
  "model": "G",
  "battery": 100,
  "latitude": 46.212334234324235,
  "name": "Mähschweinchen"
}

Therefore I created a sensor-template to extract the longitude and latitude:

automower_330_long:
value_template: “{{ states.device_tracker.automower_g_152302615160200415.attributes.longitude }}”
automower_330_lat:
value_template: “{{ states.device_tracker.automower_g_152302615160200415.attributes.latitude }}”

I have now a sensor
sensor.automower_330_long
with state
14.123213213421412
and a friendly_name
automower_330_long

How can I use this now as the “longitude” in a zone?

Best Regards,
Johannes

Someone able to help me?

Br,
Johannes

I used Google Maps as a card using this example:

And gave it the device_tracker that the automower custom component creates.

This extra step is needed as Google Maps does not show device_trackers when they are in your home zone.

This is what it looks like:

And this is the code:

- platform: generic
  name: Automower Location
  still_image_url: https://maps.googleapis.com/maps/api/staticmap?center={{ states.device_tracker.automower.attributes.latitude }},{{ states.device_tracker.automower.attributes.longitude }}&zoom=19&size=500x500&maptype=satellite&markers=color:blue%7Clabel:P%7C{{ states.device_tracker.automower.attributes.latitude }},{{ states.device_tracker.automower.attributes.longitude }}&key=MYAPIKEY
  limit_refetch_to_url_change: true