zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

zigbee2mqtt crashing at start because of some new Livolo related code

Open milakov opened this issue 7 years ago • 7 comments

Hi, I am trying to pair Xiaomi doublу key switch, without much sucess. At some point it appeared in the list under unknown mnaufacturer name and I am repeatedly getting this error:

/app/lib/extension/pollLivoloSwitch.js:69
            .filter((d) => d.manufName.startsWith('LIVOLO')) // LIVOLO

zigbee2mqtt restarts and encounter the same error and so on. I have no Livolo devices connected.

milakov avatar Feb 03 '19 07:02 milakov

Second that. Tested with DIY router and IKEA Lights.

Landrash avatar Feb 03 '19 08:02 Landrash

Can you post the complete exception?

Koenkk avatar Feb 03 '19 08:02 Koenkk

I moved to stable version afterwards and somehow got those logs from the edge version removed. Being on stable version I sucessfully removed that incomplete device. Now I am back using edge version, but as far as I don't have incomplete device anylonger I don't see this error. I tried several times to add that Xiaomi switch, without any success, even incomplete one. I will post an exception if I see it again.

milakov avatar Feb 03 '19 09:02 milakov

hi Koenkk During this intesive test to implement LIVOLO, what about to use @ptvoinfo branch on github ? so it won't disturb your dev branch ? cheers

khzd avatar Feb 03 '19 12:02 khzd

@khzd good idea, I temporarily commented out the Livolo extension, Livolo users can comment this out to test.

Koenkk avatar Feb 03 '19 13:02 Koenkk

Here is the log (the device 0x00158d00027c1b4c in the beginning is correctly working one):

  zigbee2mqtt:info 2019-2-3 18:46:35 MQTT publish: topic 'homeassistant/sensor/0x00158d00027c1b4c/battery/config', payload '{"unit_of_measurement":"%","device_class":"battery","value_template":"{{ value_json.battery }}","state_topic":"zigbee2mqtt/0x00158d00027c1b4c","json_attributes_topic":"zigbee2mqtt/0x00158d00027c1b4c","name":"0x00158d00027c1b4c_battery","unique_id":"0x00158d00027c1b4c_battery_zigbee2mqtt","device":{"identifiers":"zigbee2mqtt_0x00158d00027c1b4c","name":"0x00158d00027c1b4c","sw_version":"Zigbee2mqtt 1.1.0","model":"Aqara double key wireless wall switch (WXKG02LM)","manufacturer":"Xiaomi"},"availability_topic":"zigbee2mqtt/bridge/state"}'
/app/lib/extension/pollLivoloSwitch.js:69
            .filter((d) => d.manufName.startsWith('LIVOLO')) // LIVOLO
                                       ^
TypeError: Cannot read property 'startsWith' of undefined
    at zigbee.getAllClients.filter (/app/lib/extension/pollLivoloSwitch.js:69:40)
    at Array.filter (<anonymous>)
    at PollLivoloSwitch.handleInterval (/app/lib/extension/pollLivoloSwitch.js:69:14)
    at Timeout.timer.setInterval [as _onTimeout] (/app/lib/extension/pollLivoloSwitch.js:23:45)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)
npm
 
ERR!
 code ELIFECYCLE
npm ERR! errno 1
npm
 ERR! [email protected] start: `node index.js`
npm 
ERR! Exit status 1
npm ERR! 
npm
 ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR!
 A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-02-03T15_46_35_822Z-debug.log
2019-02-03T18:46:35: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2019-02-03T18:46:35: PM2 log: App [npm:0] starting in -fork mode-
2019-02-03T18:46:35: PM2 log: App [npm:0] online

milakov avatar Feb 03 '19 15:02 milakov

@milakov thanks, added an extra check so this shouldn't happen anymore.

Koenkk avatar Feb 03 '19 16:02 Koenkk