diff --git a/doc/Analytics.xml b/doc/Analytics.xml index 5b9b81a20..11eb437c8 100644 --- a/doc/Analytics.xml +++ b/doc/Analytics.xml @@ -663,6 +663,8 @@ This section focuses on scene elements generated by object tracking algorithms and defines object handling and object shapes for them. Frames where no objects have been detected can be skipped within the scene description to save bandwidth, as long as the last frame in the scene description is empty as well. . It is recommended that the device regularly sends the scene description even if it is empty. This is in order to indicate that the analytics engine is operational. The device shall send a scene description if a SynchronizationPoint is requested for the corresponding stream. When the receiver of a scene description receives an empty frame, the receiver should assume that all subsequent frames are empty as well until the next non-empty frame is received. When the last received frame is non-empty, the receiver should assume that a description of the next processed frame will be transmitted. + +
Objects The object node has two placeholders for appearance and behaviour information. The appearance node starts with an optional transformation node which can be used to change from a frame-centric coordinate system to an object-centric coordinate system. Next, the Shape of an object can be specified. If an object is detected in a frame, the shape information should be present in the appearance description. The analytics algorithm may add object nodes for currently not visible objects, if it is able to infer information for this object otherwise. In such cases, the shape description may be omitted. @@ -2489,6 +2491,93 @@ ]]>
+ +
+ Sensor Data + This section defines the metadata representation for multi-dimensional sensor data, used for periodic sensor data reporting scenarios. + +
+ Sensor Data Description + Sensor data is represented through the SensorData element, which contains the following information: + + + Type: Type of sensor (e.g., Temperature, RelativeHumidity, AbsoluteHumidity, etc.) + + + Value: Numerical value from the sensor. The unit of temperature is Kelvin, the unit of absolute humidity is g/m³, and the unit of relative humidity is %. + + + + The SensorData element is designed to be included in the MetadataStream structure, + allowing sensor data to be transmitted alongside other metadata types. +
+ +
+ Temperature Sensor Metadata + Temperature sensor data is a common type of sensor information. The metadata for temperature sensors follows the general sensor data structure with specific conventions: + + + Type: Should be set to "temperature" + + + Value: Floating point value representing the temperature in Kelvin + + + + + Temperature + 298.65 +]]> +
+ +
+ Humidity Sensor Metadata + Humidity sensor data represents ambient humidity conditions. The metadata for humidity sensors follows the general sensor data structure with specific conventions: + + + Type: Should be set to "RelativeHumidity" or "AbsoluteHumidity" + + + Value: Floating point value representing the humidity percentage, either relative or absolute, units are %RH or g/m³ + + + + Absolute humidity is the actual mass of water vapor per unit volume of air (unit: g/m³), while relative humidity is the percentage ratio of the current water vapor content to the saturated content at the same temperature (unit: %). + + + AbsoluteHumidity + 10 +]]> + + + RelativeHumidity + 65.2 +]]> + +
+ +
+ Sensor Data Example + The following is an example of temperature and humidity sensor data in the MetadataStream: + + + + + + Temperature + 298.65 + + + RelativeHumidity + 65.2 + + + AbsoluteHumidity + 10 + +]]> +
+
JSON over MQTT @@ -2644,6 +2733,12 @@ ONVIF metadata from a PTZ node included in Profile configuration + + + "SensorData" + Type + ONVIF metadata from sensor data sources + @@ -2661,9 +2756,15 @@ PTZConfigurationToken = The PTZ configuration token + + + Type = The type of sensor (e.g., "Temperature", "RelativeHumidity", "AbsoluteHumidity") +
+ +
Example @@ -2843,6 +2944,53 @@ xmlns:acme="http://www.acme.com/schema"> }] }
+ +
+ Sensor Data Examples + + Temperature data will be published under this topic. For devices with multiple temperature sensors, each sensor will publish data with a unique SensorID in the payload: + + MyDevice/onvif-mj/SensorData/Temperature + + Shown below is how the sample temperature sensor data is formatted in JSON: + + { + "SensorData": { + "@UtcTime": "2025-07-15T14:30:00Z", + "@SensorID": "temp_001", + "Value": 298.65 + } + } + + Relative Humidity data will be published under this topic. For devices with multiple humidity sensors, each sensor will publish data with a unique SensorID in the payload: + + MyDevice/onvif-mj/SensorData/RelativeHumidity + + Shown below is how the sample humidity sensor data is formatted in JSON: + + { + "SensorData": { + "@UtcTime": "2025-07-15T14:30:00Z", + "@SensorID": "humidity_001", + "Value": 65.2 + } + } + + Absolute Humidity data will be published under this topic. For devices with multiple humidity sensors, each sensor will publish data with a unique SensorID in the payload: + + MyDevice/onvif-mj/SensorData/AbsoluteHumidity + + Shown below is how the sample humidity sensor data is formatted in JSON: + + { + "SensorData": { + "@UtcTime": "2025-07-15T14:30:00Z", + "@SensorID": "humidity_001", + "Value": 10 + } + } + +
diff --git a/doc/Core.xml b/doc/Core.xml index 6f8345392..b979ada16 100644 --- a/doc/Core.xml +++ b/doc/Core.xml @@ -6720,6 +6720,109 @@ Event description: ]]> +
+ Sensor Data Event Topics + ONVIF defines the following topics related to sensor data: + + + tns1:Device/Sensor/Temperature/High - Temperature too high event + + + tns1:Device/Sensor/Temperature/Low - Temperature too low event + + + tns1:Device/Sensor/RelativeHumidity/High - Relative Humidity too high event + + + tns1:Device/Sensor/RelativeHumidity/Low - Relative Humidity too low event + + + tns1:Device/Sensor/AbsoluteHumidity/High - Absolute Humidity too high event + + + tns1:Device/Sensor/AbsoluteHumidity/Low - Absolute Humidity too low event + + + + The following event should be generated with true value when a temperature sensor detects a value exceeding the configured high threshold (Temperature unit: Kelvin). + + + + + + + + +]]> + + The following event should be generated with true value when a temperature sensor detects a value below the configured low threshold (Temperature unit: Kelvin). + + + + + + + + +]]> + + The following event should be generated with true value when a relative humidity sensor detects a value exceeding the configured high threshold (relative humidity unit: %). + + + + + + + + +]]> + + The following event should be generated with true value when a relative humidity sensor detects a value below the configured low threshold (relative humidity unit: %). + + + + + + + + +]]> + + The following event should be generated with true value when a absolute humidity sensor detects a value exceeding the configured high threshold (absolute humidity unit: g/m³). + + + + + + + + +]]> + + The following event should be generated with true value when a absolute humidity sensor detects a value below the configured low threshold (absolute humidity unit: g/m³). + + + + + + + + +]]> + +
@@ -8168,6 +8271,7 @@ http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet The output shall be generated according above described rules.
Example + The XML example response from PullMessages listed in Section contains two messages which are mapped to the following corresponding MQTT topics and JSON payload. In these examples TopicPrefix has been set @@ -8223,6 +8327,51 @@ http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet } } } + + The following examples show sensor event messages published via MQTT. In these examples TopicPrefix has been set to "MyDevice". + + Topic for temperature high event: + MyDevice/onvif-ej/Device/Sensor/Temperature/High + + Temperature high event payload (Temperature unit: Kelvin): + { + "UtcTime": "2025-07-15T14:30:00Z", + "Source": { + "SensorID": "temp_001" + }, + "Data": { + "Value": 298.65 + } +} + + Topic for relative humidity high event: + MyDevice/onvif-ej/Device/Sensor/RelativeHumidity/High + + Relative Humidity high event payload (Unit: %) + { + "UtcTime": "2025-07-15T14:30:00Z", + "Source": { + "SensorID": "humidity_001" + }, + "Data": { + "Value": 65.2 + } +} + + Topic for absolute humidity high event: + MyDevice/onvif-ej/Device/Sensor/AbsoluteHumidity/High + + Absolute Humidity high event payload (Unit: g/m³) + { + "UtcTime": "2025-07-15T14:30:00Z", + "Source": { + "SensorID": "humidity_001" + }, + "Data": { + "Value": 10 + } +} +
diff --git a/wsdl/ver10/events/wsdl/event.wsdl b/wsdl/ver10/events/wsdl/event.wsdl index 78cc25a56..8a03d8fc9 100644 --- a/wsdl/ver10/events/wsdl/event.wsdl +++ b/wsdl/ver10/events/wsdl/event.wsdl @@ -387,7 +387,7 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO Concrete Topic Expression to select specific metadata topics to publish. - + diff --git a/wsdl/ver10/schema/metadatastream.xsd b/wsdl/ver10/schema/metadatastream.xsd index 09a71d864..dcb631433 100644 --- a/wsdl/ver10/schema/metadatastream.xsd +++ b/wsdl/ver10/schema/metadatastream.xsd @@ -419,6 +419,7 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO + @@ -437,6 +438,16 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO + + + + + + + + + + diff --git a/wsdl/ver10/schema/onvif.xsd b/wsdl/ver10/schema/onvif.xsd index 697a1f181..b3287cf1a 100755 --- a/wsdl/ver10/schema/onvif.xsd +++ b/wsdl/ver10/schema/onvif.xsd @@ -1437,6 +1437,17 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO Note that the streaming behavior is undefined if the list includes items that are not part of the associated AnalyticsConfiguration. + + + Optional element to configure which sensor data is to include in the metadata stream. A client might be interested in receiving all, + none or some of the sensor data produced by the device:
    +
  • To get all sensor data: Include the SensorData element but do not include any filter criteria.
  • +
  • To get no sensor data: Do not include the SensorData element.
  • +
  • To get only some sensor data: Include the SensorData element and specify filter criteria (SensorID list, Type list, etc.).
  • +
+
+
+
@@ -1486,6 +1497,32 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO
+ + + Optional element to configure which sensor data is to include in the metadata stream. A client might be interested in receiving all, none or some of the sensor data produced by the device: +
    +
  • To get all sensor data: Include the SensorData element but do not include any filter criteria.
  • +
  • To get no sensor data: Do not include the SensorData element.
  • +
  • To get only some sensor data: Include the SensorData element and specify filter criteria (SensorID list, Type list, etc.).
  • +
+
+
+ + + + List of SensorID values to include in the metadata stream. If not specified or empty, all sensor IDs are included (unless other filters exclude them). + + + + + List of sensor Type values to include in the metadata stream. If not specified or empty, all sensor types are included (unless other filters exclude them). + + + + + +
+ Subcription handling in the same way as base notification subscription. @@ -1507,6 +1544,11 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO + + + Optional element indicating the sensor data filtering capabilities of the device. + + @@ -1587,6 +1629,23 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO + + + + + True if the device supports filtering sensor data by SensorID. + + + + + True if the device supports filtering sensor data by Type. + + + + + + +