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

Legrand 067773 switches send two ON events when pressed once #11056

Closed Crocmagnon closed 2 years ago

Crocmagnon commented 2 years ago

What happened?

Two "on" events are sent when pressed once, which make my automations based on the number of presses fail.

What did you expect to happen?

When pressed once, only one "on" event is sent.

How to reproduce it (minimal and precise)

Bind a legrand wireless switch, and press the on button

Zigbee2MQTT version

1.22.2-dev commit: 1a2943d

Adapter firmware version

0x26720700

Adapter

ConBee2/RaspBee2

Debug log

info  2022-01-27 13:26:59: MQTT publish: topic 'zigbee2mqtt/Interrupteur couloir centre', payload '{"action":"on","action_group":1,"battery":0,"linkquality":255,"voltage":2500}'
info  2022-01-27 13:26:59: MQTT publish: topic 'zigbee2mqtt/Interrupteur couloir centre', payload '{"action":"","battery":0,"linkquality":255,"voltage":2500}'
info  2022-01-27 13:26:59: MQTT publish: topic 'zigbee2mqtt/Interrupteur couloir centre/action', payload 'on'
info  2022-01-27 13:26:59: MQTT publish: topic 'zigbee2mqtt/Interrupteur couloir centre', payload '{"action":"on","battery":0,"linkquality":255,"voltage":2500}'
info  2022-01-27 13:26:59: MQTT publish: topic 'zigbee2mqtt/Interrupteur couloir centre', payload '{"action":"","battery":0,"linkquality":255,"voltage":2500}'
info  2022-01-27 13:26:59: MQTT publish: topic 'zigbee2mqtt/Interrupteur couloir centre/action', payload 'on'
info  2022-01-27 13:27:00: MQTT publish: topic 'zigbee2mqtt/Couloir', payload '{"brightness":254,"color_mode":"color_temp","color_temp":183,"state":"ON"}'
info  2022-01-27 13:27:00: MQTT publish: topic 'zigbee2mqtt/Ampoule couloir est', payload '{"brightness":254,"color_mode":"color_temp","color_temp":183,"color_temp_startup":65535,"linkquality":255,"state":"ON"}'
info  2022-01-27 13:27:00: MQTT publish: topic 'zigbee2mqtt/Ampoule couloir sud', payload '{"brightness":254,"color_mode":"color_temp","color_temp":250,"color_temp_startup":65535,"linkquality":255,"state":"ON"}'
info  2022-01-27 13:27:00: MQTT publish: topic 'zigbee2mqtt/Couloir', payload '{"brightness":177,"color_mode":"color_temp","color_temp":183,"state":"ON"}'
info  2022-01-27 13:27:00: MQTT publish: topic 'zigbee2mqtt/Ampoule couloir est', payload '{"brightness":177,"color_mode":"color_temp","color_temp":183,"color_temp_startup":65535,"linkquality":255,"state":"ON"}'
info  2022-01-27 13:27:00: MQTT publish: topic 'zigbee2mqtt/Couloir', payload '{"brightness":177,"color_mode":"color_temp","color_temp":183,"state":"ON"}'
info  2022-01-27 13:27:00: MQTT publish: topic 'zigbee2mqtt/Ampoule couloir nord', payload '{"brightness":177,"color_mode":"color_temp","color_temp":250,"color_temp_startup":65535,"linkquality":255,"state":"ON"}'
info  2022-01-27 13:27:00: MQTT publish: topic 'zigbee2mqtt/Ampoule couloir sud', payload '{"brightness":254,"color_mode":"color_temp","color_temp":250,"color_temp_startup":65535,"linkquality":255,"state":"ON"}'
info  2022-01-27 13:27:00: MQTT publish: topic 'zigbee2mqtt/Couloir', payload '{"brightness":177,"color_mode":"color_temp","color_temp":250,"state":"ON"}'
info  2022-01-27 13:27:00: MQTT publish: topic 'zigbee2mqtt/Ampoule couloir sud', payload '{"brightness":177,"color_mode":"color_temp","color_temp":250,"color_temp_startup":65535,"linkquality":255,"state":"ON"}'
info  2022-01-27 13:27:00: MQTT publish: topic 'zigbee2mqtt/Ampoule couloir nord', payload '{"brightness":177,"color_mode":"color_temp","color_temp":250,"color_temp_startup":65535,"linkquality":255,"state":"ON"}'
Koenkk commented 2 years ago

Looks like the fix for https://github.com/Koenkk/zigbee2mqtt/issues/10972 only needs to be applied to the off action.

could you check if all possible actions of this device work properly when using the following external converter:

const fz = {...require('zigbee-herdsman-converters/converters/fromZigbee'), legacy: require('zigbee-herdsman-converters/lib/legacy').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 extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;

const fzLocal = {
    command_off: {
        cluster: 'genOnOff',
        type: 'commandOff',
        convert: (model, msg, publish, options, meta) => {
            return {action: 'off'};
        },
    },
};

const definition = {
    zigbeeModel: [
        ' Remote switch\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000'],
    model: '067773',
    vendor: 'Legrand',
    // led blink RED when battery is low
    description: 'Wireless remote switch CUSTOM',
    fromZigbee: [fz.identify, fz.command_on, fzLocal.command_off, fz.command_toggle, fz.legacy.cmd_move, fz.legacy.cmd_stop, fz.battery],
    exposes: [e.battery(), e.action(['identify', 'on', 'off', 'toggle', 'brightness_move_up',
        'brightness_move_down', 'brightness_stop'])],
    toZigbee: [],
    meta: {battery: {voltageToPercentage: '3V_2500'}},
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint = device.getEndpoint(1);
        await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'genOnOff', 'genLevelCtrl']);
    },
};

module.exports = definition;
Crocmagnon commented 2 years ago

I'm sorry, however I try to configure the custom converter it doesn't seem to change the device's description. I already have one external converter that works, I tried removing it to leave only yours but it still doesn't load (or doesn't change the device's description).

