123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- {
- "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
- }
- ]
- }
|