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
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.