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.
Presence.SetConfigto update the component's configurationPresence.GetConfigto obtain the component's configurationPresence.GetStatusto obtain the component's statusPresence.AddZoneto create PresenceZonePresence.DeleteZoneto delete PresenceZonePresence.TiltCalibrateto calibrate tilt of sensorPresence.LiveTrackto enable live tracking of objects in roomPresence.SetSensorto enable or disable tracking sensor
Methods
Presence.SetConfig
Parameters:
| Property | Type | Description |
|---|---|---|
| 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:
| Property | Type | Description |
|---|---|---|
| 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:
| Property | Type | Description |
|---|---|---|
| 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:
| Property | Type | Description |
|---|---|---|
| boolean | Enable or disable sensor |
Configuration
Parameters:
| Property | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| boolean | Enable or disable tracking sensor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| number or null | Lower detection limit in meters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| number or null | Upper detection limit in meters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| object | Sensor configuration
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| object | UI configuration
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| array of arrays | Blind zone that sensor will ignore objects (see PresenceZone area configuration) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| object | LED configuration
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| string | Default presence zone key. (readonly) |
sensor.tilt can be omitted and set automatic with Presence.TiltCalibrate.
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:
| Property | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| object | State of live track process, only present when live track is running.
|
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
trackevent is triggered.
- When live track is active, while there is objects in room
no_track- When live track is active and no more objects are in room
no_trackevent is triggered.
- When live track is active and no more objects are in room
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
- Presence.SetConfig HTTP GET Request
- Presence.SetConfig Curl Request
- Presence.SetConfig Mos Request
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":[]}}}
curl -X POST -d '{"id":1,"method":"Presence.SetConfig","params":{"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":[]}}}}}' http://${SHELLY}/rpc
mos --port ${PORT} call 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
- Presence.SetConfig HTTP GET Response
- Presence.SetConfig Curl Response
- Presence.SetConfig Mos Response
{
"restart_required": true
}
{
"id": 1,
"src": "shellypresence-f0f5bd287ad0",
"params": {
"restart_required": true
}
}
{
"restart_required": true
}
Set sensitivity instead of fine tunning parameters
- Presence.SetConfig HTTP GET Request
- Presence.SetConfig Curl Request
- Presence.SetConfig Mos Request
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":[]}}}
curl -X POST -d '{"id":1,"method":"Presence.SetConfig","params":{"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":[]}}}}}' http://${SHELLY}/rpc
mos --port ${PORT} call 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
- Presence.SetConfig HTTP GET Response
- Presence.SetConfig Curl Response
- Presence.SetConfig Mos Response
{
"restart_required": true
}
{
"id": 1,
"src": "shellypresence-f0f5bd287ad0",
"params": {
"restart_required": true
}
}
{
"restart_required": true
}
Presence.GetConfig example
- Presence.GetConfig HTTP GET Request
- Presence.GetConfig Curl Request
- Presence.GetConfig Mos Request
http://192.168.33.1/rpc/Presence.GetConfig
curl -X POST -d '{"id":1,"method":"Presence.GetConfig"}' http://${SHELLY}/rpc
mos --port ${PORT} call Presence.GetConfig
Response
- Presence.GetConfig HTTP GET Response
- Presence.GetConfig Curl Response
- Presence.GetConfig Mos 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"
}
{
"id": 1,
"src": "shellypresence-f0f5bd287ad0",
"params": {
"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"
}
}
{
"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
- Presence.GetStatus HTTP GET Request
- Presence.GetStatus Curl Request
- Presence.GetStatus Mos Request
http://192.168.33.1/rpc/Presence.GetStatus
curl -X POST -d '{"id":1,"method":"Presence.GetStatus"}' http://${SHELLY}/rpc
mos --port ${PORT} call Presence.GetStatus
Response
- Presence.GetStatus HTTP GET Response
- Presence.GetStatus Curl Response
- Presence.GetStatus Mos Response
{
"live_track": {
"timer_started_at": 1756124368.33,
"timer_duration": 60,
"interval": 1
}
}
{
"id": 1,
"src": "shellypresence-f0f5bd287ad0",
"params": {
"live_track": {
"timer_started_at": 1756124368.33,
"timer_duration": 60,
"interval": 1
}
}
}
{
"live_track": {
"timer_started_at": 1756124368.33,
"timer_duration": 60,
"interval": 1
}
}
Presence.AddZone example
- Presence.AddZone HTTP GET Request
- Presence.AddZone Curl Request
- Presence.AddZone Mos Request
http://192.168.33.1/rpc/Presence.AddZone?config={"name":"Zone1","enable":true,"color":[255,0,0],"area":[[-4,3,4,0]]}
curl -X POST -d '{"id":1,"method":"Presence.AddZone","params":{"config":{"name":"Zone1","enable":true,"color":[255,0,0],"area":[[-4,3,4,0]]}}}' http://${SHELLY}/rpc
mos --port ${PORT} call Presence.AddZone '{"config":{"name":"Zone1","enable":true,"color":[255,0,0],"area":[[-4,3,4,0]]}}'
Response
- Presence.AddZone HTTP GET Response
- Presence.AddZone Curl Response
- Presence.AddZone Mos Response
{
"added": "presencezone:201"
}
{
"id": 1,
"src": "shellypresence-f0f5bd287ad0",
"params": {
"added": "presencezone:201"
}
}
{
"added": "presencezone:201"
}
Presence.DeleteZone example
- Presence.DeleteZone HTTP GET Request
- Presence.DeleteZone Curl Request
- Presence.DeleteZone Mos Request
http://192.168.33.1/rpc/Presence.DeleteZone?id=201
curl -X POST -d '{"id":1,"method":"Presence.DeleteZone","params":{"id":201}}' http://${SHELLY}/rpc
mos --port ${PORT} call Presence.DeleteZone '{"id":201}'
Response
- Presence.DeleteZone HTTP GET Response
- Presence.DeleteZone Curl Response
- Presence.DeleteZone Mos Response
null
{
"id": 1,
"src": "shellypresence-f0f5bd287ad0",
"params": null
}
null
Presence.TiltCalibrate example
- Presence.TiltCalibrate HTTP GET Request
- Presence.TiltCalibrate Curl Request
- Presence.TiltCalibrate Mos Request
http://192.168.33.1/rpc/Presence.TiltCalibrate
curl -X POST -d '{"id":1,"method":"Presence.TiltCalibrate"}' http://${SHELLY}/rpc
mos --port ${PORT} call Presence.TiltCalibrate
Response
- Presence.TiltCalibrate HTTP GET Response
- Presence.TiltCalibrate Curl Response
- Presence.TiltCalibrate Mos Response
null
{
"id": 1,
"src": "shellypresence-f0f5bd287ad0",
"params": null
}
null
Presence.LiveTrack example
- Presence.LiveTrack HTTP GET Request
- Presence.LiveTrack Curl Request
- Presence.LiveTrack Mos Request
http://192.168.33.1/rpc/Presence.LiveTrack
curl -X POST -d '{"id":1,"method":"Presence.LiveTrack"}' http://${SHELLY}/rpc
mos --port ${PORT} call Presence.LiveTrack
Response
- Presence.LiveTrack HTTP GET Response
- Presence.LiveTrack Curl Response
- Presence.LiveTrack Mos Response
null
{
"id": 1,
"src": "shellypresence-f0f5bd287ad0",
"params": null
}
null
Presence.SetSensor example
- Presence.SetSensor HTTP GET Request
- Presence.SetSensor Curl Request
- Presence.SetSensor Mos Request
http://192.168.33.1/rpc/Presence.SetSensor?enable=true
curl -X POST -d '{"id":1,"method":"Presence.SetSensor","params":{"enable":true}}' http://${SHELLY}/rpc
mos --port ${PORT} call Presence.SetSensor '{"enable":true}'
Response
- Presence.SetSensor HTTP GET Response
- Presence.SetSensor Curl Response
- Presence.SetSensor Mos Response
null
{
"id": 1,
"src": "shellypresence-f0f5bd287ad0",
"params": null
}
null