Struggling to track my boat on a map

OK - so my setup:
I have HA running in a VM on my home server. I have mosquitto installed as an addon. The home server runs tailscale, as does the raspberry pi on my boat. The boat pi is running openplotter, with a signal K server ingesting all my on board marine sensors. It outputs this data to the HA MQTT server, and I can view this and have a lovely dashboard set up on HA. Brilliant!

My major frustration that has eaten my evening is getting the boat position plotted on a map. I am able to see the lat/long via the MQTT sensors and it is updating every 10 seconds. I have templated a sensor that combines both entities and that seems ok, but didn’t really move me foward. I have read lots of threads about similar, and have now put together the following:

- id: aegir_position
  alias: Aegirs Current Location
  description: 'wheredaboat'
  mode: single
  trigger:
  - platform: state
    entity_id: sensor.signal_k_mqtt_sensors_navigation_position_latitude
  - platform: state
    entity_id: sensor.signal_k_mqtt_sensors_navigation_position_longitude
  condition: []
  action:
  - service: device_tracker.see
    data_template:
      dev_id: aegir
      gps:
      - "{{ states('sensor.signal_k_mqtt_sensors_navigation_position_latitude') }}"
      - "{{ states('sensor.signal_k_mqtt_sensors_navigation_position_longitude') }}"

This doesn’t appear to work - it wont save and I just get Message malformed: extra keys not allowed @ data[‘0’]. I have read lots of threads with similar errors and have fiddled around but without getting anywhere other than breaking it worse! I am brand new to YAML and am at the limit of what I can figure out without a steer as the error is pretty vague. I would be most grateful for any assistance!

All the best

OK so I got it working. For anyone else looking at this issue, i rewrote it as follows and put it in automations.yaml rather than trying to directly write an automation:

alias: Aegirs Current Location
description: ""
triggers:
  - entity_id: sensor.signal_k_mqtt_sensors_navigation_position_latitude
    trigger: state
  - entity_id: sensor.signal_k_mqtt_sensors_navigation_position_longitude
    trigger: state
conditions: []
actions:
  - data_template:
      dev_id: aegir
      gps:
        - >-
          {{ states('sensor.signal_k_mqtt_sensors_navigation_position_latitude')
          }}
        - >-
          {{
          states('sensor.signal_k_mqtt_sensors_navigation_position_longitude')
          }}
    action: device_tracker.see
mode: single

I am not 100% sure what made the difference, but it now works as expected. YAML appears to be very syntax sensitive. I hope that helps someone in the future, nothing more annoying than seeing ‘nvm i fixed it’ without any further info…