Koenkk / zigbee2mqtt

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

zigbee2mqtt 1.34.0-1 failed to start after the latest update. #20010

Closed rugal7699 closed 10 months ago

rugal7699 commented 10 months ago

What happened?

The add-on itself failed to start with the error below shown in log

/app/node_modules/zigbee-herdsman-converters/index.js:172
if (converter.options) {
^
TypeError: Cannot read properties of undefined (reading 'options')
at Object.addDefinition [as addDeviceDefinition] (/app/node_modules/zigbee-herdsman-converters/index.js:172:23)
at new ExternalConverters (/app/lib/extension/externalConverters.ts:15:17)
at new Controller (/app/lib/controller.ts:84:58)
at start (/app/index.js:106:18)

I have an Aqara roller shade motor external converters. Created according to the content of ZNGZDJ11LM.

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const ota = require('zigbee-herdsman-converters/lib/ota');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['lumi.curtain.vagl02'],
    model: 'ZNGZDJ16LM',
    description: 'Aqara roller shade motor',
    vendor: 'Aqara',
    whiteLabel: [{vendor: 'Xiaomi', model: 'SRSC-M01'}],
    fromZigbee: [fz.xiaomi_basic, fz.xiaomi_curtain_position, fz.xiaomi_curtain_position_tilt],
    toZigbee: [tz.xiaomi_curtain_position_state, tz.xiaomi_curtain_options],
    exposes: [e.cover_position().setAccess('state', ea.ALL),
        exposes.binary('running', ea.STATE, true, false)
            .withDescription('Whether the motor is moving or not')],
    ota: ota.zigbeeOTA,
    configure: async (device, coordinatorEndpoint, logger) => {
        utils.attachOutputCluster(device, 'genOta');
    },
};

module.exports = definition;

The addon started normally with disabling external converter from 'configuration.yaml' file. But my devices still need converters. What should I do to use these devices in the new version?

What did you expect to happen?

wake up normally. and all zigbee devices working properly as per normal.

How to reproduce it (minimal and precise)

Update z2m to 1.34.0-1

Zigbee2MQTT version

1.34.0-1

Adapter firmware version

20221226

Adapter

zStack3x0

Debug log

/app/node_modules/zigbee-herdsman-converters/index.js:172 if (converter.options) { ^ TypeError: Cannot read properties of undefined (reading 'options') at Object.addDefinition [as addDeviceDefinition] (/app/node_modules/zigbee-herdsman-converters/index.js:172:23) at new ExternalConverters (/app/lib/extension/externalConverters.ts:15:17) at new Controller (/app/lib/controller.ts:84:58) at start (/app/index.js:106:18)

Koenkk commented 10 months ago

One of your external converters is incompatible with the current Z2M version. You should fix your external converter. I improved the logging of this.

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)