video/Multi-dimensional-Sensor-Data#610
video/Multi-dimensional-Sensor-Data#610WANGXIAOMIN-HIK wants to merge 20 commits intodevelopmentfrom
Conversation
…roposal, supporting multi-dimensional sensor data as metadata, events, and MQTT reports. Main changes include: 1. **Metadata Stream Support for Sensor Data**: - Modified metadatastream.xsd, added SensorDataStream element and SensorData complex type to support XML representation of sensor data. - Defined core fields such as SensorType, SensorValue, and SensorUnit, along with necessary attributes and extension points. 2. **Sensor Event Topic Definitions**: - Added sensor event topics in Core.xml, defining event topics related to temperature and humidity sensors. - Added standard structure descriptions for sensor event messages. - Provided XML and JSON examples for sensor events. 3. **MQTT Sensor Data Publication**: - Added sensor data MQTT topics and JSON payload definitions in Analytics.xml. - Added SensorDataFilter element in event.wsdl to control sensor data topics published via MQTT. 4. **Sensor Capability Descriptions**: - Added sensor data related capability description fields in analytics.wsdl, such as SensorDataSupport, SensorTypesSupported, and SensorMQTTSupport. This PR provides detailed examples for temperature and humidity sensors, laying the foundation for future extensions to other types of sensors. ```
…tSupportedMetadata
…ich are part of Metadata
doc/Core.xml
Outdated
|
|
||
| <programlisting><![CDATA[Topic: tns1:Device/Sensor/temperature/High | ||
| Event description: | ||
| <tt:MessageDescription IsProperty="true"> |
There was a problem hiding this comment.
is the events(i.e tns1:Device/Sensor/temperature/High, tns1:Device/Sensor/temperature/Low, tns1:Device/Sensor/humidity/High, tns1:Device/Sensor/humidity/Low) are property events? which parameter in the event schema holds true/false values if it is property event?
There was a problem hiding this comment.
Thank you for the expert question! Regarding the sensor event types, we have indeed modified sensor events from property events to regular events.
Modification Rationale:
Sensor threshold trigger events (such as temperature/humidity High/Low) are essentially one-time trigger events that are reported only when sensor values exceed or fall below set thresholds. These events are more appropriately defined as regular events because:
- They are not continuous property changes
- They only occur when thresholds are triggered, with clear trigger timing
- If upper-layer applications need continuous sensor data, they can obtain it through Metadata integration
Technical Implementation:
- Changed
IsProperty="true"toIsProperty="false"
wsdl/ver10/schema/metadatastream.xsd
Outdated
| <xs:sequence> | ||
| <xs:element name="SensorType" type="xs:string" minOccurs="1" maxOccurs="1"/> | ||
| <xs:element name="SensorValue" type="xs:float" minOccurs="1" maxOccurs="1"/> | ||
| <xs:element name="SensorUnit" type="xs:string" minOccurs="0" maxOccurs="1"/> |
There was a problem hiding this comment.
any specific reason Sensor Unit is optional parameter?
There was a problem hiding this comment.
Thank you for the expert question! Regarding the sensor unit parameter, we have modified it from an optional parameter to a required parameter.
Modification Rationale:
Sensor units are essential parameters for upper-layer application business logic because:
- Different sensors may use different units (e.g., temperature: °C/°F, humidity: %RH)
- Upper-layer applications need unit information to correctly parse and display sensor data
- Avoids data parsing errors caused by missing units
Technical Implementation:
- Changed
minOccurs="0"tominOccurs="1", making SensorUnit a required parameter
- Changed `IsProperty="true"` to `IsProperty="false"` - Changed `minOccurs="0"` to `minOccurs="1"`, making SensorUnit a required parameter
kieran242
left a comment
There was a problem hiding this comment.
I read over the PR and like the ideas and have raised a couple of questions for clarity?
doc/Core.xml
Outdated
| </listitem> | ||
| </itemizedlist> | ||
|
|
||
| <para>The following event should be generated with true value when a temperature sensor detects a value exceeding the configured high threshold.</para> |
There was a problem hiding this comment.
@WANGXIAOMIN-HIK You state "event should be generated with true value when a temperature sensor detects a value exceeding the configured high threshold." where has this high threshold value been defined on a Sensor?
Are all these sensors attached to a camera device or external to the device relaying the Metadata? i,e. is a Camera or NVR taking metadata from multiple device sources externally and raising metadata events like a relay or performing a triggered action based on the Metadata?
There was a problem hiding this comment.
Thank you for your thorough review and valuable questions!
1: Your Question: "where has this high threshold value been defined on a Sensor?"
Our Answer:
Your question about sensor threshold definition is very critical. Indeed, sensor events need to be triggered based on certain thresholds. In current implementations, these thresholds are typically configured through the following methods:
- Device Application Hardcoding: Threshold values are hardcoded in device applications
- Vendor Proprietary Protocols: Configuration through device vendor's proprietary protocols
- Device Web Interface: Manual configuration through device's web management interface
We recognize the importance of clearly defining sensor event threshold configuration in the ONVIF standard. In the future, we will add related sensor event threshold configuration interfaces and mechanisms to the ONVIF standard to improve interoperability and configuration standardization, ensuring unified sensor threshold management across devices from different vendors.
2: Your Question: "Are all these sensors attached to a camera device or external to the device relaying the Metadata? i,e. is a Camera or NVR taking metadata from multiple device sources externally and raising metadata events like a relay or performing a triggered action based on the Metadata?"
Our Answer:
Our design supports multiple sensor integration modes. ONVIF devices (such as Camera or NVR) can support multiple external sensors connected via direct connection:
- Gateway Mode: ONVIF devices primarily act as gateway roles, directly forwarding data received from external sensors as metadata to upper-layer applications
- Event Trigger Mode: ONVIF devices can also report sensor data as ONVIF events when preset thresholds are reached, implementing triggered actions based on sensor data.
doc/Core.xml
Outdated
| <para>tns1:Device/Sensor/[SensorType] - Generic sensor event topic</para> | ||
| </listitem> | ||
| <listitem> | ||
| <para>tns1:Device/Sensor/temperature/High - Temperature too high event</para> |
There was a problem hiding this comment.
I believe all topics should be Pascal cased so topics are standard. So it would be better to change them to
tns1:Device/Sensor/Temperature/High
There was a problem hiding this comment.
Thank you for the expert question!
We made the following changes.
- Topic Naming Convention Adjustment
Modification: Standardized Topic naming convention by capitalizing the first letter
tns1:Device/Sensor/temperature/High→tns1:Device/Sensor/Temperature/Hightns1:Device/Sensor/temperature/Low→tns1:Device/Sensor/Temperature/Lowtns1:Device/Sensor/humidity/High→tns1:Device/Sensor/Humidity/Hightns1:Device/Sensor/humidity/Low→tns1:Device/Sensor/Humidity/Low
2. MetadataStream Structure Optimization 3. Naming Simplification 4. Unit Description Enhancement
|
We would like to express our sincere gratitude to all the experts who provided valuable feedback and suggestions during the ONVIF Canada conference. Based on the discussions held during the conference, we have implemented the following four key modifications to the ONVIF sensor data standard: 1. Topic Naming Convention AdjustmentModification: Standardized Topic naming convention by capitalizing the first letter
Modified Files: Core.xml (event topic list, MessageDescription examples, MQTT examples) 2. MetadataStream Structure OptimizationModification: Moved SensorDataStream from Extension2 to be at the same level as VideoAnalytics, PTZ, and Event, elevating its importance in the metadata stream
Modified Files: metadatastream.xsd 3. Naming SimplificationModification: Simplified sensor data related naming to improve readability and consistency
Modified Files:
4. Unit Description EnhancementModification: Added clarification for absolute temperature and absolute humidity to eliminate ambiguity
|
…tion about temperature and humidity units.
Temperature unit: Kelvin absolute humidity unit: g/m³ relative humidity unit: %
kieran242
left a comment
There was a problem hiding this comment.
@WANGXIAOMIN-HIK I will be happy to approve this
…and update element definitions
kieran242
left a comment
There was a problem hiding this comment.
@WANGXIAOMIN-HIK I have re-reviewed all your latest changes and still happy to approve.
…roposal, supporting multi-dimensional sensor data as metadata, events, and MQTT reports. Main changes include:
Metadata Stream Support for Sensor Data:
Sensor Event Topic Definitions:
MQTT Sensor Data Publication:
Sensor Capability Descriptions:
This PR provides detailed examples for temperature and humidity sensors, laying the foundation for future extensions to other types of sensors.