Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 22c2bfe

Browse files
authored
Revert "Revert "Add sensors to the Traccar Server documentation (#31624)" (#3…"
This reverts commit 90900be.
1 parent 90900be commit 22c2bfe

File tree

3 files changed

+128
-29
lines changed

3 files changed

+128
-29
lines changed

source/_integrations/traccar_server.markdown

Lines changed: 121 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ These device representations in Home Assistant will have [entities](#entities) a
8181
The traccar server integration will create entities in with the following domains:
8282

8383
- [Device Tracker](/integrations/device_tracker)
84+
- [Sensor](/integrations/sensor)
8485

8586
For more details about each of these, see the sections below.
8687

@@ -104,22 +105,10 @@ State:
104105
In addition to the custom attributes you can define in the Traccar Server integration options, the device tracker entity will have the following attributes:
105106

106107
{% configuration_basic %}
107-
Address:
108-
description: If a position update has an address associated with it, this will be the address.
109-
Altitude:
110-
description: The altitude of the position update.
111-
Battery Level:
112-
description: The battery level of the device if defined.
113108
Category:
114109
description: The category of the device in Traccar if defined.
115-
Geofence:
116-
description: The name of the geofence the device is located in.
117110
Motion:
118111
description: If the device is moving or not.
119-
Speed:
120-
description: The speed of the device.
121-
Status:
122-
description: The status of the device in Traccar.
123112
Traccar ID:
124113
description: The ID of the device in Traccar.
125114
Tracker:
@@ -128,6 +117,120 @@ Tracker:
128117

129118
{% enddetails %}
130119

120+
### Sensor - Address
121+
122+
The Traccar Server integration will create a [sensor](/integrations/sensor) entity for each device registered in Traccar Server to show the address reported by the Traccar Server.
123+
124+
This entity is disabled by default.
125+
126+
{% configuration_basic %}
127+
Name:
128+
description: The name of the sensor will be set to what you have named it in Traccar Server followed by Address. If your device is named "Millennium Falcon", this will be "Millennium Falcon Address".
129+
Entity ID:
130+
description: This will be a slugified version of the name.
131+
Unique ID:
132+
description: This will be the unique ID of the device tracker in Traccar Server followed by `position_address`.
133+
State:
134+
description: This will be the address reported by the Traccar Server, if geo detection is not configured this will be unknown`.
135+
{% endconfiguration_basic %}
136+
137+
This entity does not have any attributes.
138+
139+
### Sensor - Altitude
140+
141+
The Traccar Server integration will create a [sensor](/integrations/sensor) entity for each device registered in Traccar Server to show the altitude reported by the Traccar Server.
142+
143+
This entity is disabled by default.
144+
145+
{% configuration_basic %}
146+
Name:
147+
description: The name of the sensor will be set to what you have named it in Traccar Server followed by Altitude. If your device is named "Millennium Falcon", this will be "Millennium Falcon Altitude".
148+
Entity ID:
149+
description: This will be a slugified version of the name.
150+
Unique ID:
151+
description: This will be the unique ID of the device tracker in Traccar Server followed by `position_altitude`.
152+
State:
153+
description: This will be the altitude in meters. You can select a different unit in the entity options if you want.
154+
{% endconfiguration_basic %}
155+
156+
This entity does not have any attributes.
157+
158+
### Sensor - Battery
159+
160+
The Traccar Server integration will create a [sensor](/integrations/sensor) entity for each device registered in Traccar Server to show the remaining battery percentage reported by the Traccar Server.
161+
162+
This entity is disabled by default.
163+
164+
{% configuration_basic %}
165+
Name:
166+
description: The name of the sensor will be set to what you have named it in Traccar Server followed by Battery. If your device is named "Millennium Falcon", this will be "Millennium Falcon Battery".
167+
Entity ID:
168+
description: This will be a slugified version of the name.
169+
Unique ID:
170+
description: This will be the unique ID of the device tracker in Traccar Server followed by `position_attributes.batteryLevel`.
171+
State:
172+
description: This will be the battery percentage (level) as reported by the tracked device, if the device does not have a battery this will be unknown.
173+
{% endconfiguration_basic %}
174+
175+
This entity does not have any attributes.
176+
177+
### Sensor - Geofence
178+
179+
The Traccar Server integration will create a [sensor](/integrations/sensor) entity for each device registered in Traccar Server to show the geofence reported by the Traccar Server.
180+
181+
This entity is disabled by default.
182+
183+
{% configuration_basic %}
184+
Name:
185+
description: The name of the sensor will be set to what you have named it in Traccar Server followed by Geofence. If your device is named "Millennium Falcon", this will be "Millennium Falcon Geofence".
186+
Entity ID:
187+
description: This will be a slugified version of the name.
188+
Unique ID:
189+
description: This will be the unique ID of the device tracker in Traccar Server followed by `geofence_geofence`.
190+
State:
191+
description: This will be geofence that the device is in, if you have overlapping geofences it will show the first one as reported by the Traccar Server.
192+
{% endconfiguration_basic %}
193+
194+
This entity does not have any attributes.
195+
196+
### Sensor - Speed
197+
198+
The Traccar Server integration will create a [sensor](/integrations/sensor) entity for each device registered in Traccar Server to show the speed reported by the Traccar Server.
199+
200+
This entity is disabled by default.
201+
202+
{% configuration_basic %}
203+
Name:
204+
description: The name of the sensor will be set to what you have named it in Traccar Server followed by Speed. If your device is named "Millennium Falcon", this will be "Millennium Falcon Speed".
205+
Entity ID:
206+
description: This will be a slugified version of the name.
207+
Unique ID:
208+
description: This will be the unique ID of the device tracker in Traccar Server followed by `position_speed`.
209+
State:
210+
description: This will be the speed of the device in knots. You can select a different unit in the entity options if you want.
211+
{% endconfiguration_basic %}
212+
213+
This entity does not have any attributes.
214+
215+
### Sensor - Status
216+
217+
The Traccar Server integration will create a [sensor](/integrations/sensor) entity for each device registered in Traccar Server to show the status reported by the Traccar Server.
218+
219+
This entity is disabled by default.
220+
221+
{% configuration_basic %}
222+
Name:
223+
description: The name of the sensor will be set to what you have named it in Traccar Server followed by Status. If your device is named "Millennium Falcon", this will be "Millennium Falcon Status".
224+
Entity ID:
225+
description: This will be a slugified version of the name.
226+
Unique ID:
227+
description: This will be the unique ID of the device tracker in Traccar Server followed by `devcie_status`.
228+
State:
229+
description: This will be one of the following; `offline`, `unknown`, `online`.
230+
{% endconfiguration_basic %}
231+
232+
This entity does not have any attributes.
233+
131234
## Examples
132235

133236
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.
@@ -138,7 +241,7 @@ In this section you will find some example automations that you can use to get s
138241

139242
#### Do something when a device enters a geofence
140243

141-
The allows you to do something when the device `device_tracker.millennium_falcon` enters the defined geofence.
244+
The allows you to do something when the device "Millennium Falcon" enters the defined geofence.
142245

143246
{% my blueprint_import badge blueprint_url="https://www.home-assistant.io/blueprints/integrations/traccar_server_device_enter_geofence.yaml" %}
144247

@@ -147,8 +250,7 @@ The allows you to do something when the device `device_tracker.millennium_falcon
147250
```yaml
148251
trigger:
149252
- platform: state
150-
entity_id: device_tracker.millennium_falcon
151-
attribute: geofence
253+
entity_id: sensor.millennium_falcon_geofence
152254
to: 'Tatooine'
153255
action:
154256
...
@@ -158,7 +260,7 @@ action:
158260
159261
#### Do something when a device are speeding
160262
161-
The allows you to do something when the device `device_tracker.millennium_falcon` exceeds a defined speed.
263+
The allows you to do something when the device "Millennium Falcon" exceeds a defined speed.
162264
163265
{% my blueprint_import badge blueprint_url="https://www.home-assistant.io/blueprints/integrations/traccar_server_device_speed_limit.yaml" %}
164266
@@ -167,14 +269,13 @@ The allows you to do something when the device `device_tracker.millennium_falcon
167269
```yaml
168270
trigger:
169271
- platform: numeric_state
170-
entity_id: device_tracker.millennium_falcon
171-
attribute: speed
272+
entity_id: sensor.millennium_falcon_speed
172273
above: 1337
173274
action:
174275
...
175276
```
176277
177-
If you want to include the speed in a notification, you can use the `{{ trigger.to_state.attributes.speed }}` template.
278+
If you want to include the speed in a notification, you can use the `{{ trigger.to_state.state }}` template.
178279

179280
Partial example:
180281

@@ -184,7 +285,7 @@ trigger:
184285
action:
185286
- service: notify.notify
186287
data:
187-
message: "The current speed of the Millennium falcon is {{ trigger.to_state.attributes.speed }}!"
288+
message: "The current speed of the Millennium falcon is {{ trigger.to_state.state }}!"
188289
```
189290

190291
{% enddetails %}

source/blueprints/integrations/traccar_server_device_enter_geofence.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ blueprint:
88
domain: automation
99
author: ludeeus
1010
homeassistant:
11-
min_version: 2024.2.0
11+
min_version: 1970.1.1 # Placeholder that need replacement but the version is currently not known
1212
input:
1313
devices:
14-
name: Devices
15-
description: The Traccar device(s) trackers you want to act upon
14+
name: Device geofences
15+
description: The Traccar sensor that holds the geofence you want to act upon
1616
selector:
1717
entity:
1818
multiple: true
1919
filter:
2020
integration: "traccar_server"
21-
domain: "device_tracker"
21+
domain: "sensor"
2222
geofence:
2323
name: Geofence
2424
description: The name of the geofence
@@ -46,7 +46,6 @@ blueprint:
4646
trigger:
4747
- platform: state
4848
entity_id: !input devices
49-
attribute: geofence
5049
to: !input geofence
5150
condition: !input conditions
5251
action: !input actions

source/blueprints/integrations/traccar_server_device_speed_limit.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ blueprint:
77
domain: automation
88
author: ludeeus
99
homeassistant:
10-
min_version: 2024.2.0
10+
min_version: 1970.1.1 # Placeholder that need replacement but the version is currently not known
1111
input:
1212
devices:
1313
name: Devices
14-
description: The Traccar device(s) trackers you want to act upon
14+
description: The Traccar sensor that holds the speed you want to act upon
1515
selector:
1616
entity:
1717
multiple: true
1818
filter:
1919
integration: "traccar_server"
20-
domain: "device_tracker"
20+
domain: "sensor"
2121
speed:
2222
name: Geofence
2323
description: The speed limit
@@ -45,7 +45,6 @@ blueprint:
4545
trigger:
4646
- platform: numeric_state
4747
entity_id: !input devices
48-
attribute: speed
4948
above: !input speed
5049
condition: !input conditions
5150
action: !input actions

0 commit comments

Comments
 (0)