Koenkk / zigbee-herdsman-converters

Collection of device converters to be used with zigbee-herdsman
MIT License
886 stars 2.96k forks source link

Add new device ZG2819S-RGBW #7659

Closed chris-1243 closed 3 months ago

chris-1243 commented 3 months ago

Add new device ZG2819S-RGBW

Koenkk commented 3 months ago

This device is already supported

https://github.com/Koenkk/zigbee-herdsman-converters/blob/f9c6313e517b4d805a75940cb608f98a57338a42/src/devices/iluminize.ts#L161

chris-1243 commented 3 months ago

Well and in my opinion, we should modify the iluminze.ts file as the model should not be ZG2819S-RGBW but 511.344. My model is from Sunricher. It would be great to have it recognized correctly.

As you can see, this remote is also supported as a RGB Genie ZB-5028.

On the other hand, the CCT model is well defined as:

Why not keeping this difference and used my converter ?

I have no problem at doing some PR in this way

Koenkk commented 3 months ago

You cannot distinguish these devices as the model ID is exactly the same, doesn't the device already work out of the box with the latest z2m?

chris-1243 commented 3 months ago

It works but in the expose tab you have tons of useless information which are not reported by the device. My external converter was following the way the Sunricher CCT model works and what kind of information is reported.

To be honest, I did not want to remove code lines in the iluminize.ts file while submitting my PR. I thought those two devices were different.

As it is your project, I let you decide what is the best for it

511 344_expose

chris-1243 commented 3 months ago

my modernextend converter is missing scenes... sorry

EDIT finally is working, I had to use the latest-dev branch

const {deviceEndpoints, battery, identify, commandsOnOff, commandsLevelCtrl, commandsColorCtrl, commandsScenes} = require('zigbee-herdsman-converters/lib/modernExtend');

const definition = {
    zigbeeModel: ['ZG2819S-RGBW'],
    model: 'ZG2819S-RGBW',
    vendor: 'Sunricher',
    description: 'Zigbee handheld remote RGBW 4 channels',
    extend: [
        deviceEndpoints({"endpoints":{"ep1":1,"ep2":2,"ep3":3,"ep4":4}}),
        battery(),
        identify(),
        commandsOnOff(),
        commandsLevelCtrl(),
        commandsColorCtrl(),
        commandsScenes()
    ],
    meta: {"multiEndpoint":true},
};

module.exports = definition;