GPSD as a service

I am running HAOS on an x386 and have connected a VK172 G-MOUSE USB GPS/GLONASS USB receiver.

After installing the GPSD integration, I found that it would not configure…

Some Googling led me to the necessity of installing gpsd to HAOS from the terminal. At that point I learned that HAOS uses APK rather than APT.

I installed gpsd using # apk add gpsd and ran it using # gpsd -D 5 -N -n /dev/ttyACM0.

I am then able to configure the GPSD integration which sets up 1 service with 7 entities (latitude, longitude, elevation, speed, climb, time, and mode).

All of this works fine, but if the system reboots, I have to repeat the apk add and gpsd run steps.

How can I install gpsd as a service so that it will start at boot? I gather that HAOS uses s6-svscan rather than systemctl? I know it is probably pretty simple to do, but just can’t figure how… Any help?

1 Like

I figured it out with the help of Chat GPT. You need to modify the configuration.yaml, scripts.yaml and automation.yaml files. I was able to reboot my system and have the GPS information come right back. Hope this helps others

Here is what to add
Configuration.yaml –

shell_command:
start_gpsd: “gpsd -D 5 -N -n /dev/ttyACM0”

Scripts.yaml –

start_gpsd:
alias: “Start GPSD Service”
sequence:
- service: shell_command.start_gpsd

Automation.yaml –

  • alias: “Start GPSD on Startup”
    trigger:
    • platform: homeassistant
      event: start
      action:
    • service: script.start_gpsd