Koenkk / zigbee2mqtt

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

ERROR Failed to configure device #6924

Closed KrystofVydra closed 3 years ago

KrystofVydra commented 3 years ago

I am working on a project. Basically it should be battery powered window covering/blinds on Nordic NRF52840 platform. But I am stuck on reporting the Battery Remaining Percentage attribute to the Z2M. I have already managed to report the attribute from #1 DK running the main application to #2 DK that was running CLI coordinator from Nordic. I had to bind to the Power Config cluster and then subscribe to the Battery Remaining Percentage attribute. The reporting worked after that.

But now I don't know how to manage the binding in Z2M.

This is the device entry in devices.js: { zigbeeModel: ['Window_Covering_v0.1'], model: 'model', vendor: 'vendor', description: 'description', fromZigbee: [fz.cover_position_tilt, fz.battery], toZigbee: [tz.cover_state, tz.cover_position_tilt], meta: {configureKey: 2, battery: {dontDividePercentage: true}}, ota: ota.tradfri, configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'closuresWindowCovering']); await reporting.batteryPercentageRemaining(endpoint); await reporting.currentPositionLiftPercentage(endpoint); }, exposes: [e.cover_position(), e.battery()], },

(the entry is just copied from IKEA roller blinds, but all the clusters are the same on my device, so that shouldn't be a problem)

but I get this error: Zigbee2MQTT:error 2021-04-02 11:52:10: Failed to configure '0xf4ce36250feaeb0e', attempt 1 (TypeError: Cannot read property 'bind' of undefined at Object.bind (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/lib/reporting.js:33:24) at Object.configure (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/devices.js:2808:29) at Configure.configure (/opt/zigbee2mqtt/lib/extension/configure.js:131:45) at Configure.onZigbeeEvent (/opt/zigbee2mqtt/lib/extension/configure.js:113:18) at Controller.callExtensionMethod (/opt/zigbee2mqtt/lib/controller.js:382:44))

I have tried reinstalling Z2M and flashing my CC2531 dongle with newest fw (from here: https://www.zigbee2mqtt.io/information/flashing_the_cc2531.html)

This is the device entry in database.db {"id":2,"type":"Router","ieeeAddr":"0xf4ce36250feaeb0e","nwkAddr":1125,"manufId":4660,"manufName":"Nordic","powerSource":"DC Source","modelId":"Window_Covering_v0.1","epList":[10,242],"endpoints":{"10":{"profId":260,"epId":10,"devId":514,"inClusterList":[0,3,258,5,1,4],"outClusterList":[],"clusters":{"genBasic":{"attributes":{"modelId":"Window_Covering_v0.1","manufacturerName":"Nordic","powerSource":4,"zclVersion":2,"appVersion":1,"stackVersion":10,"hwVersion":11,"dateCode":"20180416","swBuildId":""}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":1,"stackVersion":10,"hwVersion":11,"dateCode":"20180416","swBuildId":"","zclVersion":2,"interviewCompleted":true,"meta":{},"lastSeen":1617367290150}

Here is the complete Z2M log: https://pastebin.com/fhjSiFL0

Maybe I am doing this completely wrong or maybe it is a bug in Z2M?

What happened

Configuration error Zigbee2MQTT:error 2021-04-02 11:52:10: Failed to configure '0xf4ce36250feaeb0e', attempt 1 (TypeError: Cannot read property 'bind' of undefined

What did you expect to happen

Configure the device (bind to attributes) and enable reporting.

How to reproduce it (minimal and precise)

    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint = device.getEndpoint(1);
        await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'closuresWindowCovering']);
        await reporting.batteryPercentageRemaining(endpoint);
        await reporting.currentPositionLiftPercentage(endpoint);
    },

in device entry in devices.js

Debug info

Zigbee2MQTT version: 1.18.2 Adapter hardware: CC2531 Adapter firmware version: 20201127

github-actions[bot] commented 3 years 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