Traccar device tracking?

Hi

I have a traccar server running on another host than where home assistant is running - and I can connect to the server via a web browser, and can see, that device tracking works…

However - it does not look like the information goes into home assistant.

I my configuration.yaml I have:

device_tracker:
  - platform: traccar
    host: 192.168.225.123
    port: 8082
    username: username
    password: secret
    monitored_conditions: ['all_events']
    new_device_defaults:
      track_new_devices: true

Is it a problem with my configuration - or what could be the reason for devices not showing up in HA ?

Regards
Brian

Use no ssl?

Maybe then add

ssl: false
verify_ssl: false

And is the port 100% correct?
Can hass reach the ip address? Same subnet etc.?

Port is correct (I assume, that it is the WebUI port)

Both Home Assistant and the traccar server are VMs running on the same VMware box - and they are in the same IP subnet. So IP connectivity should not be an issue.

I have this in my log - not sure if it is related to the traccar entry:

Updating device list from legacy took longer than the scheduled scan interval 0:00:12

Also, there is this entry:

Logger: homeassistant.components.device_tracker
Source: components/device_tracker/setup.py:88
Integration: Device tracker ([documentation](https://www.home-assistant.io/integrations/device_tracker), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+device_tracker%22))
First occurred: 9:29:56 PM (1 occurrences)
Last logged: 9:29:56 PM

Error setting up platform legacy

Seems all fine. Tried the ssl addition?

Tried the SSL addition - no change.

I don’t use Teaccar myself but the documentation doesn’t show ‘all_events’ as being valid for monitored_conditions (which is described as being for tracking non-standard attributes), only for event so have you tried it like this?

device_tracker:
  - platform: traccar
    host: 192.168.225.123
    port: 8082
    username: username
    password: secret
    event: ['all_events']
    new_device_defaults:
      track_new_devices: true

Tried to change it - still nothing showing up …’

I will try to connect HA via a nginx reverse proxy - then I will at least be able to see the requests being made from HA towards traccar…

Tried to configure HA to use the DNS name, port 443, enabled SSL and still with ssl_verify disabled.

In the log, I see requests come from HomeAssistant…

192.168.225.125 - username [12/Sep/2020:23:34:27 +0200] "GET /api/geofences HTTP/1.1" 200 2 "-" "HomeAssistant/0.114.4 aiohttp/3.6.2 Python/3.8"
192.168.225.125 - username [12/Sep/2020:23:34:27 +0200] "GET /api/devices HTTP/1.1" 200 226 "-" "HomeAssistant/0.114.4 aiohttp/3.6.2 Python/3.8"
192.168.225.125 - username [12/Sep/2020:23:34:27 +0200] "GET /api/positions HTTP/1.1" 200 291 "-" "HomeAssistant/0.114.4 aiohttp/3.6.2 Python/3.8"
192.168.225.125 - username [12/Sep/2020:23:34:27 +0200] "GET /api/reports/events?deviceId=1&from=2020-09-12T21:28:28.611877Z&to=2020-09-12T21:28:58.611877Z&type=allEvents HTTP/1.1" 200 2 "-" "HomeAssistant/0.114.4 aiohttp/3.6.2 Python/3.8"

I will try to rename the device in traccar if that is what confuses me…

Hi! Have you found a solution? I got the same issue.

I finally got something working - but just to find out, that device tracking wasn’t as stable as desired…

My config

device_tracker:
  - platform: traccar
    host: mytraccar.domain.dk
    port: 443
    ssl: true
    verify_ssl: false
    username: MyUsername
    password: VerySecret
    event: ['all_events']
    new_device_defaults:
      track_new_devices: true
1 Like

thanks for sharing

Hi Bipsen, I have the same problem but I’m not be able to fix it.
could you help me ?

let me explain you better, I installed and cofigured app “traccar” on my android. using https://mio.duckdns.or/api

this packet passthrough the a router using a nat port forwarding and arriva to fiewrall. this firewall decide to redirect the packet 443 to virtual server inside the lan where is HA e nginx installed.

using terminal HA I can seee that the packet is arrived, but probably somethings go wrong, colud be the configuration of nginx ?

thancks in advance

I dropped the traccar tracker - and instead tries to use the tracking via the HA app - with mixed success (tracking is often updated when e.g. using google maps/navigation - but in other scenarios the tracker is only updated every 15 minutes, and for a single device apparently only when in use (all samsung android phones), and this is even when trying to modify the phones not to terminate the application, allow it to run in the background, have access to location etc…