I updated the GPSD client, here's the code

I picked up a GLiNet C3000 cellular modem that has a built in GPS antenna and can run GPSD (as it runs OpenWRT), found this old addon and got it updated to work with later versions of HA.

Make your config look something like this:

sensor:
  - platform: gpsd_client
    name: GPSD Client
    host: 10.0.0.1
    port: 2947
  - platform: template
    sensors:
      gpsd_latitude:
        friendly_name: "GPS Latitude"
        value_template: "{{ state_attr('sensor.gpsd_client', 'latitude') | float }}"
      gpsd_longitude:
        friendly_name: "GPS Longitude"
        value_template: "{{ state_attr('sensor.gpsd_client', 'longitude') | float }}"
      gpsd_speed:
        friendly_name: "GPS Speed"
        value_template: "{{ state_attr('sensor.gpsd_client', 'speed') | float }}"
  - platform: template
    sensors:
      # Clean formatting for GPS values
      gps_latitude_clean:
        friendly_name: "GPS Latitude"
        value_template: >
          {{ (states("sensor.gpsd_latitude")) | round(3) }}
      gps_longitude_clean:
        friendly_name: "GPS Longitude"
        value_template: >
          {{ (states("sensor.gpsd_longitude")) | round(3) }}

And then you can use this automation to update your home assistant location automagically

alias: Set Location
description: ""
trigger:
  - platform: time_pattern
    minutes: /15
condition: []
action:
  - service: homeassistant.set_location
    data_template:
      latitude: |
        {{ states("sensor.gps_latitude_clean") }}
      longitude: |
        {{ states("sensor.gps_longitude_clean") }}
mode: single

There’s an auto timezone addon out there also, but I can’t get it working so far.

This blog helped me out:

And I like the windy integration:

Your post was great and I finally got it working after resolving a number of issues with “other” stuff. HACS wouldn’t let me install the repo and so had to install manually. Also the GLiNet AX3000 wasn’t producing GPS data until I corrected the antenna setup.

Others might find it useful to know that you can run “gpsmon” on your router to validat e that the data is being produced correctly. If its not updating with lots of data, you have got somrthing wrong. My issue was that i’m using a Pepwave 40G and had connected the antenna labeled GPS to the GNSS port on the router when I should have connected the 4th mimo cable and not used the GPS cable at all.

Also I got configuration errors from HA with the template config and updated “float” to “float(0)” to provide it with a default:

sensor:
  - platform: gpsd_client
    name: GPSD Client
    host: 10.0.0.1
    port: 2947
  - platform: template
    sensors:
      gpsd_latitude:
        friendly_name: "GPS Latitude"
        value_template: "{{ state_attr('sensor.gpsd_client', 'latitude') | float(0) }}"
      gpsd_longitude:
        friendly_name: "GPS Longitude"
        value_template: "{{ state_attr('sensor.gpsd_client', 'longitude') | float(0) }}"
      gpsd_speed:
        friendly_name: "GPS Speed"
        value_template: "{{ state_attr('sensor.gpsd_client', 'speed') | float(0) }}"
  - platform: template
    sensors:
      # Clean formatting for GPS values
      gps_latitude_clean:
        friendly_name: "GPS Latitude"
        value_template: >
          {{ (states("sensor.gpsd_latitude")) | round(3) }}
      gps_longitude_clean:
        friendly_name: "GPS Longitude"
        value_template: >
          {{ (states("sensor.gpsd_longitude")) | round(3) }}

Also here are links to the commands to get the GLiNet AX3000 working:

And some additional commands that I found useful:

I hope this helps someone else.

I found your post and info regarding gpsd and wanted to use it to read gpsd data from a GL.iNet Router.
This documentation was also very helpful: https://www.codingblatt.de/openwrt-gl-x3000-gps-einrichten/

But I get stuck trying to install the custom component from HACS.
After adding the custom repository I can find the gpsd client integration in HACS but cannot install it:

GPSD Client
Commit 4befee8 will be downloaded

When downloaded, this will be located in '/config/custom_components/gpsd_client'
Remember that you need to restart Home Assistant before changes to integrations (custom_components) are applied.

**The version 4befee8 for this integration can not be used with HACS.**

I tried forking the github and changing some values in the manifest regarding the HA version and the HACS version, but no luck with that.

Could it be that the code needs some updates to be compatible with HACS 2.0 again?

Also without installing the integration the code in the configuration.yaml cannot be used (makes sense). Platform error: sensor - Integration 'gpsd_client' not found.