Unable to get Traccar device-tracker in HA

Hello my traccar add on is not showing up as a sensor in HomeAssistant.
This is my traccar add on config:

{
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "log_level": "info"
}

This is configuration.yaml for traccar

device_tracker:
  - platform: traccar
    host: a0d7b954-traccar
    port: 8072
    ssl: true
    verify_ssl: false
    username: secret
    password: secret

This is the entry on traccar.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <!--
    Loads default configuration for the Hass.io add-on.
    WARNING: Do not remove this line!
    -->
    <entry key='config.default'>/etc/traccar/hassio.xml</entry>
    <entry key='database.driver'>com.mysql.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://core-mariadb:3306/traccar?serverTimezone=UTC&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
    <entry key='database.user'>secret</entry>
    <entry key='database.password'>secret</entry>
    <!--
    This is the main configuration file. All your configuration parameters should be placed in this file.
    Parameters in the main config file override values in the default file. Do not
    remove "config.default" parameter from this file unless you know what you are doing.
    For list of available parameters see following page:
        https://www.traccar.org/configuration-file/
    -->

    <!-- Enter you custom configuration below this line -->

</properties>

This is my mariadb add on config

{
  "databases": [
    "homeassistant",
    "traccar"
  ],
  "logins": [
    {
      "username": "secret",
      "host": "['homeassistant', 'traccar']",
      "password": "secret"
    }
  ],
  "rights": [
    {
      "username": "secret",
      "host": "['homeassistant', 'traccar']",
      "database": "['homeassistant', 'traccar']",
      "grant": "ALL PRIVILEGES ON"
    }
  ]
}

Hi, I have the same problem.
Traccar server in Hassio shows that all devices are online but I simply don’t see anything in device tracker card or know_devices and even not in sensors.
If anybody could advice it would be helpful because traccar its for me very reliable solution.

Thanks

I have raised this to @frenck on a different post and I see that people are talking about it on Github as well.

Maybe an update will fix it.

You need to add port 8072(or another port) in the network settings on the addon page for HA to be able to connect to it.

I have the port 8072 in network settings from beginning but still nothing.

Same here, I have tried with port, without port. Does not work

hello, i just installed it right now…i open and redirect ports 8082 and 5055 in my public ip to my nuc ip where is running hassio
in configuration.yaml:

device_tracker:
  - platform: traccar
    host: 192.168.1.2 #my nuc ip
    port: 8082
    username: xxxx  #your user
    password: xxxx  #your password

then in app traccar client on url:

http://my_public_ip:5055

I hope it helps

Hello,
I have same issue. I ask here https://github.com/hassio-addons/addon-traccar/issues/25 and Frenck found me a solution.
" Use port 18682 and host 127.0.0.1 "

It work for me.

2 Likes

Did you still use SSL true with that combination?

No SSL is false on my traccar configuration.
I also stop using traccar server, I use directly traccar integration with webhook.

Do you use mariadb ?

MariaDB didn’t work for me. The default dB is working fine for me.

I have the same issue (Traccar app data not getting to Hassio Traccar server addon).
I am trying to use port 18682 and have it open through my router (like many ports) but still nothing.
Do I need to open it in Linux Ubuntu or does having it in the configuration.yaml do that?
I have hassio running on a I7 minipc with Ubuntu.
Add on config:

{
  "ssl": false,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "log_level": "info"
}

Traccar setting in Iphone app.
Http://MY-ADDRESS-4-Hassio-PC:18682

Device Identifier with username(traccar registered email address and password) entered as device in Traccar UI…
Status in IOS APP. Location update, Send failed.

Configuration .yaml

  • platform: traccar
    host: 192.168.123.23
    port: 18682
    username: my-traccar-username
    password: my-traccar-PW
    event: [“all_events”]
    new_device_defaults:
    track_new_devices: true
    hide_if_away: false

Also tried host: 127.0.0.1 <- tried this and localhost
Any help is appreciated.

Hello @Sawadee
You don’t need to open port 18682 but open the port on which your tracking device (phone/gps tracker transmits)

