This article provides the stream event schema for the policies managed from Kio Cloud Policy Foundry. The purpose of this reference is to get insights into what policy event data you can expect when a policy's action is set to Streams.
-
Generic metadata: This metadata appears on every event generated which is used for actions.
-
Condition specific metadata: This metadata appears on every event generated by the stream condition. This metadata varies by each condition.
This metadata is consistent across all events.
Field |
Type |
Description |
---|---|---|
companyId |
string |
Id of the company (Kio Cloud account) |
name |
string |
name of the policy set in Policy Foundry |
policyId |
string |
Id of the policy |
timestamp |
string |
event date and time |
properties |
object |
mapping of policy excursion properties |
Policy Type |
Policy Condition |
Event type |
Event data Common data for all event types: roomId – current room id of the device |
---|---|---|---|
Telemetry |
Temperature |
temperature |
threshold - max/min allowed temperature reading defined by the policy condition trackingId - tracking id of the device that measured the reading temperature - current temperature reading |
Telemetry |
Air Quality |
air_quality |
threshold - max or min allowed air quality index defined by the policy condition trackingId - tracking id of the device that measured the reading airQuality - current air quality index (0-255; lower is better) |
Telemetry |
Humidity |
humidity |
threshold - max/min allowed humidity reading defined by the policy condition trackingId - tracking id of the device that measured the reading humidity - current relative humidity reading (percentage between 0 and 100) |
Occupancy |
Room Occupancy |
room_occupancy |
occupancyLimit - max/min allowed count of people in the room defined by the policy condition occupancy - current count of people in the room |
Beacon Signals |
Battery level |
battery_level |
threshold - max or min allowed battery level defined by policy condition trackingId - tracking id of the device batteryLevel - current reported battery level |
Beacon Signals |
Button Click Default (Blue) Second (Red) |
button_click |
trackingId - tracking id of the device |
Positions |
Exit location |
location_exit |
trackingId - tracking id of the device |
Positions |
Enter location |
location_entry |
trackingId - tracking id of the device |
Event data is the payload of a triggered event for a Beacon Signals condition set in a policy.
Field |
Type |
Description |
---|---|---|
body |
Object |
|
└ event |
Object |
Generic metadata of the event. |
└ companyId |
string |
ID of the Kio Cloud account |
└ name |
string |
Name of the policy; Policy Foundry |
└ policyId |
string |
ID of the policy; Policy Foundry |
└ timestamp |
string |
Event Timestamp in the ISO 8601 format, specifically in the extended format with fractions of a second and the time zone indicator. Date: "2023-10-12" (YYYY-MM-DD) Time: "13:35:48.661193515" (HH:MM:SS.SSSSSSSSS) Time Zone: "Z" (Zulu time, equivalent to UTC or GMT) |
└ properties |
Object |
Condition specific metadata of the policy excursion event |
└ floorId |
integer |
ID of the Floor; Smart Location |
└ buildingName |
string |
Name of the Building; Smart Location |
└ buttonClickType |
boolean |
Identifies the condition that triggered the event; second_button (red button) or default_button (blue) |
└ campusName |
string |
Name of the Campus; Smart Location |
└ deviceAlias |
string |
Device (trackingId) Notes field data; Device Management |
└ campusId |
integer |
Id of the Campus; Smart Location |
└ floorName |
string |
Name of the Floor; Smart Location |
└ roomId |
integer |
Id of the Room; Smart Location |
└ roomName |
string |
Name of the Room; Smart Location |
└ trackingId |
string |
MAC address of the device; Device Management |
└ buildingId |
integer |
Id of the Building; Smart Location |
└ channelId |
string |
Mapping of the unique Stream configuration |
└ action |
Object |
|
└ configurationId |
string |
|
└ actionName |
string |
|
└ rateLimiters |
array [object] |
|
└ number |
integer |
|
└ duration |
integer |
|
offset |
string |
|
sequenceNumber |
integer |
|
enqueuedTimeUtc |
tring |
timestamp in UTC format. |
systemProperties |
object |
empty object |
{
"body": {
"event": {
"companyId": "9b145841a575",
"name": "Red Button Click",
"policyId": "6526e1b7c14fa91a6c12b59c",
"timestamp": "2023-10-12T13:35:48.661193515Z"[,
"properties": {
"floorId": 303425,
"buildingName": "Demo Building",
"buttonClickType": "second_button",
"campusName": "Demp Campus",
"deviceAlias": "John S Badge",
"campusId": 219607,
"floorName": "Floor 1",
"roomId": 357173,
"roomName": "Room A101",
"trackingId": "00:sa:t6:03:e1:43",
"buildingId": 303380
}
},
"channelId": "1116ddcf277bb802291fc794",
"action": {
"configurationId": "1116ddcf277bb802291fc794",
"actionName": "firehose",
"rateLimiters": [
{
"number": 1000,
"duration": 1
}
]
}
},
"offset": "792",
"sequenceNumber": 9,
"enqueuedTimeUtc": "2023-10-12T13:35:51.924Z",
"systemProperties": {}
}
Device battery level in percentage (%).
{ "body": { "event": { "companyId": "9b145841a575", "name": "Battery Level below 25", "policyId": "6526e1b7c14fa91a6c12b59d", "timestamp": "2023-10-12T13:35:48.661193515Z"[, "properties": { "floorId": 303425, "buildingName": "Demo Building", "batteryLevel": 20, "threshold: 25, "campusName": "Demp Campus", "deviceAlias": "John S Badge", "campusId": 219607, "floorName": "Floor 1", "roomId": 357173, "roomName": "Room A101", "trackingId": "00:sa:t6:03:e1:43", "buildingId": 303380 }
Temperature reading in Celsius.
{ "body": { "event": { "companyId": "9b145841a575", "name": "Temperature Above 75", "policyId": "6526e1b7c14fa91a6c12b59e", "timestamp": "2023-10-12T13:35:48.661193515Z"[, "properties": { "floorId": 303425, "buildingName": "Demo Building", "temperature": 80, "threshold: 75, "campusName": "Demp Campus", "deviceAlias": "John S Badge", "campusId": 219607, "floorName": "Floor 1", "roomId": 357173, "roomName": "Room A101", "trackingId": "00:sa:t6:03:e1:43", "buildingId": 303380 }
Humidity reading in percentage (%).
{ "body": { "event": { "companyId": "9b145841a575", "name": "Humidity Above 45", "policyId": "6526e1b7c14fa91a6c12b59e", "timestamp": "2023-10-12T13:35:48.661193515Z"[, "properties": { "floorId": 303425, "buildingName": "Demo Building", "humidity": 55, "threshold: 45, "campusName": "Demp Campus", "deviceAlias": "John S Badge", "campusId": 219607, "floorName": "Floor 1", "roomId": 357173, "roomName": "Room A101", "trackingId": "00:sa:t6:03:e1:43", "buildingId": 303380 }
Index 0 to 255. The higher the value, the worse the air pollution.
{ "body": { "event": { "companyId": "9b145841a575", "name": "Temperature Above 75", "policyId": "6526e1b7c14fa91a6c12b59e", "timestamp": "2023-10-12T13:35:48.661193515Z"[, "properties": { "floorId": 303425, "buildingName": "Demo Building", "airQuality": 125, "threshold: 75, "campusName": "Demp Campus", "deviceAlias": "John S Badge", "campusId": 219607, "floorName": "Floor 1", "roomId": 357173, "roomName": "Room A101", "trackingId": "00:sa:t6:03:e1:43", "buildingId": 303380 }
{ "body": { "event": { "companyId": "9b145841a575", "name": "Occupancy Above 20", "policyId": "6526e1b7c14fa91a6c12b59e", "timestamp": "2023-10-12T13:35:48.661193515Z"[, "properties": { "floorId": 303425, "buildingName": "Demo Building", "occupancy": 22, "occupancyLimit": 20, "campusName": "Demp Campus", "campusId": 219607, "floorName": "Floor 1", "roomId": 357173, "roomName": "Room A101", "trackingId": "00:sa:t6:03:e1:43", "buildingId": 303380 }