EN

Teltonika

Example on GitHub (opens in a new tab)

Model

🚩

Problem: Suppose you have a standalone personal tracker TMT250 running Teltonika protocol, which you intend to use to ensure the safety of workers in hazardous industrial areas. You know that, in addition to the basic values defined in the protocol, it transmits the following additional parameters.

ParameterParameter ID in AVL package
Battery Level113
Battery Voltage67
Battery Current68
Movement240
Data Mode80
GSM Signal21
Sleep Mode200
GNSS Status69
GNSS PDOP181
GNSS HDOP182
Instant Movement303
Charger Connected116
Axis X17
Axis Y18
Axis Z19
Alarm236
ManDown/FallDown242
Movement Event310
Button Click389
Power Event390
Tamper detection Event520
BLE Temperature #125
BLE Battery #129
BLE Humidity #186
🚩

You also stipulate that the on_demand_tracking# command be sent to the terminal. |

ActionCommand
Stops trackingon_demand_tracking0
Starts tracking

To connect the tracker to the platform, create a Teltonika model for it.

There are many parameters in the template model. By searching through the model, you can understand which parameters are already present, and which ones you need to add yourself.

ParameterParameter ID in AVL package
Battery Level113
Battery Voltage67
Battery Current68
Movement240
Data Mode80
GSM Signal21
Sleep Mode200
GNSS Status69
GNSS PDOP181
GNSS HDOP182
Instant Movement303
Charger Connected116
Axis X17
Axis Y18
Axis Z19
Alarm236
ManDown/FallDown242
Movement Event310
Button Click389
Power Event390
Tamper detection Event520
BLE Temperature #125
BLE Battery #129
BLE Humidity #186

Remove or hide unnecessary parameters from display, and add missing parameters. Parameters can be arranged and grouped at your discretion, but the model will look as follows. the model will be as follows.

For more information on Teltonika argument formation

There are also examples of several commands in the template model, form your tracker commands based on them. commands for your tracker.

For more information on forming Teltonika actions.

View a preview of the object with the model you created by clicking Show preview. preview**.

If you wish, select an icon to display the object on the map, or upload your own image.

Model to import (opens in a new tab)

Object

Create an object for your tracker. Select the model you just created. Then enter the identifier corresponding to the tracker's IMEI, ** prefixed with teltonika:**. Specify a name for the object.

Once saved, the instructions for configuring the device to the platform will open.

Connection

To connect the tracker to the platform, specify in the settings of its configurator

  • host dev.rightech.io
  • port 21451

Make sure that after saving the settings, the data from the device is sent and are displayed in the interface. After receiving the coordinate packet, the object should be displayed on the map.

Send commands and check that the connected device responds to them.

For more information on connecting devices

Logic

As an example of interaction of several devices in one automaton let's consider the following problem.

🚩

Task: Suppose that a scooter, whose connection is discussed in the following example, needs to send a command to turn on a flashlight if an employee presses the alarm button on their tracker.

In this case, the automaton will contain only one state: waiting for the press of the button. Transition from this state will take place in the same state.

Create a new automaton. Choose two models: a tracker and a scooter, as the automaton will organize interaction between two objects with these objects. automaton will organize interaction between two objects with these models. models. Events will come from the tracker, and commands will be sent to the scooter.

Since the logic of the automation script calls for a cyclic control over pressing the button, the automaton will be infinite, the final state is can be moved out of sight and not used. Create one state of the automaton.

The transition from this state to the same state will occur on receipt of an event about receiving the alarm button press data. Note that when tracker model is active when selecting events, because the events received from it will serve to trigger the alarm. events received from the tracker will be used to trigger the transition.

Now add a command to turn on the flashlight. So that the sending of the command doesn't happen at the very first moment of time, when the automaton is just started, add it not on the entry to the state, but on exit from it. Note that when selecting the action, the scooter model must be active, as the command will be sent to the scooter. it.

The automaton is ready. Select the objects and run it.

Now when the alarm button on the tracker is triggered, the scooter is now sent a a command to turn on the headlight.