Skip to main content
Version: 1.0

Presence

The Presence component`s role is to configure the sensor settings and define zones within the area for more precise tracking. It provides APIs to set the sensor configuration, add zones, calibrate the sensor tilt, enable live tracking, and control the sensor's enable/disable state.

Methods

Presence.SetConfig

Parameters:

PropertyTypeDescription

config

object

Configuration that the method takes

Find more about the config properties in config section

Presence.GetConfig

Presence.GetConfig takes no parameters.

Find the Presence.GetConfig response properties in config section

Presence.GetStatus

Presence.GetStatus takes no parameters.

Find more about the status response properties in status section

Presence.AddZone

Create new PresenceZone

Parameters:

PropertyTypeDescription

config

object

Configuration that the method takes

Find more about the config properties in PresenceZone config section

Presence.DeleteZone

Delete existing PresenceZone. Default presence zone can't be deleted. Its key can be found in config section in readonly parameter main_zone

Parameters:

PropertyTypeDescription

id

number

Id of the PresenceZone component instance

Presence.TiltCalibrate

Calibrate sensor tilt. For proper operation this must be called after sensor mounting.

Presence.TiltCalibrate takes no parameters.

Presence.LiveTrack

Restart interval for live tracking. While live track is active, periodical events with tracking objects are triggered.

Presence.LiveTrack takes no parameters.

Presence.SetSensor

Enable or disable tracking sensor. This is shortcut to change the enable parameter in config section.

Parameters:

PropertyTypeDescription

enable

boolean

Enable or disable sensor

Configuration

Parameters:

PropertyTypeDescription

enable

boolean

Enable or disable tracking sensor

zmin

number or null

Lower detection limit in meters

zmax

number or null

Upper detection limit in meters

sensor

object

Sensor configuration

PropertyTypeDescription

flipped

boolean

Sensor is flipped by 180 degrees

height

number

Mount height of sensor (in meters)

tilt

number

Sensor vertical tilt (see note)

points

number

Object recognition threshold

velocity

number

Velocity threshold

snr

number

SNR threshold

max_velocity

number

Max velocity difference

position

string

Mount position of sensor in room can be 'left', 'center' or 'right'

power

string

Power of sensor. Can be 'low', 'medium' or 'high'

sensitivity

string

Sensor sensitivity. Can be 'low', 'medium' or 'high'

state

objects

Detection state thresholds

PropertyTypeDescription

det_act_thr

number

Motion activation threshold

det_free_thr

number

Motion release threshold

act_free_thr

number

Tracking loss threshold

stat_free_thr

number

Stillness tracking threshold

sleep_free_thr

number

Stillness timeout threshold

ui

object

UI configuration

PropertyTypeDescription

imperial

boolean

Units are in imeprial system, otherwise units are in metric system

blind

array of arrays

Blind zone that sensor will ignore objects (see PresenceZone area configuration)

leds

object

LED configuration

PropertyTypeDescription

brightness

boolean

Max brightness of led

night_mode

object

PropertyTypeDescription

enable

boolean

Enable or disable night mode

brightness

number

Brightness level limit when night mode is active.

active_between

array

Containing 2 elements of type string, the first element indicates the start of the period during which the night mode will be active, the second indicates the end of that period. Both start and end are strings in the format HH:MM, where HH and MM are hours and minutes with optional leading zeros

main_zone

string

Default presence zone key. (readonly)

note

sensor.tilt can be omitted and set automatic with Presence.TiltCalibrate.

note

sensor.sensitivity can't be combined with sensor.points, sensor.velocity, sensor.snr, sensor.max_velocity and sensor.state.

Status

The status of the Presence component contains information about live tracking status and errors.

Parameters:

PropertyTypeDescription

live_track

object

State of live track process, only present when live track is running.

PropertyTypeDescription

timer_started_at

number

Unix timestamp, start time of live tracking (in UTC)

timer_duration

number

Duration of live tracking before stop (in seconds)

interval

number

Interval between events (in seconds)

Notifications

This section describes notifications for events specific to the Presence component. For general information please see this page.

Instances of the Presence component can send notifications for the following events:

  • track
    • When live track is active, while there is objects in room track event is triggered.
  • no_track
    • When live track is active and no more objects are in room no_track event is triggered.

Example for notification for event:

{"component": "presence", "event": "track", "object": [{"id": 9, "x": -0.43, "y": 0.63, "z": -0.15, "minz": 1.63, "maxz": 1.71}], "ts": 1756124403.54}
{"component": "presence", "event": "no_track", "ts": 1756124515.49}

Examples

Presence.SetConfig example

http://192.168.33.1/rpc/Presence.SetConfig?config={"enable":true,"zmin":0,"zmax":3,"sensor":{"flipped":false,"height":2,"tilt":15,"points":40,"velocity":0.1,"snr":40,"max_velocity":20,"position":"center","power":"high","state":{"det_act_thr":3,"det_free_thr":3,"act_free_thr":12,"stat_free_thr":500,"sleep_free_thr":6000}},"ui":{"imperial":false},"blind":[[-1,0,1,1]],"leds":{"brightness":20,"night_mode":{"enable":false,"brightness":20,"active_between":[]}}}

Response

{
"restart_required": true
}

Set sensitivity instead of fine tunning parameters

http://192.168.33.1/rpc/Presence.SetConfig?config={"enable":true,"zmin":0,"zmax":3,"sensor":{"flipped":false,"height":2,"tilt":15,"position":"center","power":"high","sensitivity":"high"},"ui":{"imperial":false},"blind":[[-1,0,1,1]],"leds":{"brightness":20,"night_mode":{"enable":false,"brightness":20,"active_between":[]}}}

Response

{
"restart_required": true
}

Presence.GetConfig example

http://192.168.33.1/rpc/Presence.GetConfig

Response

{
"enable": true,
"zmin": 0,
"zmax": 3,
"sensor": {
"flipped": false,
"height": 2,
"tilt": 15,
"points": 40,
"velocity": 0.1,
"snr": 40,
"max_velocity": 20,
"position": "center",
"power": "high",
"sensitivity": "high",
"state": {
"det_act_thr": 3,
"det_free_thr": 3,
"act_free_thr": 12,
"stat_free_thr": 500,
"sleep_free_thr": 6000
}
},
"ui": {
"imperial": false
},
"blind": [
[
-1,
0,
1,
1
]
],
"leds": {
"brightness": 20,
"night_mode": {
"enable": false,
"brightness": 20,
"active_between": []
}
},
"main_zone": "presencezone:200"
}

Presence.GetStatus example

http://192.168.33.1/rpc/Presence.GetStatus

Response

{
"live_track": {
"timer_started_at": 1756124368.33,
"timer_duration": 60,
"interval": 1
}
}

Presence.AddZone example

http://192.168.33.1/rpc/Presence.AddZone?config={"name":"Zone1","enable":true,"color":[255,0,0],"area":[[-4,3,4,0]]}

Response

{
"added": "presencezone:201"
}

Presence.DeleteZone example

http://192.168.33.1/rpc/Presence.DeleteZone?id=201

Response

null

Presence.TiltCalibrate example

http://192.168.33.1/rpc/Presence.TiltCalibrate

Response

null

Presence.LiveTrack example

http://192.168.33.1/rpc/Presence.LiveTrack

Response

null

Presence.SetSensor example

http://192.168.33.1/rpc/Presence.SetSensor?enable=true

Response

null