GLEDOPTO have a new ["5 in 1" Zigbee LED Controller](https://www.gledopto.com/h-…col-388.html), which can change modes between RGBCCT, RGBW, RGB, CCT and just dimming by physically pressing a button on the controller. Although the device itself has a model number of `GL-C-001P` printed on it, it identifies itself as a `GL-C-003P` in zigbee2mqtt.
I've been able to add a new local device definition for this, and it is working for me in RGBCCT mode. However, i'm a little unsure how to contribute this back with full support for detecting which mode it is in. GLEDOPTO's support have said that the model will vary depending on the current mode, however i've not been able to see this happen unless I add a basic device definition. Without one, regardless of mode the modelID in the database under the genBasic endpoint's attributes is always `GL-C-007P`. After adding the following basic device definition, the genBasic modelID does get updated when changing the mode, although this does force a re-pair. To see this model change in the database file, I have to go and run a query for genBasic modelID, then send a configure request.
```
const definition = {
zigbeeModel: ['GL-C-003P'], // The model ID from: Device with modelID 'lumi.sens' is not supported.
model: 'GL-C-003P', // Vendor model number, look on the device for a model number
vendor: 'Gledopto', // Vendor of the device (only used for documentation and startup logging)
description: 'Zigbee 5 in 1 Smart LED Controller', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
extend: extend.light_onoff_brightness_colortemp_color(),
};
```
GLEDOPTO support said the mapping is as follows;
> GL-C-001P is the model of the controller and this controller can realize the five types of RGBCCT\RGBW\RGB\CCT\DIMMER.
> Each type of lamp searched for is different. Corresponding to GL-C-008P\GL-C-007P\GL-C-003P \GL-C-006P\GL-C-009P
Which would map to;
* RGBCCT: GL-C-008P
* RGBC: GL-C-007P
* RGB: GL-C-003P
* CCT: GL-C-006P
* Dimmer: GL-C-009P
Any ideas on how best to add support for this? I think I need to use the fingerprint functionality, but all the existing examples match on endpoints. Would it be possible to match on the genBasic modelID instead?
Sample database entry, captured in RGBCCT mode;
```
{
"id": 12,
"type": "Router",
"ieeeAddr": "0xcc86ecfffebfb226",
"nwkAddr": 15450,
"manufId": 4687,
"manufName": "GLEDOPTO",
"powerSource": "Mains (single phase)",
"modelId": "GL-C-003P",
"epList": [
1,
242
],
"endpoints": {
"1": {
"profId": 260,
"epId": 1,
"devId": 258,
"inClusterList": [
0,
3,
4,
5,
6,
8,
768,
4096
],
"outClusterList": [
25
],
"clusters": {
"genBasic": {
"attributes": {
"modelId": "GL-C-008P",
"manufacturerName": "GLEDOPTO",
"powerSource": 0,
"zclVersion": 3,
"appVersion": 0,
"stackVersion": 0,
"hwVersion": 0,
"dateCode": "",
"swBuildId": "10276801"
}
},
"lightingColorCtrl": {
"attributes": {
"colorCapabilities": 31,
"colorTempPhysicalMin": 158,
"colorTempPhysicalMax": 495,
"colorMode": 1,
"currentX": 22378,
"currentY": 11189,
"enhancedCurrentHue": 0,
"currentSaturation": 0,
"colorTemperature": 158
}
}
},
"binds": [],
"configuredReportings": [],
"meta": {}
},
"242": {
"profId": 41440,
"epId": 242,
"devId": 97,
"inClusterList": [],
"outClusterList": [
33
],
"clusters": {},
"binds": [],
"configuredReportings": [],
"meta": {}
}
},
"appVersion": 0,
"stackVersion": 0,
"hwVersion": 0,
"dateCode": "",
"swBuildId": "10276801",
"zclVersion": 3,
"interviewCompleted": true,
"meta": {
"configured": 2
},
"lastSeen": 1631359856262
}
```
Dimmer mode (but with the same device definition above, which may explain the presence of `lightingColourCtrl` attributes?);
```
{
"id": 12,
"type": "Router",
"ieeeAddr": "0xcc86ecfffebfb226",
"nwkAddr": 44722,
"manufId": 4687,
"manufName": "GLEDOPTO",
"powerSource": "Mains (single phase)",
"modelId": "GL-C-003P",
"epList": [
1,
242
],
"endpoints": {
"1": {
"profId": 260,
"epId": 1,
"devId": 258,
"inClusterList": [
0,
3,
4,
5,
6,
8,
768,
4096
],
"outClusterList": [
25
],
"clusters": {
"genBasic": {
"attributes": {
"modelId": "GL-C-009P",
"manufacturerName": "GLEDOPTO",
"powerSource": 0,
"zclVersion": 3,
"appVersion": 0,
"stackVersion": 0,
"hwVersion": 0,
"dateCode": "",
"swBuildId": "10276801"
}
},
"lightingColorCtrl": {
"attributes": {
"colorCapabilities": 0,
"colorTempPhysicalMin": 158,
"colorTempPhysicalMax": 495,
"colorMode": 1,
"currentX": 22378,
"currentY": 11189,
"enhancedCurrentHue": 0,
"currentSaturation": 0,
"colorTemperature": 158
}
}
},
"binds": [],
"configuredReportings": [],
"meta": {}
},
"242": {
"profId": 41440,
"epId": 242,
"devId": 97,
"inClusterList": [],
"outClusterList": [
33
],
"clusters": {},
"binds": [],
"configuredReportings": [],
"meta": {}
}
},
"appVersion": 0,
"stackVersion": 0,
"hwVersion": 0,
"dateCode": "",
"swBuildId": "10276801",
"zclVersion": 3,
"interviewCompleted": true,
"meta": {
"configured": 2
},
"lastSeen": 1631360220867
}
```