文档首页 > > 开发指南> 产品开发> 开发产品模型> 参考信息> 产品模型样例

产品模型样例

更新时间: 2019/06/25 GMT+08:00

附录一 WaterMeter Profile样例

样例由六个文件构成,文件名和文件内容如下。

  1. devicetype-capability.json
    {
        "devices": [
            {
                "manufacturerId": "TestUtf8ManuId",
                "manufacturerName": "HZYB",
                "model":  "NBIoTDevice",
                "protocolType": "CoAP",
                "deviceType": "WaterMeter",
                "serviceTypeCapabilities": [
                    {
                        "serviceId": "WaterMeterBasic",
                        "serviceType": "WaterMeterBasic",
                        "option": "Mandatory"
                    },
                    {
                        "serviceId": "WaterMeterAlarm",
                        "serviceType": "WaterMeterAlarm",
                        "option": "Mandatory"
                    },
                    {
                        "serviceId": "Battery",
                        "serviceType": "Battery",
                        "option": "Optional"
                    },
                    {
                        "serviceId": "DeliverySchedule",
                        "serviceType": "DeliverySchedule",
                        "option": "Mandatory"
                    },
                    {
                        "serviceId": "Connectivity",
                        "serviceType": "Connectivity",
                        "option": "Mandatory"
                    }
                ]
            }
        ]
    }

  2. servicetype-capability.jsonBattery
    {
        "services": [
            {
                "serviceType": "Battery",
                "description": "Battery",
                "commands": null,
                "properties": [
                    {
                        "propertyName": "batteryLevel",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 100,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": "%",
                        "enumList": null
                    },
                    {
                        "propertyName": "batteryThreshold",
                        "dataType": "int",
                        "required": false,
                        "min": 0,
                        "max": 100,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": "%",
                        "enumList": null
                    },
                    {
                        "propertyName": "batteryStatus",
                        "dataType": "int",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": [
                            0,
                            1,
                            2,
                            3,
                            4,
                            5,
                            6
                        ]
                    }
                ]
            }
        ]
    }

  3. servicetype-capability.jsonConnectivityMonitoring
    {
        "services": [
            {
                "serviceType": "Connectivity",
                "description": "Connectivity",
                "commands": null,
                "properties": [
                    {
                        "propertyName": "signalStrength",
                        "dataType": "int",
                        "required": true,
                        "min": -110,
                        "max": -48,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": "dbm",
                        "enumList": null
                    },
                    {
                        "propertyName": "linkQuality",
                        "dataType": "int",
                        "required": false,
                        "min": -110,
                        "max": -48,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": "dbm",
                        "enumList": null
                    },
                    {
                        "propertyName": "cellId",
                        "dataType": "int",
                        "required": false,
                        "min": 0,
                        "max": 268435455,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    }
                ]
            }
        ]
    }
  4. servicetype-capability.jsonDeliverySchedule
    {
        "services": [
            {
                "serviceType": "DeliverySchedule",
                "description": "DeliverySchedule",
                "commands": null,
                "properties": [
                    {
                        "propertyName": "startTime",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RW",
                        "unit": "sec",
                        "enumList": null
                    },
                    {
                        "propertyName": "UTCOffset",
                        "dataType": "string",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RW",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "frequency",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RW",
                        "unit": "sec",
                        "enumList": null
                    },
                    {
                        "propertyName": "randomisedDeliveryWindow",
                        "dataType": "int",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RW",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "retries",
                        "dataType": "int",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RW",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "retryPeriod",
                        "dataType": "int",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RW",
                        "unit": null,
                        "enumList": null
                    }
                ]
            }
        ]
    }
  5. servicetype-capability.jsonWaterMeterAlarm
    {
        "services": [
            {
                "serviceType": "WaterMeterAlarm",
                "description": "WaterMeterAlarm",
                "commands": null,
                "properties": [
                    {
                        "propertyName": "lowFlowAlarm",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "highFlowAlarm",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "tamperAlarm",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "lowBatteryAlarm",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "batteryRunOutAlarm",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "highInternalTemperature",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "reverseFlowAlarm",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "highPressureAlarm",
                        "dataType": "int",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "lowPressureAlarm",
                        "dataType": "int",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "highTemperatureAlarm",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "lowTemperatureAlarm",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "innerErrorAlarm",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "storageFault",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "waterTempratureSensorFault",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "innerTempratureSensorFault",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "pressureSensorFault",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "vibrationSensorFault",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "strayCurrent",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "RE",
                        "unit": null,
                        "enumList": null
                    }
                ]
            }
        ]
    }
  6. servicetype-capability.jsonWaterMeterBasic
    {
        "services": [
            {
                "serviceType": "WaterMeterBasic",
                "description": "WaterMeterBasic",
                "commands": null,
                "properties": [
                    {
                        "propertyName": "registerFlow",
                        "dataType": "int",
                        "required": true,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "R",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "currentReading",
                        "dataType": "string",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "W",
                        "unit": "L",
                        "enumList": null
                    },
                    {
                        "propertyName": "timeOfReading",
                        "dataType": "string",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "W",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "internalTemperature",
                        "dataType": "int",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "W",
                        "unit": "0.01°C",
                        "enumList": null
                    },
                    {
                        "propertyName": "dailyFlow",
                        "dataType": "int",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "W",
                        "unit": "L",
                        "enumList": null
                    },
                    {
                        "propertyName": "dailyReverseFlow",
                        "dataType": "int",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "W",
                        "unit": "L",
                        "enumList": null
                    },
                    {
                        "propertyName": "peakFlowRate",
                        "dataType": "int",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "W",
                        "unit": "L/H",
                        "enumList": null
                    },
                    {
                        "propertyName": "peakFlowRateTime",
                        "dataType": "string",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "W",
                        "unit": null,
                        "enumList": null
                    },
                    {
                        "propertyName": "intervalFlow",
                        "dataType": "array",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "W",
                        "unit": "L",
                        "enumList": null
                    },
                    {
                        "propertyName": "pressure",
                        "dataType": "array",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "W",
                        "unit": "kPa",
                        "enumList": null
                    },
                    {
                        "propertyName": "temperature",
                        "dataType": "array",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "W",
                        "unit": "0.01°C",
                        "enumList": null
                    },
                    {
                        "propertyName": "vibration",
                        "dataType": "array",
                        "required": false,
                        "min": 0,
                        "max": 0,
                        "step": 1,
                        "maxLength": 0,
                        "method": "W",
                        "unit": "0.01g",
                        "enumList": null
                    }
                ]
            }
        ]
    }

文档是否有解决您的问题?

提交成功!

非常感谢您的反馈,我们会继续努力做到更好!

反馈提交失败,请稍后再试!

在文档使用中是否遇到以下问题







请至少选择或填写一项反馈信息

字符长度不能超过200

反馈内容不能为空!

提交反馈 取消