Implement gps tracking from LoRa Device

I am struggling with adding a gps tracker to my hass.

Here is the json i am trying to extract data from:

{
  "channel": 0,
  "from": 621159684,
  "hops_away": 0,
  "id": 448070162,
  "payload": {
    "altitude": 457,
    "latitude_i": 16734000,
    "longitude_i": 400646000,
    "precision_bits": 32,
    "time": 1715343672
  },
  "rssi": -48,
  "sender": "!f71f0920",
  "snr": 10.25,
  "timestamp": 1715343672,
  "to": 4294967295,
  "type": "position"
}

This is my current code:

mqtt:
  sensor:
    - name: "LoRa_hesttest"
      state_topic: "msh/EU_433/2/json/LongFast/!f71f0920"
      value_template: >
        "latitude": {{ value_json['payload'].latitude_i }},
        "longitude": {{ value_json['payload'].longitude_i }}

  device_tracker:
    - name: "Hest"
      state_topic: "msh/EU_433/2/json/LongFast/!f71f0920"
      value_template: >
        "latitude": {{ value_json['payload'].latitude_i }},
        "longitude": {{ value_json['payload'].longitude_i }}

and here is the results i get so far:

I can read the fictive latitude and longitude on the test sensor i’ve created, but i cannot for the life of me translate it into a useable tracker.

The value_template defines the state of the entity and that’s not a valid state for a Device tracker.

I don’t use MQTT much, but I think you will want to use json_attribute_topic in this case.

I’ve tried with the json_attributes_topic, but since the json sends the lat and long as latitude_i and longitude_i, the device tracker does not read it correctly…

If changing that isn’t an possible, another option would be to set up an automation with an MQTT trigger that calls the device_tracker.see service.