Table of Contents

Sensors

To create, edit or delete sensors, use the command unit/update_sensor:

svc=unit/update_sensor&params={"itemId":<long>,
			       "id":<long>,
			       "callMode":<text>,
			       "n":<text>,
			       "t":<text>,
			       "d":<text>,
			       "m":<text>,
			       "p":<text>,
			       "f":<uint>,
			       "vt":<uint>,
			       "vs":<long>,
			       "tbl":[	
					{
						"x":<double>,
						"a":<double>,
						"b":<double>
					}
			       ]}

Parameters

Name Description
itemId unit ID
id sensor ID
callMode action: create, update, delete
Parameters required only to create and update:
n name
t type (see below)
d description
m metrics
p parameter
f sensor flags (see below)
vt validation type (see below)
vs validating sensor ID
tbl calculation table

Sensor flags:

Flag Description
0x01 sensor type: instant
0x02 sensor type: differential
0x03 sensor type: differential with overflow (2 bytes)
0x04 sensor type: switch from off to on
0x05 sensor type: switch from on to off

Sensor types:

  • impulse fuel consumption - impulse fuel consumption sensor;
  • absolute fuel consumption - absolute fuel consumption sensor;
  • instant fuel consumption - instant fuel consumption sensor;
  • fuel level - fuel level sensor;
  • fuel level impulse sensor - fuel level impulse sensor;
  • temperature - temperature sensor;
  • temperature coefficient - temperature coefficient;
  • engine rpm - engine revs sensor;
  • engine operation - engine ignition sensor;
  • voltage - voltage sensor;
  • digital - custom digital sensor;
  • custom - custom sensor;
  • mileage - mileage sensor;
  • odometer - relative odometer;
  • engine efficiency - engine efficiency sensor;
  • engine hours - absolute engine hours;
  • relative engine hours - relative engine hours;
  • counter - counter sensor;
  • accelerometer - accelerometer.

Validation types:

Type Description
0x01 Logical AND
0x02 Logical OR
0x03 Math AND
0x04 Math OR
0x05 Sum up
0x06 Subtract validator from sensor
0x07 Subtract sensor from validator
0x08 Multiply
0x09 Divide sensor by validator
0x0A Divide validator by sensor
0x0B Not-null check

Response

On create and edit:

[
	<long>,		/* sensor ID */
	{
		"nm":<text>,	/* name */
		"tp":<text>,	/* type */
		"de":<text>,	/* description */
		"me":<text>,	/* metrics */
		"pn":<text>,	/* parameter */
		"fl":<uint>,	/* sensor flags */
		"vt":<int>,	/* validation type */
		"vs":<long>,	/* validating sensor ID */
		"tbl":[			/* calculation table */
			{			/* parameters */
				"x":<double>, 
				"a":<double>,
				"b":<double>
			}
		]
	}
]

On delete:

[
	<long>,		/* sensor ID */
	null
]
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2024 Gurtam