Would love some help with device_tracker

For my campervan build I added an ATGM336H GPS sensor via an ESP32 and ESPHome. Got an entity for latitude/longitude etc, all working, so far so good
(sensor.test_gps_latitude, sensor.test_gps_longitude)

But now I’m struggling for a day to create a device_tracker with these entities, searched and tried everything, tried chatgpt, but I think I miss something (braincells :laughing:).
I need to add the device_tracker in configuration.yaml, but the correct way to do this for such a sensors, I can’t get it. Anyone an idea?

Solution is here:
one
two

Hello Ildar,

Thanks for your help! I saw both earlier but didn’t quit understand it could solve my problem. But I’m a step further now, I created an automation to call that action, with device_tracker.see, first with latitudes and longitudes from nearby as fixed numbers. With that there is a tracker I could select to my ‘person’ named Camper.
It was showing on the map, so far so good. But now I want to take the coordinates from the sensor, so I changed it to:

alias: GPS Tracker Camper
description: ""
triggers: []
conditions: []
actions:
  - data:
      dev_id: gps_tracker_camper
      gps:
        - sensor.test_gps_latitude
        - sensor.test_gps_longitude
      gps_accuracy: 10
    action: device_tracker.see
mode: single

Although I get this message:

Executed: December 23, 2024 at 19:39:07
Error: invalid latitude for dictionary value @ data['gps']
Result:

params:
  domain: device_tracker
  service: see
  service_data:
    dev_id: gps_tracker_camper
    gps:
      - sensor.test_gps_latitude
      - sensor.test_gps_longitude
    gps_accuracy: 10
  target: {}
running_script: false

Must be

          gps: >-
            {{
              [
                states('sensor.test_gps_latitude'),
                states('sensor.test_gps_longitude')
              ]
            }}
1 Like

Thank you very much! That works! Thanks Ildar! :smiley:

1 Like