《IoT物联网技术》
2019-07-30
3823浏览量
开通阿里云账号,并通过支付宝实名认证 https://www.aliyun.com
产品官网 https://www.aliyun.com/product/iot
高级版,JSON格式
点击获取 完整物模型TSL,可以在控制台导入,需要替换productKey
2.2 产品功能定义
添加产品属性
温度 temperature,湿度 humidity
在产品下注册设备,获得身份三元组
先点击 订阅主题,再去控制台推送消息。
{
"schema": "https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json",
"profile": {
"productKey": "替换为你的productKey"
},
"services": [
{
"outputData": [],
"identifier": "set",
"inputData": [
{
"identifier": "temperature",
"dataType": {
"specs": {
"unit": "°C",
"min": "0",
"max": "1000",
"step": "0.1"
},
"type": "float"
},
"name": "温度"
},
{
"identifier": "humidity",
"dataType": {
"specs": {
"unit": "%RH",
"min": "0",
"max": "100",
"step": "0.1"
},
"type": "float"
},
"name": "湿度"
}
],
"method": "thing.service.property.set",
"name": "set",
"required": true,
"callType": "async",
"desc": "属性设置"
},
{
"outputData": [
{
"identifier": "temperature",
"dataType": {
"specs": {
"unit": "°C",
"min": "0",
"max": "1000",
"step": "0.1"
},
"type": "float"
},
"name": "温度"
},
{
"identifier": "humidity",
"dataType": {
"specs": {
"unit": "%RH",
"min": "0",
"max": "100",
"step": "0.1"
},
"type": "float"
},
"name": "湿度"
}
],
"identifier": "get",
"inputData": [
"temperature",
"humidity"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获取"
}
],
"properties": [
{
"identifier": "temperature",
"dataType": {
"specs": {
"unit": "°C",
"min": "0",
"max": "1000",
"step": "0.1"
},
"type": "float"
},
"name": "温度",
"accessMode": "rw",
"required": false
},
{
"identifier": "humidity",
"dataType": {
"specs": {
"unit": "%RH",
"min": "0",
"max": "100",
"step": "0.1"
},
"type": "float"
},
"name": "湿度",
"accessMode": "rw",
"required": false
}
],
"events": [
{
"outputData": [
{
"identifier": "temperature",
"dataType": {
"specs": {
"unit": "°C",
"min": "0",
"max": "1000",
"step": "0.1"
},
"type": "float"
},
"name": "温度"
},
{
"identifier": "humidity",
"dataType": {
"specs": {
"unit": "%RH",
"min": "0",
"max": "100",
"step": "0.1"
},
"type": "float"
},
"name": "湿度"
}
],
"identifier": "post",
"method": "thing.event.property.post",
"name": "post",
"type": "info",
"required": true,
"desc": "属性上报"
}
]
}
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
致力于实现万物互联的美好世界,为生态合作伙伴提供基于云计算、大数据、人工智能、云端一体化、安全的物联网基础平台和内容服务平台。