There are two steps

  1. Linking your device to Traccar itself. This you should verify by logging into the Traccar server via the addon. If the device speaks to the Traccar server , it means your setup it correct
  2. Making Traccar and Homeassistant speak to each other. This is where the entry into configuration.yaml comes in. For me it works with 127.0.0.1

I suspect that step 1 is not working for you. Could you check and report back.
Thank you.

Hi, thanks for the help. You are correct. I am unable to connect the client on the phone to the server (Traccar Addon in HA).

I should mention that I have tied the Webhook and it works partially. That is it sends a location to HA and creates a tracker device with the device ID from the Traccar iPhone app. So that gets through but of course not to the add on.

So used port 18682 because I saw it was recommended. What port should I use? 8082? I think I saw that is the default port.

PS
Tried port 8082 then with open in router, no luck.

Yes, webhooks is a bypass for the Traccar server and is only useful for the phone client. If you were to use Traccar with what is it intended for , i.e. a GPS tracker on your automobile, then you need to first add the tracking device to your Traccar server and then it will start communicating.
I do not use Traccar client on my phone (I use icloud3 custom component for presence detection).
But I do use a ST-901 GPS tracker in my car which reports its position and ignition status to HomeAssistant via Traccar server.

1 Like

Well glad your setup works. I am still trying to get traccar addon to work. I know I am sending but it is not getting the data. Just don’t know what else to try. Have tried 127.0.0.1 with no luck. Tried different ports no luck. This addon just shouldn’t give people so much trouble. I assume I have to change something but don’t know what.
Thanks again…

1 Like

I am running Hssio on an i7 computer on ubuntu 18.04 with the HA recommended docker install
This is the alternative install for Ubuntu.
(Installation - Home Assistant)

This is my configuration:
App on Iphone:
Identifier: mySixDIgitIdentifier
Server URL http://my.dyndns.server:8082 <-(this port is open on my Ubiquiti Edge router)

On HA Traccar Addon:
ACCOUNT
Name: myname
Email: myemail
Password: mypassword

Device
Name: myname
Identifier: mySixDIgitIdentifier

Configuration.yaml
#device_tracker:

  • platform: traccar
    ‘# host: 192.168.123.23 <-(have tried both - this is my HA - Ubuntu box)’
    host: 127.0.0.1
    port: 8082
    username: myemailaddress
    password: mypassword
    event: [“all_events”]
    new_device_defaults:
    track_new_devices: false

Traccar addon CONFIG
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
log_level: debug
port: 8082

LOG after fresh startup:


Hass.io Add-on: Traccar
Modern GPS Tracking Platform

