Traccar is an open source, self-hosted “live tracking” system that also provides instant notifications for custom alarms and offers a variety of reports including location history, trip, chart and overview reports and much more.
This article describes how a LoraWan GPS tracker, which is not actually supported, can be integrated. In addition, additional functions are implemented:
Unlimited number of self-defined geo fences
Notification options when reaching or leaving fences
Monitor your Duration of Stays at defined locations
(this Installation use the H2 DataBase, recomended only for testing)
`apt update && apt upgrade -y
wget https://www.traccar.org/download/traccar-linux-64-latest.zip
unzip traccar-linux-64-latest.zip
chmod +x traccar.run
./traccar.run
service traccar start
tail -f /opt/traccar/logs/tracker-server.log
`
LoraWan Node -> Gateway -> TTN LNS -> MQTT -> Lorawan Adapter -> Iobroker -> Script ->Traccar Server -> API -> Iobroker -> Telegram Bot -> "TBeam leaving GeoFence after 8 Hours 4 minuts"
A (Blockly) script converts the position data and other data into a webook in the "Osmand format" which is described here:
OsmAnd protocol
and looks like (minimum):
http://YOUR_TRACCAR_IP:5055/?id=12345&lat=48.8566&lon=2.3522
The following must be adjusted in the script: The IP address of the Traccar server, the ID of the Lorawan GPS tracker (as created in the Traccar server), as well as (optionally) the ID of the LoraWan gateway and the data points for the position (latitude, longitude, battery)
The data points for the position data can be copied very easily:
The finished script can be copied from the following link as an import:
Script Import Link
If the position data of the LoraWan gateways are stored, these, as well as the calculated distance and transmission parameters, are also transmitted.
The Traccar2iobroker script now queries the position data, also in connection with the configured GeoFences, places them in data points in Iobroker and, if configured, sends messages about entering/leaving GeoFences
This Script use (optional) Telegram Adapter, please install before import the script
(There is no need to set up or start Telegram Adapter, it just needs to be there)
Three things must be entered in the script: IP address:Port of the Traccar server, user:password and the device ID. The following applies when entering the user name: This is the registered email address of the user. The "@" character must be replaced with "%40". For example, Muster@Muster.com
must be entered in the script: Muster%40Muster.com
. If there is an "@" character in the password, this can also be replaced with "%40", but this is not absolutely necessary. The user set up in Traccar must have admin rights and must have been explicitly approved for all devices and GeoFences.
This means that not only the position data is recorded, but also the status of the geofences. After entering API keys from OpenCageData and 3 Words, the address data and the position are also recorded in 3Word format. The position and distance of the gateways, as well as the transmission parameters, are also saved.
Go to and sign up, get a API Key:
Open Cage Data
Go to and sign up/register, get a API Key:
3words
This fills the Datapoints for the Adress and 3Words after position update
If the Telegram user name is entered in "Info_Abruf_Empfänger", the user will receive the position data via telegram after setting "Info_Abruf_Auslösen" to "true".
The name entry at "GeoFense_Info_Empfänger" receives a message when the device entering and leaving the geo fences if "Geofence_Info_bekommen" is true.
Note that the geo fences must be activated separately in the device settings:
The respective geo fence IDs are entered in the data points ID_Zuhause and ID_Arbeit. This enables precise recording of entries and exits as well as the respective length of stay
Regardless of the settings for home and work, the length of each stay in each geo fence is recorded in the data point "presence_detection"
The LT-10 is a LoRaWAN solar ear tag GPS tracker designed for range animals use. The high performance solar cell can last for many years of regular use.
Apple App Store Link LT-10 APP
Enable ADR ON, Enable Duty Cycle OFF, Join Mode OTAA
DevEUI is the Lora MAC address of the device and can be read by scanning the QR code.
`JoinEUI/AppEUI is: 000DB5AA00000010
AppKey is: 0123456789ABCDEFEFCDAB8967452301 `
Payload Decoder:
GlobalSat LT-10 Payload Decoder
Device Charging For normal charging, the device has to be turned on and placed under sunshine to charge. It would take half day to several days to charge to at least 90% for normal application according to sunshine condition.
To turn the device “ON”, please take a proper magnet under device’s LED for 4 seconds as picture above. Then it would blink Red 3 times (100ms on, 100ms off). There are two kinds of behavior as following table when the device is on.
Operation mode
Take magnet under device’s LED for 1 second and it will blink Red 1 time (100ms).
Low battery mode
Take magnet under device’s LED for 1 second and it will blink Red 1 time (1 second).
To turn the device “OFF”, please take a proper magnet under device’s LED for 4 seconds. Then it would blink Red 3 times (100ms on, 100ms off). Noted: Take magnet under device LED for 1 second and it has no LED blink.
To do hardware reset, Take magnet under device’s LED over 11 seconds and it would blink Red for 3 seconds (50ms on, 50ms off).
Notice:
When it is in low battery mode, it could not join to network server and send any report. It could not modify device settings via App as well.
Never place the magnet nearby device’s LED continually, it would cause device to be in unknown mode and consume the extra power consumption.
The following automated messages are currently implemented:
Entering a geofence, leaving the geofence, time spent within the geofence, notification if the tracker has not sent its position.
Possible delivery options (currently) Pushover, Telegram, SMS and email
Link to Original Payload Decoder
Link to Payload Decoder with TTN Mapper Funktion
Manual Link