1. RS485 Integration
1.1. Usage
Refer to the JSON configuration file content below, name the configuration file smart_bus.json, and then save it to the device using the method described below. For editing JSON, we recommend either the online website
http://www.kjson.com/jsoneditor/or the Visual Studio Code application to edit the JSON file, and make sure the JSON file format is correct.
Note: Both the format and the content must be correct, otherwise the device will not be able to boot.If the device cannot boot after the 485 configuration file is imported, the JSON content of that configuration file is abnormal. Connect the screen with the USB cable, enter the USB drive and delete the 485 configuration file first, then take the su2.sh file and copy it from the computer into the mounted disk, and then restart the device. Click to download the su2.sh file
- Connect the device to the computer over USB and copy the file to the root directory of the device. Then go to the device desktop > Settings > Smart Home > SmartBus Configuration > click the Import button.
1.2. Protocol Definition
1.2.1. Protocol Level-1 Field Definitions
{
"version": 1, # Protocol version number; must be 1 for this version
"protocol": "rs485", # The protocol is the rs485 protocol; for this protocol this field value must be rs485
"vendor": "Vendor name", # Vendor name, any name is allowed, and it will later be displayed in the UI
"description": "Simple RS485 protocol", # Protocol description
"baudrate": 9600, # Baud rate, 9600 by default
"codeFormat": 0, # 0: hexadecimal code 1: ASCII text
"supportRecv": 1, # 0: the host only sends codes 1: the host can also receive the same codes to update status
"devices": [] # Array of devices or scenes
}
1.2.2. Protocol Level-2 Field Definitions (Device or Scene)
{
"version": 1,
"protocol": "rs485",
"vendor": "simple",
"description": "Simple RS485 protocol. The host can send device codes for control, and device code status feedback is also supported (the sent code and the received code are identical)",
"baudrate": 9600,
"codeFormat": 0,
"supportRecv": 1,
"devices": [
{
"actions": [
{
"action": "TurnOn",
"instructions": [
{
"code": "0100000000000000",
"desc": "Turn on"
}
]
},
{
"action": "TurnOff",
"instructions": [
{
"code": "0100000000000001",
"desc": "Turn off"
}
]
},
{
"action": "SetBrightness",
"instructions": [
{
"value": "25",
"code": "010100000000025"
},
{
"value": "50",
"code": "0101000000000050"
},
{
"value": "75",
"code": "0101000000000075"
},
{
"value": "100",
"code": "0101000000000100"
}
]
},
{
"action": "SetColorTemperature",
"instructions": [
{
"value": "25",
"code": "010200000000025"
},
{
"value": "50",
"code": "0102000000000050"
},
{
"value": "75",
"code": "0102000000000075"
},
{
"value": "100",
"code": "0102000000000100"
}
]
}
],
"brand": "Brand",
"deviceId": "1",
"deviceName": "Main light",
"deviceType": "light",
"icon": "",
"model": "Model",
"zone": "Living room"
},
{
"actions": [
{
"action": "TurnOn",
"instructions": [
{
"code": "0200000000000000",
"desc": "Turn on"
}
]
},
{
"action": "TurnOff",
"instructions": [
{
"code": "0200000000000001",
"desc": "Turn off"
}
]
}
],
"brand": "Brand",
"deviceId": "2",
"deviceName": "Living room light",
"deviceType": "light",
"icon": "",
"model": "Model",
"zone": "Living room"
},
{
"actions": [
{
"action": "TurnOn",
"instructions": [
{
"code": "0300000000000000",
"desc": "Turn on"
}
]
},
{
"action": "TurnOff",
"instructions": [
{
"code": "0300000000000001",
"desc": "Turn off"
}
]
}
],
"brand": "Brand",
"deviceId": "3",
"deviceName": "Switch",
"deviceType": "switch",
"icon": "",
"model": "Model",
"zone": "Living room"
},
{
"actions": [
{
"action": "TurnOn",
"instructions": [
{
"code": "0400000000000000",
"desc": "Turn on"
}
]
},
{
"action": "TurnOff",
"instructions": [
{
"code": "0400000000000001",
"desc": "Turn off"
}
]
}
],
"brand": "Brand",
"deviceId": "4",
"deviceName": "Main light",
"deviceType": "light",
"icon": "",
"model": "Model",
"zone": "Master bedroom"
},
{
"actions": [
{
"action": "TurnOn",
"instructions": [
{
"code": "2000000000000000",
"desc": "Turn on"
}
]
},
{
"action": "TurnOff",
"instructions": [
{
"code": "2000000000000001",
"desc": "Turn off"
}
]
},
{
"action": "Pause",
"instructions": [
{
"code": "2000000000000002",
"desc": "Pause"
}
]
}
],
"brand": "Brand",
"deviceId": "20",
"deviceName": "Curtain",
"deviceType": "curtain",
"icon": "",
"model": "Model",
"zone": "Living room"
},
{
"actions": [
{
"action": "TurnOn",
"instructions": [
{
"code": "0A00000000000000",
"desc": "Turn on"
}
]
},
{
"action": "TurnOff",
"instructions": [
{
"code": "0A00000000000001",
"desc": "Turn off"
}
]
},
{
"action": "SetTemperature",
"instructions": [
{
"value": "20",
"code": "0A00000000000020"
},
{
"value": "21",
"code": "0A00000000000021"
},
{
"value": "22",
"code": "0A00000000000022"
},
{
"value": "23",
"code": "0A00000000000023"
},
{
"value": "24",
"code": "0A00000000000024"
},
{
"value": "25",
"code": "0A00000000000025"
},
{
"value": "26",
"code": "0A00000000000026"
},
{
"value": "27",
"code": "0A00000000000027"
},
{
"value": "28",
"code": "0A00000000000028"
},
{
"value": "29",
"code": "0A00000000000029"
},
{
"value": "30",
"code": "0A00000000000030"
}
]
},
{
"action": "SetMode",
"instructions": [
{
"value": "auto",
"code": "0A00000000000040",
"desc": "Auto"
},
{
"value": "cold",
"code": "0A00000000000041",
"desc": "Cooling"
},
{
"value": "heat",
"code": "0A00000000000042",
"desc": "Heating"
},
{
"value": "airsupply",
"code": "0A00000000000043",
"desc": "Fan"
}
]
},
{
"action": "SetWindSpeed",
"instructions": [
{
"value": "auto",
"code": "0A00000000000010",
"desc": "Auto fan speed"
},
{
"value": "high",
"code": "0A00000000000011",
"desc": "High fan speed"
},
{
"value": "medium",
"code": "0A00000000000012",
"desc": "Medium fan speed"
},
{
"value": "low",
"code": "0A00000000000013",
"desc": "Low fan speed"
}
]
},
{
"action": "SetSwing",
"instructions": [
{
"value": "OpenUpAndDownSwing",
"code": "0A00000000000030",
"desc": "Up and down swing"
},
{
"value": "OpenLeftAndRightSwing",
"code": "0A00000000000031",
"desc": "Left and right swing"
},
{
"value": "CloseSwing",
"code": "0A00000000000032",
"desc": "Stop swing"
}
]
}
],
"brand": "Brand",
"deviceId": "10",
"deviceName": "Air conditioner",
"deviceType": "aircondition",
"icon": "",
"model": "Model",
"zone": "Living room"
},
{
"actions": [
{
"action": "TurnOn",
"instructions": [
{
"code": "F100000000000001",
"desc": "Turn on"
}
]
},
{
"action": "TurnOff",
"instructions": [
{
"code": "F100000000000002",
"desc": "Turn off"
}
]
},
{
"action": "AdjustUpChannel",
"instructions": [
{
"code": "F100000000000003",
"desc": ""
}
]
},
{
"action": "AdjustDownChannel",
"instructions": [
{
"code": "F100000000000004",
"desc": ""
}
]
},
{
"action": "AdjustUpVolume",
"instructions": [
{
"code": "F100000000000005",
"desc": ""
}
]
},
{
"action": "AdjustDownVolume",
"instructions": [
{
"code": "F100000000000006",
"desc": "Turn off"
}
]
},
{
"action": "Mute",
"instructions": [
{
"code": "F100000000000007",
"desc": "Turn off"
}
]
}
],
"brand": "Brand",
"deviceId": "F1",
"deviceName": "TV",
"deviceType": "tv",
"icon": "",
"model": "Model",
"zone": "Living room"
},
{
"actions": [
{
"action": "TurnOn",
"instructions": [
{
"code": "1100000000000000",
"desc": "Turn on"
}
]
}
],
"deviceId": "100",
"deviceName": "Wake up",
"deviceType": "smartscene",
"icon": ""
},
{
"actions": [
{
"action": "TurnOn",
"instructions": [
{
"code": "1100000000000001",
"desc": "Turn on"
}
]
}
],
"deviceId": "101",
"deviceName": "Sleep",
"deviceType": "smartscene",
"icon": ""
},
{
"actions": [
{
"action": "TurnOn",
"instructions": [
{
"code": "1100000000000002",
"desc": "Turn on"
}
]
}
],
"deviceId": "102",
"deviceName": "Hotel",
"deviceType": "smartscene",
"icon": ""
}
]
}
Device Type (deviceType)
| Device type | Device type definition |
|---|---|
| Light | light |
| Curtain | curtain |
| Air conditioner | aircondition |
| Outlet | outlet |
| Switch | switch |
| Air purifier | airpurifier |
| Fresh air unit | airfresh |
| Clothes drying rack | hanger |
| Power strip | sockets |
| Thermostat | temperature_ctrl |
| Scene | smartscene |
Command Actions (action)
| Action name | Action definition |
|---|---|
| Turn on | TurnOn |
| Turn off | TurnOff |
| Pause | Pause |
| Set mode | SetMode |
| Set temperature | SetTemperature |
| Set fan speed | SetWindSpeed |
| Set swing | SetSwing |
| Set left/right swing | SwitchHorizontal |
| Set up/down swing | SwitchVertical |
| Set brightness | SetBrightness |
| Set color temperature | SetColorTemperature |
| Set color | SetColor |
| Set progress | SetProgress |
| Lighting | SwitchLight |
| Sterilization | SwitchSterilize |
| Air drying | SwitchAirdry |
| Heat drying | SwitchDrying |