Add-on version: 0.6.1
You are running the latest version of this add-on.
System: Ubuntu 18.04.4 LTS (amd64 / qemux86-64)
Home Assistant version: 0.105.5
Supervisor version: 201

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing…
Log level is set to DEBUG
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] nginx.sh: executing…
[10:05:10] DEBUG: Requested API resource: http://hassio/dns/info
[10:05:10] DEBUG: Request method: GET
[10:05:10] DEBUG: Request data: {}
[10:05:10] DEBUG: API HTTP Response code: 200
[10:05:10] DEBUG: API Response: {“result”: “ok”, “data”: {“version”: “1”, “latest_version”: “1”, “host”: “172.30.32.3”, “servers”: , “locals”: [“dns://192.168.123.254”, “dns://4.2.2.2”]}}

[cont-init.d] nginx.sh: exited 0.
[cont-init.d] traccar.sh: executing…
[cont-init.d] traccar.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[10:05:10] INFO: Starting Traccar server…
2020-02-18 10:05:11 INFO: HikariPool-1 - Starting…
2020-02-18 10:05:11 INFO: HikariPool-1 - Start completed.
2020-02-18 10:05:11 INFO: Clearing database change log checksums
2020-02-18 10:05:11 INFO: SELECT COUNT() FROM PUBLIC.DATABASECHANGELOGLOCK
2020-02-18 10:05:11 INFO: SELECT COUNT(
) FROM PUBLIC.DATABASECHANGELOGLOCK
2020-02-18 10:05:11 INFO: SELECT LOCKED FROM PUBLIC.DATABASECHANGELOGLOCK WHERE ID=1
2020-02-18 10:05:11 INFO: Successfully acquired change log lock
2020-02-18 10:05:12 INFO: SELECT MD5SUM FROM PUBLIC.DATABASECHANGELOG WHERE MD5SUM IS NOT NULL
2020-02-18 10:05:12 INFO: UPDATE PUBLIC.DATABASECHANGELOG SET MD5SUM = NULL
2020-02-18 10:05:12 INFO: Successfully released change log lock
2020-02-18 10:05:12 INFO: SELECT COUNT() FROM PUBLIC.DATABASECHANGELOGLOCK
2020-02-18 10:05:12 INFO: SELECT COUNT(
) FROM PUBLIC.DATABASECHANGELOGLOCK
2020-02-18 10:05:12 INFO: SELECT LOCKED FROM PUBLIC.DATABASECHANGELOGLOCK WHERE ID=1
2020-02-18 10:05:12 INFO: Successfully acquired change log lock
2020-02-18 10:05:12 INFO: Can not use class liquibase.parser.core.json.JsonChangeLogParser as a Liquibase service because org.yaml.snakeyaml.constructor.BaseConstructor is not in the classpath
2020-02-18 10:05:12 INFO: Can not use class liquibase.parser.core.yaml.YamlChangeLogParser as a Liquibase service because org.yaml.snakeyaml.constructor.BaseConstructor is not in the classpath
2020-02-18 10:05:13 INFO: SELECT MD5SUM FROM PUBLIC.DATABASECHANGELOG WHERE MD5SUM IS NOT NULL
2020-02-18 10:05:13 INFO: SELECT COUNT() FROM PUBLIC.DATABASECHANGELOG
2020-02-18 10:05:13 INFO: Reading from PUBLIC.DATABASECHANGELOG
2020-02-18 10:05:13 INFO: SELECT * FROM PUBLIC.DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
2020-02-18 10:05:13 INFO: UPDATE PUBLIC.DATABASECHANGELOG SET MD5SUM = ‘8:d59fa93049c031a8bcfbc02958c1942c’ WHERE ID = ‘changelog-4.0-clean’ AND AUTHOR = ‘author’ AND FILENAME = ‘changelog-4.0-clean’
2020-02-18 10:05:13 INFO: UPDATE PUBLIC.DATABASECHANGELOG SET MD5SUM = ‘8:1adabae3238e02ccc97cc422359a58a0’ WHERE ID = ‘changelog-4.0-clean-common’ AND AUTHOR = ‘author’ AND FILENAME = ‘changelog-4.0-clean’
2020-02-18 10:05:13 INFO: UPDATE PUBLIC.DATABASECHANGELOG SET MD5SUM = ‘8:ea6f202534dc7845fd1a49e1d8384d9c’ WHERE ID = ‘changelog-3.3’ AND AUTHOR = ‘author’ AND FILENAME = ‘changelog-3.3’
2020-02-18 10:05:13 INFO: UPDATE PUBLIC.DATABASECHANGELOG SET MD5SUM = ‘8:194e3ae7ec6d201917136e04a26e237b’ WHERE ID = ‘changelog-3.5’ AND AUTHOR = ‘author’ AND FILENAME = ‘changelog-3.5’
2020-02-18 10:05:13 INFO: UPDATE PUBLIC.DATABASECHANGELOG SET MD5SUM = ‘8:1ec7941b03749f24e365bc6126b07e1a’ WHERE ID = ‘changelog-3.6’ AND AUTHOR = ‘author’ AND FILENAME = ‘changelog-3.6’
2020-02-18 10:05:13 INFO: UPDATE PUBLIC.DATABASECHANGELOG SET MD5SUM = ‘8:2e444e379f31d0b8e09273ec7ffe87a0’ WHERE ID = ‘changelog-3.7’ AND AUTHOR = ‘author’ AND FILENAME = ‘changelog-3.7’
2020-02-18 10:05:13 INFO: UPDATE PUBLIC.DATABASECHANGELOG SET MD5SUM = ‘8:974c33d2fb399ef6477c3897450fb078’ WHERE ID = ‘changelog-3.7-notmssql’ AND AUTHOR = ‘author’ AND FILENAME = ‘changelog-3.7’
2020-02-18 10:05:13 INFO: UPDATE PUBLIC.DATABASECHANGELOG SET MD5SUM = ‘8:74d68027951f8d2ae6bb2e24df8365bc’ WHERE ID = ‘changelog-3.8’ AND AUTHOR = ‘author’ AND FILENAME = ‘changelog-3.8’
2020-02-18 10:05:13 INFO: UPDATE PUBLIC.DATABASECHANGELOG SET MD5SUM = ‘8:34822842d65deb843a7d16f857d52ecc’ WHERE ID = ‘changelog-3.9’ AND AUTHOR = ‘author’ AND FILENAME = ‘changelog-3.9’
2020-02-18 10:05:13 INFO: UPDATE PUBLIC.DATABASECHANGELOG SET MD5SUM = ‘8:e1ddbe83e1ecf856a912755fc118f82e’ WHERE ID = ‘changelog-3.10’ AND AUTHOR = ‘author’ AND FILENAME = ‘changelog-3.10’
2020-02-18 10:05:13 INFO: UPDATE PUBLIC.DATABASECHANGELOG SET MD5SUM = ‘8:191c21d8f0f921845cf93bbc9d0639b9’ WHERE ID = ‘changelog-3.10-notmssql’ AND AUTHOR = ‘author’ AND FILENAME = ‘changelog-3.10’
This keeps going 3.11 3.12 etc to 4.17 then this
2020-02-18 10:05:13 INFO: SELECT COUNT(
) FROM PUBLIC.DATABASECHANGELOG
2020-02-18 10:05:13 INFO: Reading from PUBLIC.DATABASECHANGELOG
2020-02-18 10:05:13 INFO: SELECT * FROM PUBLIC.DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
2020-02-18 10:05:13 INFO: Successfully released change log lock
2020-02-18 10:05:13 INFO: Logging initialized @2315ms to org.eclipse.jetty.util.log.Slf4jLog
2020-02-18 10:05:14 INFO: Operating system name: Linux version: 5.3.0-28-generic architecture: amd64
2020-02-18 10:05:14 INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: IcedTea version: 25.232-b09
2020-02-18 10:05:14 INFO: Memory limit heap: 455mb non-heap: 0mb
2020-02-18 10:05:14 INFO: Character encoding: UTF-8 charset: UTF-8
2020-02-18 10:05:14 INFO: Version: 4.7
2020-02-18 10:05:14 INFO: Starting server…
2020-02-18 10:05:14 INFO: jetty-9.4.26.v20200117; built: 2020-01-17T12:35:33.676Z; git: 7b38981d25d14afb4a12ff1f2596756144edf695; jvm 1.8.0_232-b09
2020-02-18 10:05:14 INFO: Started o.t.w.@68ab6ab0{/,null,AVAILABLE}
2020-02-18 10:05:14 INFO: DefaultSessionIdManager workerName=node0
2020-02-18 10:05:14 INFO: No SessionScavenger set, using defaults
2020-02-18 10:05:14 INFO: node0 Scavenging every 600000ms
2020-02-18 10:05:14 INFO: Started o.e.j.s.ServletContextHandler@59f45950{/,null,AVAILABLE}
[10:05:14] INFO: Starting NGinx server…
2020-02-18 10:05:14 INFO: Started ServerConnector@aaee2a2{HTTP/1.1,[http/1.1]}{localhost:18682}
2020-02-18 10:05:14 INFO: Started @4039ms

Hope this is enough info to help.
Thanks

Using 127.0.0.1 and 18682 in configuration.yaml works for me as well.
But how can I also access that port from externally to have Android app traccar manager Access it?

I am not using traccar manager, but I think it use port 80 and not 18682. You can enable this port on addons page. It is diable by default.