RUTC50 how to share GPS coordinates with Home Assistant?

I have a mobile setup and would like to share the GPS coordinate of my RUTC 50 to Home Assistant to update my zone coordinates.

I wanted to use the https feature but as far as Im aware it is for sending and not acting as an API

can HA retrieve GPS coordinates from an API of some sort ?

Yes, you can use API /gps/position/status endpoint:

https://developers.teltonika-networks.com/reference/RUTC50/7.14.2/v1.6.2/gps#get-gps-position-status

How to use API:

https://developers.teltonika-networks.com/examples

At first I thought it would solve my issues but the token credential valid for 5mn is not ideal at all since I would need to write a script with plain username and password and ask for a token on each request. This is IMO a big security risk

gps data is not sensitive; I just would like to be able to get it without token

Perhaps this would be helpful? Mobile install - Auto update Home location in a van/boat using a GPS capable router and Traccar - Share your Projects! - Home Assistant Community

thanks for the link; I will dig deeper and report back

reading all this I realized it is possible to get the data in HA via MQTT so I enabled the MQTT Publisher to connect to my broker but I have no option to send the GPS data in the GPS section anywhere.

I thought that enabling the publisher would spawn a new option but no.

Researching this issue did not give me anything either.

would you know or should I open a separate thread for this ?

ps:it works right now with HTTPS

I created a docker middleware that parses the nmea and sends a webhook to HA that updates the zone via automation triggered by the webhook

if anyone is interested this is the working automation

alias: Update Zone
trigger:
  - platform: webhook
    webhook_id: gps
    allowed_methods:
      - POST
      - PUT
    local_only: true

action:
  - service: homeassistant.set_location
    data:
      latitude: "{{ trigger.json.latitude | float }}"
      longitude: "{{ trigger.json.longitude | float }}"
mode: single

I think there are a few options to avoid middleware. Would you like for the router to send the coordinates periodically, or to poll the router for the current location?
If periodically, you can setup Modbus TCP server on the router itself, then configure Modbus TCP client to poll the coordinates from the TCP server using the registers defined here: RUTC50 Modbus - Teltonika Networks Wiki

The setup Data to Server to forward the coordinates to HA MQTT broker or use HTTP(S).
This may sound complicated, but I’ve been gathering other data (mainly signal parameters) this way and it works well.

Of course, there is also an option to use SSH to run commands and gather the data, but this will just introduce unnecessary complexity.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.