Startup logs ``` [s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] socat.sh: executing... [17:22:25] INFO: Socat not enabled, marking service as down [cont-init.d] socat.sh: exited 0. [cont-init.d] zigbee2mqtt.sh: executing... [cont-init.d] zigbee2mqtt.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [17:22:28] INFO: Handing over control to Zigbee2mqtt Core ... > zigbee2mqtt@1.22.2-dev start > node index.js Zigbee2MQTT:info 2022-01-27 17:22:34: Logging to console and directory: '/share/zigbee2mqtt/log/2022-01-27.17-22-31' filename: log.txt Zigbee2MQTT:info 2022-01-27 17:22:34: Starting Zigbee2MQTT version 1.22.2-dev (commit #1a2943d) Zigbee2MQTT:info 2022-01-27 17:22:34: Starting zigbee-herdsman (0.14.7) CREATED DECONZ ADAPTER Zigbee2MQTT:info 2022-01-27 17:22:34: zigbee-herdsman started (resumed) Zigbee2MQTT:info 2022-01-27 17:22:34: Coordinator firmware version: '{"meta":{"maintrel":0,"majorrel":38,"minorrel":114,"product":0,"revision":"0x26720700","transportrev":0},"type":"ConBee2/RaspBee2"}' Zigbee2MQTT:info 2022-01-27 17:22:35: Currently 51 devices are joined: Zigbee2MQTT:info 2022-01-27 17:22:35: Détecteur toilettes (0x001788010862e69e): 9290012607 - Philips Hue motion sensor (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule toilettes (0x0017880108342537): 9290022169 - Philips Hue white ambiance E27 with Bluetooth (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule bureau (0x001788010679e743): 9290022166 - Philips Hue white and color ambiance E26/E27 (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule chambre (0x0017880106a07f9f): 9290022166 - Philips Hue white and color ambiance E26/E27 (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur toilettes (0x0004740000ad3839): 067773 - Legrand Wireless remote switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur bureau (0x0004740000ad3838): 067773 - Legrand Wireless remote switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur chambre (0x0004740000ad383c): 067773 - Legrand Wireless remote switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Lampadaire bibliothèque (0x0017880108340f23): 9290022166 - Philips Hue white and color ambiance E26/E27 (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Bandeau LED bibliothèque (0x0017880108b4bff1): 8718699703424 - Philips Hue white and color ambiance LightStrip plus (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Bol salon (0x0017880106f9ffbb): 7602031P7 - Philips Hue Go with Bluetooth (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Bandeau LED salon (0x0017880108d5664e): 8718699703424 - Philips Hue white and color ambiance LightStrip plus (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Bandeau LED extérieur (0x0017880108c47bb3): 9290022890 - Philips Hue white and color ambiance LightStrip outdoor 2m (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule bibliothèque (0x0017880108392f19): 9290022166 - Philips Hue white and color ambiance E26/E27 (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule salon (0x0017880108340cdc): 9290022166 - Philips Hue white and color ambiance E26/E27 (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule cuisine (0x00178801064c2f90): 9290022169 - Philips Hue white ambiance E27 with Bluetooth (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule vintage gauche (0x0017880108a36b17): 8718699688882 - Philips Hue white Filament bulb G93 E27 bluetooth (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule vintage droite (0x0017880108a3fada): 8718699688882 - Philips Hue white Filament bulb G93 E27 bluetooth (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule vintage milieu (0x0017880108a26ee8): 8718699688882 - Philips Hue white Filament bulb G93 E27 bluetooth (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur arrivée départ (0x00047400007a76f5): 064873 - Legrand Home & away switch / master switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur bibliothèque (0x0004740000ad381c): 067773 - Legrand Wireless remote switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur couloir sud (0x0004740000ad381e): 067773 - Legrand Wireless remote switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur couloir centre (0x0004740000ad3837): 067773 - Legrand Wireless remote switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur salon bibliothèque (0x0004740000921ca7): 067774 - Legrand Wireless double remote switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur cuisine vintage (0x0004740000921d78): 067774 - Legrand Wireless double remote switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Volet cuisine (0x00047400008c9172): 067776 - Legrand Netatmo wired shutter switch (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Petit store salon (0x00047400008c9154): 067776 - Legrand Netatmo wired shutter switch (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Grand store salon (0x00047400008c915c): 067776 - Legrand Netatmo wired shutter switch (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Volet bureau (0x00047400008d0004): 067776 - Legrand Netatmo wired shutter switch (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Plan de travail (0x00047400008c9cb0): 067771 - Legrand Wired switch without neutral (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Volet chambre (0x00047400008c915b): 067776 - Legrand Netatmo wired shutter switch (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur couloir nord (0x0004740000ad3843): 067773 - Legrand Wireless remote switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Linky (0x00158d0005d2848c): ZLinky_TIC - LiXee Lixee ZLinky (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Guirlande bureau (0x086bd7fffe1cc08e): E1603/E1702/E1708 - IKEA TRADFRI control outlet (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur guirlande bureau (0xccccccfffe56bdcd): E1743 - IKEA TRADFRI ON/OFF switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur chambre Gabriel (0xccccccfffe708b50): E1743 - IKEA TRADFRI ON/OFF switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur lampadaire (0x000d6ffffe2f0a35): E1743 - IKEA TRADFRI ON/OFF switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Capteur humidité salle de bains (0x00124b002267ff5d): SNZB-02 - SONOFF Temperature and humidity sensor (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur chambre Claire (0xd0cf5efffef2c120): E1524/E1810 - IKEA TRADFRI remote control (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Capteur porte entrée (0x00124b002269a9bc): SNZB-04 - SONOFF Contact sensor (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur guirlande salon (0x14b457fffec800d4): E1743 - IKEA TRADFRI ON/OFF switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Détecteur bureau (0x001788010917a5fd): 9290012607 - Philips Hue motion sensor (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Détecteur grande fenêtre salon (0x00124b00239e26a1): SNZB-04 - SONOFF Contact sensor (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Détecteur bureau Gabriel (0x14b457fffe695466): E1525/E1745 - IKEA TRADFRI motion sensor (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Guirlande chambre (0x000d6ffffe2acb10): E1603/E1702/E1708 - IKEA TRADFRI control outlet (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule buanderie (0xa4c1387ea4bcd659): TS0011_switch_module - TuYa 1 gang switch module - (without neutral) (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Sapin (0x0017880108fbbce3): 046677552343 - Philips Hue smart plug bluetooth (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: LED imprimante 3D (0x00124b00232f14c0): GL-C-008-1ID - Gledopto Zigbee LED Controller RGB+CCT (1 ID) (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Interrupteur imprimante 3D (0x086bd7fffe3c6c12): E1743 - IKEA TRADFRI ON/OFF switch (EndDevice) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule couloir nord (0xa4c138f0adc9f0bd): 33957 - AwoX LED light with color temperature (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule couloir sud (0xa4c138c5aea3e00d): 33957 - AwoX LED light with color temperature (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Ampoule couloir est (0xa4c1382a02091afa): 33957 - AwoX LED light with color temperature (Router) Zigbee2MQTT:info 2022-01-27 17:22:35: Zigbee: disabling joining new devices. Zigbee2MQTT:info 2022-01-27 17:22:35: Connecting to MQTT server at mqtts://core-mosquitto:8883 Zigbee2MQTT:info 2022-01-27 17:22:35: Connected to MQTT server Zigbee2MQTT:info 2022-01-27 17:22:35: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online' Zigbee2MQTT:info 2022-01-27 17:22:36: Configuring 'Plan de travail' ```
Koenkk commented 2 years ago

Not sure why it doesn't work, anyway I've committed the changes (since I expect it will fix it), please let me know if it works.

Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)

Crocmagnon commented 2 years ago

After updating the edge addon, everything seems to work fine with these wall switches now. Thank you very much! 🎉 🙏🏻