New Device - RGBGenie controller - multiple endpoints

Hi all, I’m trying to add support for a new device.

As per the steps here: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html#how-to-support-new-devices I have the device showing up, and debug is showing messages.

I’m playing with writing a converter to make it useful, but each command has an endpoint id sent with the command. This is nice because it makes it 4 remotes in one.

How do I access this endpoint id in converter?

Log example of hitting “1”, brightness-up, “2”, brightness-up:

Zigbee2MQTT:debug 2020-12-08 20:03:30: Received Zigbee message from '0x000d6f0013e9911c', type 'commandStepWithOnOff', cluster 'genLevelCtrl', data '{"stepmode":0,"stepsize":32,"transtime":0}' from endpoint 1 with groupID 37633
Zigbee2MQTT:debug 2020-12-08 20:03:30: No converter available for 'RGBgenie ZB-5028' with cluster 'genLevelCtrl' and type 'commandStepWithOnOff' and data '{"stepmode":0,"stepsize":32,"transtime":0}'
Zigbee2MQTT:debug 2020-12-08 20:03:33: Received Zigbee message from '0x000d6f0013e9911c', type 'commandStepWithOnOff', cluster 'genLevelCtrl', data '{"stepmode":0,"stepsize":32,"transtime":0}' from endpoint 2 with groupID 37634
Zigbee2MQTT:debug 2020-12-08 20:03:33: No converter available for 'RGBgenie ZB-5028' with cluster 'genLevelCtrl' and type 'commandStepWithOnOff' and data '{"stepmode":0,"stepsize":32,"transtime":0}'

Note that it’s not actually in the data itself.

Thanks

Reading through the source code of lib/controller.js

line 226:

if (type === 'message') {
        logger.debug(
            `Received Zigbee message from '${name}', type '${data.type}', cluster '${data.cluster}'` +
            `, data '${stringify(data.data)}' from endpoint ${data.endpoint.ID}` +
            (data.hasOwnProperty('groupID') ? ` with groupID ${data.groupID}` : ``),
        );

So groupID is a part of the data cluster, and

lib/extension/receive.js line 159:

  const converted = converter.convert(
                resolvedEntity.definition, data, publish, resolvedEntity.settings, meta,
            );

So looks like the entire data piece is sent to convert. Meaning data.endpoint.ID will be there :slight_smile:

I’ll give it a try tonight.

The examples only deal with the data.data[] collection, so I wasn’t sure what all was there.