Combine GPS sensors and show them on the map, with or without device tracker?

That really doesn’t make sense.

BTW, the error message said “automation.gps_status_881e_2”, whereas the automation we’ve been talking about is “automation.gps_status_881e”. Or did you rename it?

Are you sure you’re restarting HA whenever you change the automation? There’s something going on that maybe you haven’t explained yet.

1 Like

Hi,

as i restarted from the beginning, I noticed in fact I did have a typo, a really strange typo which I just did not saw.

After fixing it, all was fine and still ist.
Thanks a lot ! for you help here !

1 Like

I am having exactly the same problem you had. Could you describe what typo did you have? I am getting crazy with this…

My code in scripts.yaml:

update_location:
  alias: Update location
  description: blah blah
  sequence:
  - data:
      dev_id: elefanta
      gps:
      - 41.3
      - "{{ states('sensor.car_longitude') }}"
      location_name: away
    service: device_tracker.see

The log says:
invalid longitude for dictionary value @ data[‘gps’]

If I change the "{{ states('sensor.car_longitude') }}" for 1.0 (for instance) everything seems to work ok. I really don’t know what could be, I have tried all sorts of variations and nothing seems to work.
If I write this down in the template editor it works well and I can see that the sensors have correct values.

Any help would be appreciated.

Carlos

Ok, I know what happened… I had to change the line:

- data:

for

- data_template:

In this way, templates are activated in the expressions.

@carlosgarciaq @pnbruckner

I have added this to the scripts.yaml

update_location:
  alias: Update location
  description: triaca location
  sequence:
  - data_template:
      dev_id: Triaca
      gps:
      - "{{ states('sensor.triaca_latitude') }}"
      - "{{ states('sensor.triaca_longitude') }}"
    service: device_tracker.see

Do I need to add any other code to any other yaml file?

apart from this on the configuration.yaml :

script: !include scripts.yaml