EC600U_esp32_iap_uart/qcloud-iot/tools/example_config.json

208 lines
5.8 KiB
JSON
Raw Normal View History

2024-02-05 17:39:56 +08:00
{
"version":"1.0",
"profile":{
"ProductId":"G5OV4CREFI",
"CategoryId":"3"
},
"properties":[
{
"id":"power_switch",
"name":"电灯开关",
"desc":"控制电灯开灭",
"required":true,
"mode":"rw",
"define":{
"type":"bool",
"mapping":{
"0":"关",
"1":"开"
}
}
},
{
"id":"color",
"name":"颜色",
"desc":"灯光颜色",
"mode":"rw",
"define":{
"type":"enum",
"mapping":{
"0":"Red",
"1":"Green",
"2":"Blue"
}
}
},
{
"id":"brightness",
"name":"亮度",
"desc":"灯光亮度",
"mode":"rw",
"define":{
"type":"int",
"unit":"%",
"step":"1",
"min":"0",
"max":"100",
"start":"1"
}
},
{
"id":"name",
"name":"灯位置名称",
"desc":"灯位置名称:书房、客厅等",
"mode":"rw",
"required":true,
"define":{
"type":"string",
"min":"0",
"max":"64"
}
}
],
"events":[
{
"id":"status_report",
"name":"DeviceStatus",
"desc":"Report the device status",
"type":"info",
"required":true,
"params":[
{
"id":"status",
"name":"running_state",
"desc":"Report current device running state",
"define":{
"type":"bool",
"mapping":{
"0":"normal",
"1":"fault"
}
}
},
{
"id":"message",
"name":"Message",
"desc":"Some extra message",
"define":{
"type":"string",
"min":"0",
"max":"64"
}
}
]
},
{
"id":"low_voltage",
"name":"LowVoltage",
"desc":"Alert for device voltage is low",
"type":"alert",
"required":false,
"params":[
{
"id":"voltage",
"name":"Voltage",
"desc":"Current voltage",
"define":{
"type":"float",
"unit":"V",
"step":"1",
"min":"0.0",
"max":"24.0",
"start":"1"
}
}
]
},
{
"id":"hardware_fault",
"name":"Hardware_fault",
"desc":"Report hardware fault",
"type":"fault",
"required":false,
"params":[
{
"id":"name",
"name":"Name",
"desc":"Name like: memory,tf card, censors ...",
"define":{
"type":"string",
"min":"0",
"max":"64"
}
},
{
"id":"error_code",
"name":"Error_Code",
"desc":"Error code for fault",
"define":{
"type":"int",
"unit":"",
"step":"1",
"min":"0",
"max":"2000",
"start":"1"
}
}
]
}
],
"actions":[
{
"id":"light_blink",
"name":"light_blink",
"desc":"根据time和color实现灯的闪烁",
"input":[
{
"id":"time",
"name":"time",
"define":{
"type":"int",
"min":"0",
"max":"10",
"start":"0",
"step":"1",
"unit":"秒"
}
},
{
"id":"color",
"name":"color",
"define":{
"type":"bool",
"mapping":{
"0":"red",
"1":"green"
}
}
},
{
"id":"total_time",
"name":"total_time",
"define":{
"type":"int",
"min":"0",
"max":"100",
"start":"0",
"step":"1",
"unit":"秒"
}
}
],
"output":[
{
"id":"err_code",
"name":"code",
"define":{
"type":"int",
"mapping":{
"0":"ok",
"1":"failed"
}
}
}
],
"required":false
}
]
}