Lighting equipment interface
GVP provides query and control interfaces for lighting equipment functions. Third-party platforms are requested to use relevant interfaces according to their business needs.
1. Obtain individual or all lighting status data
Request interface example, 192.168.1.108 is the IP address of the computer where the GVP server is located. Please adjust according to the actual situation
http://192.168.1.108:8008/api/?HDLRequest=GetLampDeviceStatus
Request method: POST
Interface address: /api/?HDLRequest=GetLampDeviceStatus
Request data type: application/json
Response data type: application/json
Interface Description: Get the status data of a single or all lights
Headers parameter
| Key | Value | Description |
|---|---|---|
| Authorization | Token Value | The Token value obtained upon successful login. If it has expired, please log in again |
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| DeviceGuid | String | true | The GUID of the functional device. When the value is "all", all lights will be obtained; otherwise, only the single light device specified by the GUID will be obtained. |
Request example, but the string should be encrypted using an encryption method before submission
{"DeviceGuid":"all"}
Response parameters:
| Field | Type | Description |
|---|---|---|
| ReplyCode | String | Response code |
| ReplyMessage | String | Response message prompt |
| ReplyDataType | Integer | Response data type, can be ignored |
| ReplyObject | Array | Response data. For detailed information, refer to the example description |
Response example:
{
"ReplyCode": "Success",
"ReplyMessage": "Success",
"ReplyDataType": 0,
"ReplyObject": [
{
"LampStatus": 0,// Light status, 0 for off, 1 for on
"LampBrightness": 0, // Light brightness
"CCTValue": 4500, // This is the color temperature value specific to color temperature lamps
"LampDelayTime": 0,
"LampColor": null, // Color value specific to RGB lights, such as #FFFFFF
"AutoCloseLampCount": 0,
"DeviceGuid": "7e3966be-2900-4e13-a6cc-101a08132823", // Unique GUID of the lighting device
"DeviceName": "Ceiling recessed light strip at the main entrance",
"DeviceType": 257, // Device Type: 256 for dimming light, 257 for on/off light, 258 for color temperature light, 259 for RGB light, 262 for DALI dimmable light, 268 for relay with current detection
"VirtualZoneGuidList": "e8557096-ae0b-4c10-b224-4b6b00c43c8c", // GUID of the area where the lighting device is located
"DeviceOnlineState": 2, // Device status: 2 (faulty or offline), 1 (online)
"ProjectGuid": null,
"DeviceHoursLife": 0,
"DeviceProtocolStyle": 0,
"ProjectName": null,
"LastCountPowerDatetime": 0
}
],
"TotalRowCount": 0,
"AlarmCount": 0,
"PageCount": 0
}
2. Controlling a single light
Request interface example: 192.168.1.108 is the IP address of the computer where the GVP server is located. Please adjust according to the actual situation
http://192.168.1.108:8008/api/?HDLRequest=ControlLampDevice
Request method: POST
Interface address: /api/?HDLRequest=ControlLampDevice
Request data type: application/json
Response data type: application/json
Interface Description: Interface for controlling lighting devices, specifying the control of a single lighting device
Headers parameter
| Key | Value | Description |
|---|---|---|
| Authorization | Token Value | The Token value obtained upon successful login. If it has expired, please log in again |
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| DeviceGuid | String | true | Unique Guid of lighting device |
| LampActionType | String | true | Controls the action type of the light: TurnOn, TurnOff, Dimmer, RGB, CCT Note: TurnOn or TurnOff is applicable to all lighting devices for turning on or off; Dimmer is used for dimming. For this action type, if the light is turned off, it will be directly turned on and set to the corresponding brightness; similarly, RGB color control and CCT color temperature control also follow this principle, where the light is turned on first and then the corresponding value is set; |
| LampBrightness | int | true | Controls the brightness value of the light: 0-100; only valid when the light action is Dimmer, the default value for other action settings is 0 |
| LampColor | String | true | Color value when controlled by RGB, such as "#FF0000", pure red; only valid when the light action is RGB, the default value for other action settings is "#000000" |
| CCTValue | int | true | Range value for CCT color temperature lamp control, 2000~7000; only valid when the light action is CCT, default value for other action settings is 0 |
Request example, but the string must be encrypted using an encryption method before submission
{"DeviceGuid":"","LampActionType":"","LampBrightness":0,"LampColor":"","CCTValue":0}
Response parameters:
| Field | Type | Description |
|---|---|---|
| ReplyCode | String | Response code |
| ReplyMessage | String | Response message prompt |
| ReplyDataType | Integer | Response data type, can be ignored |
| ReplyObject | Array | Response data. For detailed information, refer to the example description |
Response success example:
{
"ReplyCode": "Success",
"ReplyMessage": "Success",
"ReplyDataType": 0,
"ReplyObject": {},
"TotalRowCount": 0,
"AlarmCount": 0,
"PageCount": 0
}
3. Query the current value of the light
Request interface example: 192.168.1.108 is the IP address of the computer where the GVP server is located. Please adjust according to the actual situation
http://192.168.1.108:8008/api/?HDLRequest=GetLampCurrent
Request method: POST
Interface address: /api/?HDLRequest=GetLampCurrent
Request data type: application/json
Response data type: application/json
Interface Description: Obtain the current value of the specified light
Headers parameter
| Key | Value | Description |
|---|---|---|
| Authorization | Token Value | The Token value obtained upon successful login. If it has expired, please log in again |
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| DeviceGuid | String | true | Gets the current value of a single lighting device with the specified GUID |
Request example, but the string needs to be encrypted using an encryption method before submission
{"DeviceGuid":""}
Response parameters:
| Field | Type | Description |
|---|---|---|
| ReplyCode | String | Response code |
| ReplyMessage | String | Response message prompt |
| ReplyDataType | Integer | Response data type, can be ignored |
| ReplyObject | Array | Response data. For detailed information, refer to the example description |
Response example:
{
"ReplyCode": "Success",
"ReplyMessage": "Success",
"ReplyDataType": 0,
"ReplyObject": {
"DeviceGuid": "c77f0ead-fc97-4085-bd64-e9594ad5b7b3", // Unique GUID of the lighting device
"DeviceName": "No.1 spotlight", // Light name
"DeviceType": 268, // Device type: 256 for dimming light, 257 for on/off light, 258 for color temperature light, 259 for RGB light, 262 for DALI dimmable light, 268 for relay with current detection
"DeviceOnlineState": 2, // Device status, 2 for fault, 1 for online
"LampStatus": 0, // Switch status, 0 for off, 1 for on
"LampBrightness": 0, // Brightness value
"LampCurrent": 0.0 // Current value, unit: A
},
"TotalRowCount": 0,
"AlarmCount": 0,
"PageCount": 0
}