四路单开关,支持四路继电器等设备。
JSON代码:
{
"info": {
"pluginName": "4路开关",
"pluginCategory": "2",
"author": "ThingsPanel",
"version": "0.1",
"description": "支持各种四路单开关"
},
"tsl": {
"properties": [
{
"dataType": "integer",
"dataRange": "0-999",
"stepLength": 0.1,
"readWrite": "rw",
"title": "开关1",
"name": "switch1"
},
{
"dataType": "integer",
"dataRange": "0-999",
"stepLength": 0.1,
"readWrite": "rw",
"title": "开关2",
"name": "switch2"
},
{
"dataType": "integer",
"dataRange": "0-999",
"stepLength": 0.1,
"readWrite": "rw",
"title": "开关3",
"name": "switch3"
},
{
"dataType": "integer",
"dataRange": "0-999",
"stepLength": 0.1,
"readWrite": "rw",
"title": "开关4",
"name": "switch4"
}
],
"option": {
"classify": "custom",
"catValue": "relay"
}
},
"chart": [
{
"componentName": "单控开关",
"type": "switch",
"series": [
{
"type": "switch",
"value": false,
"id": 1,
"mapping": {
"value": "switch1",
"on": "1",
"off": "0",
"attr": {
"dataType": "integer",
"dataRange": "0-999",
"stepLength": 0.1,
"readWrite": "rw",
"title": "开关1",
"name": "switch1"
}
}
}
],
"disabled": false,
"name": "开关1",
"controlType": "control",
"id": "t01cmeX6xBSn"
},
{
"componentName": "单控开关",
"type": "switch",
"series": [
{
"type": "switch",
"value": false,
"id": 1,
"mapping": {
"value": "switch2",
"on": "1",
"off": "0",
"attr": {
"dataType": "integer",
"dataRange": "0-999",
"stepLength": 0.1,
"readWrite": "rw",
"title": "开关2",
"name": "switch2"
}
}
}
],
"disabled": false,
"name": "开关2",
"controlType": "control",
"id": "LUYhYrbzsraF"
},
{
"componentName": "单控开关",
"type": "switch",
"series": [
{
"type": "switch",
"value": false,
"id": 1,
"mapping": {
"value": "switch3",
"on": "1",
"off": "0",
"attr": {
"dataType": "integer",
"dataRange": "0-999",
"stepLength": 0.1,
"readWrite": "rw",
"title": "开关3",
"name": "switch3"
}
}
}
],
"disabled": false,
"name": "开关3",
"controlType": "control",
"id": "BEb2gCV26LJg"
},
{
"componentName": "单控开关",
"type": "switch",
"series": [
{
"type": "switch",
"value": false,
"id": 1,
"mapping": {
"value": "switch4",
"on": "1",
"off": "0",
"attr": {
"dataType": "integer",
"dataRange": "0-999",
"stepLength": 0.1,
"readWrite": "rw",
"title": "开关4",
"name": "switch4"
}
}
}
],
"disabled": false,
"name": "开关4",
"controlType": "control",
"id": "aokvMdNAv9JB"
}
],
"publish": {
"isPus": true
}
}
同样的一个温湿度传感器,可能有上千个厂家,不同的规格型号,但是他们都是温湿度传感器。 温湿度传感器的输入是温度、湿度、时间。输出是当前温度、当前湿度、温度曲线、湿度曲线等图表单元或者报表。这些输入和输出的数量和彼此关系都是确定的。 因此,我们将温湿度传感器对应的软件部分也抽象成一个标准的温湿度传感器组件,这个组件包括了固定的数据输入和结果输出。并使之成为物联网大厦中的标准的砖块。
1. 选择一个设备插件, 复制JSON代码。
2. 在ThingsPanel物联网平台中,点击“应用管理”,点击“设备插件生成器”,点击“导入插件”,把刚才拷贝的设备插件JSON代码粘贴进去,点击确定,然后刷新页面,就可以在已安装列表里看到刚才导入的插件了。
3. 在ThingsPanel物联网平台中,点击“设备接入”,点击“设备管理”,在设备上点击“绑定插件”对话框,输入设备插件的名称,在检索出的插件列表中找到刚才导入的设备插件,点击选择就绑定成功了。