Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.08k stars 1.68k forks source link

[New device support]: EGLO RCU3 (the new eglo connect.z remote) ERCU_3groups_Zm #16890

Closed fsedarkalex closed 1 year ago

fsedarkalex commented 1 year ago

Link

https://www.eglo.com/uk/remote-control-connect-z-99099.html

Database entry

{"id":15,"type":"EndDevice","ieeeAddr":"---REDACTED---","nwkAddr":17945,"manufId":4417,"manufName":"AwoX","powerSource":"Battery","modelId":"ERCU_3groups_Zm","epList":[1,3],"endpoints":{"1":{"profId":260,"epId":1,"devId":2048,"inClusterList":[0,3,4,4096],"outClusterList":[0,3,4,5,6,8,768,4096],"clusters":{"genBasic":{"attributes":{"modelId":"ERCU_3groups_Zm","manufacturerName":"AwoX","powerSource":3,"zclVersion":3,"appVersion":2,"stackVersion":1,"hwVersion":60,"swBuildId":"2.3.13_800"}}},"binds":[],"configuredReportings":[],"meta":{}},"3":{"profId":4751,"epId":3,"devId":2048,"inClusterList":[65360,65361],"outClusterList":[65360,65361],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":2,"stackVersion":1,"hwVersion":60,"swBuildId":"2.3.13_800","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1677832948343,"defaultSendRequestWhen":"immediate"}

Comments

I am new with zigbee2mqtt so I got no idea how to implement this remote yet. Would need to invest more time into learning how to write converters

External converter

No response

Supported color modes

No response

Color temperature range

No response

fsedarkalex commented 1 year ago

Is there anything I can provide to help implementing (except the implementation itself) - Thinking about logs or something like that?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

fsedarkalex commented 1 year ago

demand still there

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

fsedarkalex commented 1 year ago

demand still exists

fsedarkalex commented 1 year ago

@Koenkk unfortunately I can't reopen this by myself and I don't want to create a second issue

Koenkk commented 1 year ago

Do you see anything in the debug log when pressing buttons on this device?

See https://www.zigbee2mqtt.io/guide/usage/debug.html on how to enable debug logging.

fsedarkalex commented 1 year ago

Yes,

for testing I pressed on/of for all groups and it seems to receive the messages.

So I guess now I need to lear, how to convert this info to a converters file :D

Debug 2023-06-07 13:33:20Received Zigbee message from '---REDACTED---', type 'commandOn', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 32778
Warning 2023-06-07 13:33:20Received message from unsupported device with Zigbee model 'ERCU_3groups_Zm' and manufacturer name 'AwoX'
Warning 2023-06-07 13:33:20Please see: https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html
Info 2023-06-07 13:33:20MQTT publish: topic 'zigbee2mqtt/---REDACTED---', payload '{"last_seen":"2023-06-07T13:33:05+02:00","linkquality":134}'
Debug 2023-06-07 13:33:25Received Zigbee message from '---REDACTED---', type 'commandOff', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 32779
Warning 2023-06-07 13:33:25Received message from unsupported device with Zigbee model 'ERCU_3groups_Zm' and manufacturer name 'AwoX'
Warning 2023-06-07 13:33:25Please see: https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html
Info 2023-06-07 13:33:25MQTT publish: topic 'zigbee2mqtt/---REDACTED---', payload '{"last_seen":"2023-06-07T13:33:10+02:00","linkquality":138}'
Debug 2023-06-07 13:33:26Received Zigbee message from '---REDACTED---', type 'commandOn', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 32779
Warning 2023-06-07 13:33:26Received message from unsupported device with Zigbee model 'ERCU_3groups_Zm' and manufacturer name 'AwoX'
Warning 2023-06-07 13:33:26Please see: https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html
Info 2023-06-07 13:33:26MQTT publish: topic 'zigbee2mqtt/---REDACTED---', payload '{"last_seen":"2023-06-07T13:33:11+02:00","linkquality":112}'
Debug 2023-06-07 13:33:28Received Zigbee message from '---REDACTED---', type 'commandOff', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 32780
Warning 2023-06-07 13:33:28Received message from unsupported device with Zigbee model 'ERCU_3groups_Zm' and manufacturer name 'AwoX'
Warning 2023-06-07 13:33:28Please see: https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html
Info 2023-06-07 13:33:28MQTT publish: topic 'zigbee2mqtt/---REDACTED---', payload '{"last_seen":"2023-06-07T13:33:13+02:00","linkquality":138}'
Debug 2023-06-07 13:33:29Received Zigbee message from '---REDACTED---', type 'commandOn', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 32780
Warning 2023-06-07 13:33:29Received message from unsupported device with Zigbee model 'ERCU_3groups_Zm' and manufacturer name 'AwoX'
Warning 2023-06-07 13:33:29Please see: https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html
Info 2023-06-07 13:33:29MQTT publish: topic 'zigbee2mqtt/---REDACTED---', payload '{"last_seen":"2023-06-07T13:33:14+02:00","linkquality":120}'
fsedarkalex commented 1 year ago

Hi again,

I adapted the already existing converter for the old remote.

This is my complete JS file, whilce I took the upper part from the awox.ts file. Only the definition is relevant:

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const legacy = require('zigbee-herdsman-converters/lib/legacy');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;

const awoxRemoteHelper = {
    convertToColorName: (buffer) => {
        const commonForColors = buffer[0] === 17 && buffer[2] === 48 && buffer[3] === 0 && buffer[5] === 8 && buffer[6] === 0;

        if (commonForColors && buffer[4] === 255) {
            return 'red';
        } else if (commonForColors && buffer[4] === 42) {
            return 'yellow';
        } else if (commonForColors && buffer[4] === 85) {
            return 'green';
        } else if (commonForColors && buffer[4] === 170) {
            return 'blue';
        }
        return null;
    },
    isRefresh: (buffer) => {
        return buffer[0] === 17 && buffer[2] === 16 && buffer[3] === 1 && buffer[4] === 1;
    },
};

const fzLocal = {
    colors: {
        cluster: 'lightingColorCtrl',
        type: ['raw'],
        convert: (model, msg, publish, options, meta) => {
            const color = awoxRemoteHelper.convertToColorName(msg.data);
            if (color != null) {
                return {
                    action: color,
                };
            }
        },
    },
    refreshColored: {
        cluster: 'lightingColorCtrl',
        type: ['commandMoveHue'],
        convert: (model, msg, publish, options, meta) => {
            if (msg.data.movemode === 1 && msg.data.rate === 12) {
                return {
                    action: 'refresh_colored',
                };
            }
        },
    },
    refresh: {
        cluster: 'genLevelCtrl',
        type: ['raw'],
        convert: (model, msg, publish, options, meta) => {
            if (awoxRemoteHelper.isRefresh(msg.data)) {
                return {
                    action: 'refresh',
                };
            }
        },
    },
};

const definition = {
    zigbeeModel: ['ERCU_3groups_Zm'],
        fingerprint: [
            {
                type: 'EndDevice', manufacturerName: 'AwoX', modelID: 'ERCU_3groups_Zm', powerSource: 'Battery', endpoints: [
                    {ID: 1, profileID: 260, deviceID: 2048, inputClusters: [0, 3, 4, 4096], outputClusters: [0, 3, 4, 5, 6, 8, 768, 4096]},
                    {ID: 3, profileID: 4751, deviceID: 2048, inputClusters: [65360, 65361], outputClusters: [65360, 65361]},
                ],
            },
        ],
        model: '99099',
        vendor: 'AwoX',
        description: '3 Groups Remote controller',
        fromZigbee: [fz.command_on, fzLocal.colors, fzLocal.refresh, fzLocal.refreshColored, fz.command_off,
            fz.command_step, fz.command_move, fz.command_stop, fz.command_recall, fz.command_step_color_temperature],
        toZigbee: [],
        exposes: [e.action(['on', 'off', 'red', 'refresh', 'refresh_colored', 'blue', 'yellow',
            'green', 'brightness_step_up', 'brightness_step_down', 'brightness_move_up', 'brightness_move_down', 'brightness_stop',
            'recall_1', 'color_temperature_step_up', 'color_temperature_step_down', 'effect_candle_mode'])],
};

module.exports = definition;

BUT this is not working 100% - There are commands not working at all. Also the MQTT actions for all groups are generic ("on", "off", ...) and not "on_1", "on_2", ... But Z2M shows the group id in the status details... IDK if this is the correct behavior... I know of wall switches that have several on/off buttons and there the action is on_1 on_2 off_1 off_2. But physically this remote only has one pair of on/off buttopns and a group selection key, so maybe this is correct?

Also some specific features are not working and I have no idea how to implement these, but maybe this helps:

Long-Pressing the "refresh" signed button enables the canlde effect on original eglo lights, log:

Debug 2023-06-07 14:14:02Received Zigbee message from '---REDACTED---', type 'raw', cluster 'genLevelCtrl', data '{"data":[17,227,16,1,2],"type":"Buffer"}' from endpoint 1 with groupID 32778
Debug 2023-06-07 14:14:02Received Zigbee message from '---REDACTED---', type 'commandOn', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 32778

(both fired from the longpress)

Long-Press brightness up:

Debug 2023-06-07 14:19:59Received Zigbee message from '---REDACTED---', type 'commandMoveToLevelWithOnOff', cluster 'genLevelCtrl', data '{"level":254,"transtime":2}' from endpoint 1 with groupID 32778
Debug 2023-06-07 14:19:59No converter available for '99099' with cluster 'genLevelCtrl' and type 'commandMoveToLevelWithOnOff' and data '{"level":254,"transtime":2}'

Long-Press brightness down:

Debug 2023-06-07 14:20:41Received Zigbee message from '---REDACTED---', type 'commandMoveToLevel', cluster 'genLevelCtrl', data '{"level":1,"transtime":2}' from endpoint 1 with groupID 32778
Debug 2023-06-07 14:20:41No converter available for '99099' with cluster 'genLevelCtrl' and type 'commandMoveToLevel' and data '{"level":1,"transtime":2}'

Long-Press color temp up:

Debug 2023-06-07 14:21:01Received Zigbee message from '---REDACTED---', type 'commandMoveToColorTemp', cluster 'lightingColorCtrl', data '{"colortemp":454,"transtime":2}' from endpoint 1 with groupID 32778
Debug 2023-06-07 14:21:01No converter available for '99099' with cluster 'lightingColorCtrl' and type 'commandMoveToColorTemp' and data '{"colortemp":454,"transtime":2}'

Long-Press Color-Temp down:

Debug 2023-06-07 14:21:56Received Zigbee message from '---REDACTED---', type 'commandMoveToColorTemp', cluster 'lightingColorCtrl', data '{"colortemp":153,"transtime":2}' from endpoint 1 with groupID 32778
Debug 2023-06-07 14:21:56No converter available for '99099' with cluster 'lightingColorCtrl' and type 'commandMoveToColorTemp' and data '{"colortemp":153,"transtime":2}'

And we get no battery state as it seems

Koenkk commented 1 year ago

Also add fz.command_move_to_level and fz.command_move_to_color_temp, the group ID is a separate property in the published payload.

fsedarkalex commented 1 year ago

This seems to work! So the only missing thing is now the candle effect button (long press refresh)

const definition = {
    zigbeeModel: ['ERCU_3groups_Zm'],
        fingerprint: [
            {
                type: 'EndDevice', manufacturerName: 'AwoX', modelID: 'ERCU_3groups_Zm', powerSource: 'Battery', endpoints: [
                    {ID: 1, profileID: 260, deviceID: 2048, inputClusters: [0, 3, 4, 4096], outputClusters: [0, 3, 4, 5, 6, 8, 768, 4096]},
                    {ID: 3, profileID: 4751, deviceID: 2048, inputClusters: [65360, 65361], outputClusters: [65360, 65361]},
                ],
            },
        ],
        model: '99099',
        vendor: 'AwoX',
        description: '3 Groups Remote controller',
        fromZigbee: [fz.command_on, fzLocal.colors, fzLocal.refresh, fzLocal.refreshColored, fz.command_off,
            fz.command_step, fz.command_move, fz.command_move_to_level, fz.command_move_to_color_temp, fz.command_stop, fz.command_recall, fz.command_step_color_temperature],
        toZigbee: [],
        exposes: [e.action(['on', 'off', 'red', 'refresh', 'refresh_colored', 'blue', 'yellow',
            'green', 'brightness_step_up', 'brightness_step_down', 'brightness_move_up', 'brightness_move_down', 'brightness_stop',
            'recall_1', 'color_temperature_step_up', 'color_temperature_step_down', 'effect_candle_mode'])],
};
Koenkk commented 1 year ago

what is logged when pressing the candle effect button?

fsedarkalex commented 1 year ago

Long-Pressing the "refresh" signed button enables the canlde effect on original eglo lights, log:

Debug 2023-06-07 14:14:02Received Zigbee message from '---REDACTED---', type 'raw', cluster 'genLevelCtrl', data '{"data":[17,227,16,1,2],"type":"Buffer"}' from endpoint 1 with groupID 32778
Debug 2023-06-07 14:14:02Received Zigbee message from '---REDACTED---', type 'commandOn', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 32778

(both fired from the longpress)

Koenkk commented 1 year ago

I don't see a No converter available message, are any MQTT messages being published?

fsedarkalex commented 1 year ago

Action null - thats what I think has to be changed. Guess we need to assign the raw value an action string somehow.

Debug 2023-06-07 16:57:58Received Zigbee message from '---REDACTED---', type 'raw', cluster 'genLevelCtrl', data '{"data":[17,34,16,1,2],"type":"Buffer"}' from endpoint 1 with groupID 32778
Info 2023-06-07 16:57:58MQTT publish: topic 'zigbee2mqtt/---REDACTED---', payload '{"action":null,"last_seen":"2023-06-07T16:57:43+02:00","linkquality":116}'
Debug 2023-06-07 16:57:58Received Zigbee message from '---REDACTED---', type 'commandOn', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 32778
Info 2023-06-07 16:57:58MQTT publish: topic 'zigbee2mqtt/---REDACTED---', payload '{"action":"on","action_group":32778,"last_seen":"2023-06-07T16:57:43+02:00","linkquality":116}'
Info 2023-06-07 16:57:58MQTT publish: topic 'zigbee2mqtt/---REDACTED---', payload '{"action":"","last_seen":"2023-06-07T16:57:43+02:00","linkquality":116}'
Info 2023-06-07 16:57:58MQTT publish: topic 'zigbee2mqtt/---REDACTED---/action', payload 'on'
Koenkk commented 1 year ago

What if you update the ext converter to this:

    refresh: {
        cluster: 'genLevelCtrl',
        type: ['raw'],
        convert: (model, msg, publish, options, meta) => {
                return {
                    action: 'refresh',
                };
        },
    },
fsedarkalex commented 1 year ago

I start to understand how this code and this thing works 🤣

I got it!

buffer[0] is always 17 buffer[1] is increased by 2 per button press until it rolls over buffer[2] is always 16 for this key buffer[3] alternates between one and zero for each short press and is always 1 for long press buffer[4] is always 1 for short press and 2 for long press

so I changed the code to match all these. This should not cause a regression with the old remote, as I only added the new cases.

Please note that this is the JS converter code and the methods must be ported to TS into awox.ts of course

My modification introduces a new string refresh_long for the long press.

There is still one button I don't know what it is about. The only zigbee message logged for this key is a generic "on". It is the refresh_color button. Seems like this is an issue on the remote itself or something z2m does not understand at all. I would ignore this, as I do not even know what this button is supposed to do actually (I have no color eglo lights)

So finally here is my converter code:

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const legacy = require('zigbee-herdsman-converters/lib/legacy');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;

const awoxRemoteHelper = {
    convertToColorName: (buffer) => {
        const commonForColors = buffer[0] === 17 && buffer[2] === 48 && buffer[3] === 0 && buffer[5] === 8 && buffer[6] === 0;

        if (commonForColors && buffer[4] === 255) {
            return 'red';
        } else if (commonForColors && buffer[4] === 42) {
            return 'yellow';
        } else if (commonForColors && buffer[4] === 85) {
            return 'green';
        } else if (commonForColors && buffer[4] === 170) {
            return 'blue';
        }
        return null;
    },
    isRefresh: (buffer) => {
        return buffer[0] === 17 && buffer[2] === 16 && (buffer[3] === 1 || buffer[3] === 0) && buffer[4] === 1;
    },
    isRefreshLong: (buffer) => {
        return buffer[0] === 17 && buffer[2] === 16 && buffer[3] === 1 && buffer[4] === 2;
    },
};

const fzLocal = {
    colors: {
        cluster: 'lightingColorCtrl',
        type: ['raw'],
        convert: (model, msg, publish, options, meta) => {
            const color = awoxRemoteHelper.convertToColorName(msg.data);
            if (color != null) {
                return {
                    action: color,
                };
            }
        },
    },
    refreshColored: {
        cluster: 'lightingColorCtrl',
        type: ['commandMoveHue'],
        convert: (model, msg, publish, options, meta) => {
            if (msg.data.movemode === 1 && msg.data.rate === 12) {
                return {
                    action: 'refresh_colored',
                };
            }
        },
    },
    refresh: {
        cluster: 'genLevelCtrl',
        type: ['raw'],
        convert: (model, msg, publish, options, meta) => {
            if (awoxRemoteHelper.isRefresh(msg.data)) {
                return {
                    action: 'refresh',
                };
            }
            else if (awoxRemoteHelper.isRefreshLong(msg.data)) {
                return {
                    action: 'refresh_long',
                };
            }
        },
    },
};

const definition = {
    zigbeeModel: ['ERCU_3groups_Zm'],
        fingerprint: [
            {
                type: 'EndDevice', manufacturerName: 'AwoX', modelID: 'ERCU_3groups_Zm', powerSource: 'Battery', endpoints: [
                    {ID: 1, profileID: 260, deviceID: 2048, inputClusters: [0, 3, 4, 4096], outputClusters: [0, 3, 4, 5, 6, 8, 768, 4096]},
                    {ID: 3, profileID: 4751, deviceID: 2048, inputClusters: [65360, 65361], outputClusters: [65360, 65361]},
                ],
            },
        ],
        model: '99099',
        vendor: 'AwoX',
        description: '3 Groups Remote controller',
        fromZigbee: [fz.command_on, fzLocal.colors, fzLocal.refresh, fzLocal.refreshColored, fz.command_off,
            fz.command_step, fz.command_move, fz.command_move_to_level, fz.command_move_to_color_temp, fz.command_stop, fz.command_recall, fz.command_step_color_temperature],
        toZigbee: [],
        exposes: [e.action(['on', 'off', 'red', 'refresh', 'refresh_colored', 'blue', 'yellow',
            'green', 'brightness_step_up', 'brightness_step_down', 'brightness_move_up', 'brightness_move_down', 'brightness_stop',
            'recall_1', 'color_temperature_step_up', 'color_temperature_step_down', 'effect_candle_mode'])],
};

module.exports = definition;

Thanks for helping! I left you a few bucks for a few 🍻

Koenkk commented 1 year ago

Great, would you mind making a pull request on awox.ts?

Koenkk commented 1 year ago

This device is supported now so assuming this can be closed now.

dani146cluj commented 1 year ago

Hello everyone. Today I tried to add this remote EGLO RCU3 (ERCU_3groups_Zm) to my Home Assistant with zigbee2mqtt but it is displayed as Unsupported. I have latest versions on HA and z2m. Availability Disabled Device type EndDevice Zigbee Model ERCU_3groups_Zm Zigbee Manufacturer AwoX Support status Not supported IEEE Address 0xa4c1384572fb5f33 Network address 0x77B7 Firmware version 2.5.0_999 Power Battery Interview completed True

Is there something I can do to recognize the remote ? Thank you.

Koenkk commented 1 year ago

the device is supported in 1.32.2

dani146cluj commented 1 year ago

I had Edge and did not update it. Thank you :)

m1k3f15h commented 1 year ago

Hy, I Tried to pair the EGLO 99099 but the interview failed and the Device is shown as unsupported... [1.33.0]

what can i do?

mike

joedoe196606 commented 7 months ago

Did you try to update the firmware of the remote with AwoX HomeControl? Mine is 2.7.3_1387 .... perhaps this helps

m1k3f15h commented 7 months ago

Did you try to update the firmware of the remote with AwoX HomeControl? Mine is 2.7.3_1387 .... perhaps this helps

can i connect the remote directly to the smartphone?

joedoe196606 commented 7 months ago

Yes, in the AwoX HomeControl App. To enable "smartphone mode" of the remote, you have to press and hold "On" and "Blue" button simultaneously and keep them held for at least three seconds. After the HomeControl app detects the remote, the app encourages you to update the firmware of the remote.

m1k3f15h commented 7 months ago

Yes, in the AwoX HomeControl App. To enable "smartphone mode" of the remote, you have to press and hold "On" and "Blue" button simultaneously and keep them held for at least three seconds. After the HomeControl app detects the remote, the app encourages you to update the firmware of the remote.

Thank's I will try this soon

Mike