Traccar Server
Traccar uses GPS for tracking and has support for over 1500 different types of devices. You can use the Traccar Server integration to communicate with your own Traccar Server, which is also available as Home Assistant add-on.
Looking for documentation on how to setup the Traccar Client with webhooks in Home Assistant? See the Traccar Client integration documentation.
Configuration
To add the Traccar Server integration to your Home Assistant instance, use this My button:
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the Add Integration button.
-
From the list, select Traccar Server.
-
Follow the instructions on screen to complete the setup.
Events
The Traccar Server integration options allow you to define a list of events you want to listen for. These events will be sent to Home Assistant as events.
All events will be prefixed with traccar_
followed by a snake_cased version of the event name.
Examples:
- The
deviceMoving
will be fired in Home Assistant astraccar_device_moving
. - The
geofenceExit
will be fired in Home Assistant astraccar_geofence_exit
. - The
alarm
will be fired in Home Assistant astraccar_alarm
.
All events will also have the following data:
{
"device_traccar_id": 24,
"device_name": "My Device",
"type": "alarm",
"serverTime": "1970-01-01T00:00:00.000Z",
"attributes": {
"custom_attribute": "value"
},
}
Devices
The Traccar Server integration will create devices for each device registered in the Traccar Server with at least one position update.
These device representations in Home Assistant will have entities associated with them, which you can use in automations, scripts, and display on your dashboard.
Entities
The traccar server integration will create entities in with the following domains:
For more details about each of these, see the sections below.
Device Tracker
The Traccar Server integration will create a device tracker entity for each device registered in Traccar Server.
In addition to the custom attributes you can define in the Traccar Server integration options, the device tracker entity will have the following attributes:
Examples
So you set up the integration and it pulled in all your devices. Now what? Below are some examples of what you can do with the data provided by Traccar Server integration.
Automations
In this section you will find some example automations that you can use to get started with the Traccar Server integration.
Do something when a device enters a geofence
The allows you to do something when the device device_tracker.millennium_falcon
enters the defined geofence.
trigger:
- platform: state
entity_id: device_tracker.millennium_falcon
attribute: geofence
to: 'Tatooine'
action:
...
Do something when a device are speeding
The allows you to do something when the device device_tracker.millennium_falcon
exceeds a defined speed.
trigger:
- platform: numeric_state
entity_id: device_tracker.millennium_falcon
attribute: speed
above: 1337
action:
...
If you want to include the speed in a notification, you can use the `` template.
Partial example:
trigger:
...
action:
- service: notify.notify
data:
message: "The current speed of the Millennium falcon is !"