I’ve been using Traccar for awhile now and it was great. Recently they moved it out of the config yaml and made it a GUI integration. Unfortunately, it appears that I can no longer specify the check frequency (in yaml, it was interval_seconds
). Is there a way I can get this to update more frequently than it currently does? It seems to take a lot longer to pull updates…like 10 seconds or more.
Bah…reading helps…
So I found this note:
Ok, I’ve setup an automation to trigger every second.
alias: Traccar Entity Update
description: ""
trigger:
- platform: time_pattern
seconds: /1
condition: []
action:
- service: homeassistant.update_entity
metadata: {}
data: {}
target:
entity_id:
- device_tracker.car1
- device_tracker.car2
mode: single
The automation IS triggering every second. Looking at the entity in my dashboard, the last_updated
field never goes higher than 3 seconds. However, when I check my Traccar server logs, it appears HA is only polling every 10 seconds.
2024-02-27 02:03:42 INFO: user: 1, report: events, from: 2024-02-25 20:03, to: 2024-02-27 02:03, devices: [1, 2], groups: []
2024-02-27 02:03:52 INFO: user: 1, report: events, from: 2024-02-25 20:03, to: 2024-02-27 02:03, devices: [1, 2], groups: []
2024-02-27 02:04:02 INFO: user: 1, report: events, from: 2024-02-25 20:04, to: 2024-02-27 02:04, devices: [1, 2], groups: []
Is the entity update service only allowed to be called once every 10 seconds? Or maybe the Traccar server logs are just an aggregate entry?
- 1s is really bad, as that mean that you could fetch a new update before the previous is done.
- those logs are for the event reports only, not fetching the positions.
- From next HA version it will use websockets for instant updates
Yes, it’s included in the current beta.
And will be a part of the release that comes out next Wednesday.
So my understanding of web socket is basically real time updating. I believe my GPS tracker sends updates to the Traccar server every five seconds. If that’s the case, will HA pull them at the same interval?
That is somewhat correct, as soon as the Traccar Server get the position update, it will send it to the integration.
So there will be no more pulling as the Traccar Server will push it to Home Assistant.
That’s awesome, I really didn’t expect this integration to get this much attention considering the low utilization rate of it. I was glad it hadn’t gotten axed.
Im the code owner of it, besides the official apps, I think this is the best way to track devices as you host the server yourself, so it will be around for quite a while
The reason it has not seen much love over the past years is that it was really 2 different integrations bundled into one, making it hard to maintain and do needed adjustments in it.
But that changed with the February release where the integration was split into 2 integrations (Traccar Client and Traccar Server)