Need help with GNSS integration to map in HA

Guys,

I have spent a day trying to figure this out. End goal is to have HA in my van (with the Raspberry Pi 5 as the main install). Map Dashboard to update location of the van. Sounds simple right?

So, I have successfully installed neo-m9n to an ESP32 dev board. On my ESP home devices, I see the sensor data (“Sensors”) of my latitude, longitude, elevation, speed, etc.

Also I found the following entities that exists with the following: (From gear, setting icon)

sensor.esp_32_ver_1_gps_longitude
sensor.esp_32_ver_1_gps_latitude

How do I get this to the map dashboard of HA? For a moving map?

I set the location of my “home” via setting, system, general, edit location.

I would never have imagined it would be so complicated.

Google tells me helper, template, sensor and I tried.

I am lost.

All help very welcome! BTW, the Baud Rate was the key to this EPS 32 install, should be 38400.

My YAML for the ESP 32

# Configure the UART bus for GPS communication
uart:
  id: uart_gnss
  tx_pin: GPIO17 # Transmit pin from ESP32 to NEO-M9N RX
  rx_pin: GPIO16 # Receive pin from NEO-M9N TX to ESP32 RX
  baud_rate: 38400 # The default baud rate for the NEO-M9N
  # For the NEO-6M, you would use 9600 baud rate
# Only the 38400 Baud Rate works for the Neo-M9N

# Configure the GPS sensor component
gps:
  uart_id: uart_gnss
  id: neo_m9n_gps
  latitude:
      name: "GPS Latitude"
      unit_of_measurement: "°"
      accuracy_decimals: 8  # the default was 6
  longitude:
      name: "GPS Longitude"
      unit_of_measurement: "°"
      accuracy_decimals: 8  # the default was 6
  altitude:
      name: "GPS Altitude"
      unit_of_measurement: "m"
  speed:
      name: "GPS Speed"
      unit_of_measurement: "km/h"
  satellites:
      name: "Satellites in view"
  hdop:
      name: "GPS HDOP"
    # Optional: Update interval

OK…and this is moving somewhere, pardon the pun. So, the entity home.zone is set by the homeassistant.set_location.

You can set homeassistant.set_location in config YAML file with the following data: latitude, longitude, and elevation. The elevation expects an INTEGER value. Not a string, not a float (unlike latitude, and longitude). BUT the GNSS spits out floats.

And most importantly, the syntax for the variables needed to be sorted. So,
I have the following action.

action: homeassistant.set_location
data:
  latitude: "{{ states('sensor.esp_32_ver_1_gps_latitude') }}"
  longitude: "{{ states('sensor.esp_32_ver_1_gps_longitude') }}"
  elevation: "{{ states('sensor.esp_32_ver_1_gps_elevation') | int}}"

My sensor.esp32_ver1_gps_altitude and etc., are the EXACT same sensors from the ESP32 YAML in the original post. No template sensors had to be created. No device trackers, etc. I did play with changing altitude (which is what ESP 32 GPS integration calls for to elevation). But I don’t think it matters as long as it’s an integer.

Now all is left is for an automation to poll the action every so often to update the MAP dashboard, and therefore a moving home is created.

I know this has come up on the forum before. I hope this integrations helps.

I used developer tools actions and tried this out. The hardest part for me was to sort the SYNTAX of this thing. I am not a coder. I solder alot better :slight_smile: .