Help in gps map display

Hello:
I’m looking for help.

I have a GPS device that gives me the following information: Latitude, Longitude and Location.

My idea is to be able to see on a map the locations where the device has been.

I have tried the see service, but no results.

Someone give me a hand?

Thanks in advance!

What is the device? Does it have a way to communicate withHA? Is there an existing integration for this device that could help? I suspect we are going to need more information.

Its a Lora GPS. Its integrated via The Things Network.
I can see the devices form my Lora Network, but its unusable…

Any ideas??

Assume you have an entity which has these attributes - “longitude” & “latitude”.
Then this entity may be placed inside a Map card - then you will be able to see a track for a selected period.
Check if your device provides such an entity.
If it only provides separately “latitude” & “longitude” entities - then you will have to create a template sensor with required “longitude” & “latitude” attributes (values taken from those separate entities).

Thanks!
A couple of questions.
How can I create a device with those attributes?
It must be some kind of special device? Some specific class?
It must be in the Yaml Config or somewhere else?
Thanks again!

The sensor I showed in picture above, has Longitude and longitude, but It`s not shown as a map displayable device.

I must add some attribute?

According to info you provided, the device creates separate sensors for Lng & Lat (values kept as states), also a “combined” sensor “Location” with a state “Lat, Lng” .
What you need is a sensor with attributes “latitude” & “longitude”.
This may be done as a template sensor. Check docs how to create template sensors.

Something like this looks correct?

>   - binary_sensor:
>       - name: "GPS Codigua 1"
>         state: >
>           {{ (states('sensor.gps1_codigua_location')) }}
>         attributes:
>           latitude: >
>             '{{ states(''sensor.gps1_codigua_latitude'') }}'
>           longitude: >
>             '{{ states(''sensor.gps1_codigua_longitude'') }}'

Doesn’t work…

Try this (untested):

template:
  - sensor:
      - name: "GPS Codigua 1"
        state: not_home
        attributes:
          latitude: >-
            {{ states('sensor.gps1_codigua_latitude') }}
          longitude: >-
            {{ states('sensor.gps1_codigua_longitude') }}
type: map
hours_to_show: 12
entities:
  - sensor.gps_codigua_1

Great!

Thanks a Lot!!!

How can add some decimal places? It is showing only 2…

Thanks again!

Where “it showing”?
Post a screenshot.

An example… image

The location has a lot of error…

Paste the code from that post into Dev tools → Template, then post a screenshot here.

Ildar:

Thanks a lot for your help.

This is the full story.

I have a Lora GPS integrated via The Things Network. This integration gives me a lot of info:

This info is not usable for showing it in a map, so I build a sensor via template in configuration.yaml:

  - sensor:
      - name: "GPS Codigua 1"
        unique_id: '1603005245432'
        state: not_home
        attributes:
          latitude: >-
            {{ states('sensor.gps1_codigua_latitude')|float }}
          longitude: >-
            {{ states('sensor.gps1_codigua_longitud')|float }}

(If I test it, the result is:
image
)

Now, to make it “traceable”, I made an automation to make it visible on the map throug this:

alias: Codigua Guarda Ubicacion de GPS
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.gps1_codigua_latitude
      - sensor.gps1_codigua_longitud
condition: []
action:
  - service: device_tracker.see
    data:
      dev_id: gps1-codigua
      gps:
        - "{{ state_attr('sensor.gps1_codigua_latitude', 'latitude') }}"
        - "{{ state_attr('sensor.gps1_codigua_longitud', 'longitud') }}"
mode: single

I have a problem:
1.- In the attributes, the lat. and long only uses 2 decimal places, so the location have a big error.
This is what I can see…
image

Not very usefull…

Any suggestion is welcome!

Thanks a lot!

What is a purpose of that automaton?
You already have a sensor with coordinates.
Use it inside a map card.
No need to create a device_tracker.