Giter Site home page Giter Site logo

Comments (16)

lolorc avatar lolorc commented on August 20, 2024 1

I'm using dev branch, whenever I'm using the rounded or straight egdes' one, it fails because messages don't always have the '65281' key as you can see in the provided example.

from zigbee-herdsman-converters.

Chrischi- avatar Chrischi- commented on August 20, 2024 1

@lolorc thanks

could you also share your devices.js + fromZigbee.js?
http://pastebin.com/

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on August 20, 2024

Can you post the logging before the exception?

from zigbee-herdsman-converters.

lolorc avatar lolorc commented on August 20, 2024
  cc-znp   len: 49,                                                                                                                                                                                                │
  cc-znp   type: 'AREQ',                                                                                                                                                                                           │
  cc-znp   subsys: 'AF',                                                                                                                                                                                           │
  cc-znp   cmd: 'incomingMsg',                                                                                                                                                                                     │
  cc-znp   payload:                                                                                                                                                                                                │
  cc-znp    { groupid: 0,                                                                                                                                                                                          │
  cc-znp      clusterid: 0,                                                                                                                                                                                        │
  cc-znp      srcaddr: 35539,                                                                                                                                                                                      │
  cc-znp      srcendpoint: 1,                                                                                                                                                                                      │
  cc-znp      dstendpoint: 1,                                                                                                                                                                                      │
  cc-znp      wasbroadcast: 0,                                                                                                                                                                                     │
  cc-znp      linkquality: 26,                                                                                                                                                                                     │
  cc-znp      securityuse: 0,                                                                                                                                                                                      │
  cc-znp      timestamp: 6972176,                                                                                                                                                                                  │
  cc-znp      transseqnumber: 0,                                                                                                                                                                                   │
  cc-znp      len: 29,                                                                                                                                                                                             │
  cc-znp      data: <Buffer 1c 34 12 39 0a 02 ff 4c 06 00 10 00 21 b3 0b 21 a8 13 24 01 00 00 00 00 21 36 01 20 61> },                                                                                             │
  cc-znp   fcs: 40,                                                                                                                                                                                                │
  cc-znp   csum: 40 } +3s                                                                                                                                                                                          │
  serialport:main _read reading +8ms                                                                                                                                                                               │
  serialport:bindings read +9ms                                                                                                                                                                                    │
  serialport:unixRead Starting read +8ms                                                                                                                                                                           │
  cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 0, srcaddr: 35539, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 26, securityuse: 0, timestamp: 6972176, transseqnumber: 0, len: 29, dat│
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +1ms                                                                                                                           │
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +10ms                                                                                                                                                 │
  serialport:unixRead waiting for readable because of code: EAGAIN +13ms                                                                                                                                           │
  serialport:poller Polling for "readable" +22ms                                                                                                                                                                   │
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +2ms                                                                                                                        │
  zigbee2mqtt:debug 2018-10-29 15:04:35 Received zigbee message of type 'attReport' with data '{"cid":"genBasic","data":{"65282":[{"elmType":16,"elmVal":0},{"elmType":33,"elmVal":2995},{"elmType":33,"elmVal":503│
  zigbee2mqtt:info 2018-10-29 15:04:35 MQTT publish, topic: 'zigbee2mqtt/door_window_sensor_03', payload: '{"battery":"55.00","voltage":2995,"linkquality":26,"ts":1540821875015,"ls":6110936}'                    │
/home/pi/zigbee2mqtt/node_modules/zigbee-shepherd-converters/converters/fromZigbee.js:406                                                                                                                          │
            return {contact: msg.data.data['65281']['100'] === 0};                                                                                                                                                 │
                                                   ^                                                                                                                                                               │
                                                                                                                                                                                                                   │
TypeError: Cannot read property '100' of undefined                                                                                                                                                                 │
    at Object.convert (/home/pi/zigbee2mqtt/node_modules/zigbee-shepherd-converters/converters/fromZigbee.js:406:52)                                                                                               │
    at converters.forEach (/home/pi/zigbee2mqtt/lib/controller.js:319:39)                                                                                                                                          │
    at Array.forEach (<anonymous>)                                                                                                                                                                                 │
    at Controller.handleZigbeeMessage (/home/pi/zigbee2mqtt/lib/controller.js:297:20)                                                                                                                              │
    at Zigbee.handleMessage (/home/pi/zigbee2mqtt/lib/zigbee.js:172:18)                                                                                                                                            │
    at emitOne (events.js:116:13)                                                                                                                                                                                  │
    at ZShepherd.emit (events.js:211:7)                                                                                                                                                                            │
    at ZShepherd.<anonymous> (/home/pi/zigbee2mqtt/node_modules/zigbee-shepherd/lib/shepherd.js:160:14)                                                                                                            │
    at emitMany (events.js:147:13)                                                                                                                                                                                 │
    at ZShepherd.emit (events.js:224:7)                                                                                                                                                                            │
npm ERR! code ELIFECYCLE

at the moment I've just replaced the return by

return {contact: msg.data.data['65281'] && msg.data.data['65281']['100'] === 0};

but the logic might be inverted

from zigbee-herdsman-converters.

Chrischi- avatar Chrischi- commented on August 20, 2024

This should be fixed with commit: #111

@lolorc
Are you using the above Version?
you are using a MiJia (rounded edges) or Aqara Sensor (straight edges)?

from zigbee-herdsman-converters.

Chrischi- avatar Chrischi- commented on August 20, 2024

@lolorc
I can‘t see/find a dev branch of 'zigbee-shepherd-converters'.

I use 19 Aqara Magnet Sensors (MCCGQ11LM) and all of my sensors are reporting this value with '65821'. :-/

from zigbee-herdsman-converters.

lolorc avatar lolorc commented on August 20, 2024

oh sorry I meant the dev branch of zigbee2mqtt, so I was using 4.0.9

from zigbee-herdsman-converters.

Chrischi- avatar Chrischi- commented on August 20, 2024

@lolorc
the fix was not included in version 4.0.9. It was committed after 4.0.9 and was therefore only included in 4.0.10. Try upgrading to 4.0.10 and test again.

from zigbee-herdsman-converters.

lolorc avatar lolorc commented on August 20, 2024

sure, will do right now, my sensors are the rounded one btw

from zigbee-herdsman-converters.

Chrischi- avatar Chrischi- commented on August 20, 2024

my sensors are the rounded one btw

Okay. Exactly those having the problem. These are the MiJia sensors.

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on August 20, 2024

Should indeed by fixed in the latest dev branch.

from zigbee-herdsman-converters.

lolorc avatar lolorc commented on August 20, 2024

it is not.

from zigbee-herdsman-converters.

Chrischi- avatar Chrischi- commented on August 20, 2024

Could you paste a longer debug log to pastebin?

If it's a MiJia contact sensor, then the section starting at line 406 in fromZigbee -> xiaomi_contact_interval is not used at all. xiaomi_contact_interval is not
used in devices.js for this devices.

from zigbee-herdsman-converters.

lolorc avatar lolorc commented on August 20, 2024
  serialport:poller received "readable" +317ms                                                                                                                                                                     │
  serialport:bindings read +327ms                                                                                                                                                                                  │
  serialport:unixRead Starting read +319ms                                                                                                                                                                         │
  serialport:unixRead Finished read 32 bytes +0ms                                                                                                                                                                  │
  serialport:main binding.read finished +329ms                                                                                                                                                                     │
  cc-znp { sof: 254,                                                                                                                                                                                               │
  cc-znp   len: 27,                                                                                                                                                                                                │
  cc-znp   type: 'AREQ',                                                                                                                                                                                           │
  cc-znp   subsys: 'AF',                                                                                                                                                                                           │
  cc-znp   cmd: 'incomingMsg',                                                                                                                                                                                     │
  cc-znp   payload:                                                                                                                                                                                                │
  cc-znp    { groupid: 0,                                                                                                                                                                                          │
  cc-znp      clusterid: 6,                                                                                                                                                                                        │
  cc-znp      srcaddr: 10141,                                                                                                                                                                                      │
  cc-znp      srcendpoint: 1,                                                                                                                                                                                      │
  cc-znp      dstendpoint: 1,                                                                                                                                                                                      │
  cc-znp      wasbroadcast: 0,                                                                                                                                                                                     │
  cc-znp      linkquality: 31,                                                                                                                                                                                     │
  cc-znp      securityuse: 0,                                                                                                                                                                                      │
  cc-znp      timestamp: 9008569,                                                                                                                                                                                  │
  cc-znp      transseqnumber: 0,                                                                                                                                                                                   │
  cc-znp      len: 7,                                                                                                                                                                                              │
  cc-znp      data: <Buffer 18 b9 0a 00 00 10 00> },                                                                                                                                                               │
  cc-znp   fcs: 246,                                                                                                                                                                                               │
  cc-znp   csum: 246 } +324ms                                                                                                                                                                                      │
  serialport:main _read reading +8ms                                                                                                                                                                               │
  serialport:bindings read +10ms                                                                                                                                                                                   │
  serialport:unixRead Starting read +9ms                                                                                                                                                                           │
  cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 6, srcaddr: 10141, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 31, securityuse: 0, timestamp: 9008569, transseqnumber: 0, len: 7, data│
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +2ms                                                                                                                           │
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +13ms                                                                                                                                                 │
  serialport:unixRead waiting for readable because of code: EAGAIN +16ms                                                                                                                                           │
  serialport:poller Polling for "readable" +27ms                                                                                                                                                                   │
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +1ms                                                                                                                        │
  zigbee2mqtt:debug 2018-10-30 17:59:44 Received zigbee message of type 'attReport' with data '{"cid":"genOnOff","data":{"onOff":0}}' of device 'lumi.sensor_magnet'                          │
  zigbee2mqtt:info 2018-10-30 17:59:44 MQTT publish, topic: 'zigbee2mqtt/door_window_sensor_02', payload: '{"contact":true,"linkquality":31,"ts":1540918784005,"ls":197405}'                                       │
  zigbee2mqtt:debug 2018-10-30 17:59:44 Received zigbee message of type 'devChange' with data '{"cid":"genOnOff","data":{"onOff":0}}' of device 'lumi.sensor_magnet'                          │
  serialport:poller received "readable" +1s                                                                                                                                                                        │
  serialport:bindings read +1s                                                                                                                                                                                     │
  serialport:unixRead Starting read +1s                                                                                                                                                                            │
  serialport:unixRead Finished read 54 bytes +1ms                                                                                                                                                                  │
  serialport:main binding.read finished +1s                                                                                                                                                                        │
  cc-znp { sof: 254,                                                                                                                                                                                               │
  cc-znp   len: 49,                                                                                                                                                                                                │
  cc-znp   type: 'AREQ',                                                                                                                                                                                           │
  cc-znp   subsys: 'AF',                                                                                                                                                                                           │
  cc-znp   cmd: 'incomingMsg',                                                                                                                                                                                     │
  cc-znp   payload:                                                                                                                                                                                                │
  cc-znp    { groupid: 0,                                                                                                                                                                                          │
  cc-znp      clusterid: 0,                                                                                                                                                                                        │
  cc-znp      srcaddr: 10141,                                                                                                                                                                                      │
  cc-znp      srcendpoint: 1,                                                                                                                                                                                      │
  cc-znp      dstendpoint: 1,                                                                                                                                                                                      │
  cc-znp      wasbroadcast: 0,                                                                                                                                                                                     │
  cc-znp      linkquality: 28,                                                                                                                                                                                     │
  cc-znp      securityuse: 0,                                                                                                                                                                                      │
  cc-znp      timestamp: 9012405,                                                                                                                                                                                  │
  cc-znp      transseqnumber: 0,                                                                                                                                                                                   │
  cc-znp      len: 29,                                                                                                                                                                                             │
  cc-znp      data: <Buffer 1c 34 12 ba 0a 02 ff 4c 06 00 10 00 21 db 0b 21 a8 43 24 03 00 00 00 00 21 e5 00 20 6c> },                                                                                             │
  cc-znp   fcs: 60,                                                                                                                                                                                                │
  cc-znp   csum: 60 } +1s                                                                                                                                                                                          │
  serialport:main _read reading +8ms                                                                                                                                                                               │
  serialport:bindings read +9ms                                                                                                                                                                                    │
  serialport:unixRead Starting read +9ms                                                                                                                                                                           │
  cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 0, srcaddr: 10141, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 28, securityuse: 0, timestamp: 9012405, transseqnumber: 0, len: 29, dat│
  zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +1ms                                                                                                                           │
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +12ms                                                                                                                                                 │
  serialport:unixRead waiting for readable because of code: EAGAIN +14ms                                                                                                                                           │
  serialport:poller Polling for "readable" +25ms                                                                                                                                                                   │
  zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +2ms                                                                                                                        │
  zigbee2mqtt:debug 2018-10-30 17:59:45 Received zigbee message of type 'attReport' with data '{"cid":"genBasic","data":{"65282":[{"elmType":16,"elmVal":0},{"elmType":33,"elmVal":3035},{"elmType":33,"elmVal":173│
  zigbee2mqtt:info 2018-10-30 17:59:45 MQTT publish, topic: 'zigbee2mqtt/door_window_sensor_02', payload: '{"battery":"100.00","voltage":3035,"linkquality":28,"ts":1540918785235,"ls":1230}'                      │
/home/pi/zigbee2mqtt/node_modules/zigbee-shepherd-converters/converters/fromZigbee.js:406                                                                                                                          │
            return {contact: msg.data.data['65281']['100'] === 0};                                                                                                                                                 │
                                                   ^                                                                                                                                                               │
                                                                                                                                                                                                                   │
TypeError: Cannot read property '100' of undefined                                                                                                                                                                 │
    at Object.convert (/home/pi/zigbee2mqtt/node_modules/zigbee-shepherd-converters/converters/fromZigbee.js:406:52)                                                                                               │
    at converters.forEach (/home/pi/zigbee2mqtt/lib/controller.js:319:39)                                                                                                                                          │
    at Array.forEach (<anonymous>)                                                                                                                                                                                 │
    at Controller.handleZigbeeMessage (/home/pi/zigbee2mqtt/lib/controller.js:297:20)                                                                                                                              │
    at Zigbee.handleMessage (/home/pi/zigbee2mqtt/lib/zigbee.js:172:18)                                                                                                                                            │
    at emitOne (events.js:116:13)                                                                                                                                                                                  │
    at ZShepherd.emit (events.js:211:7)                                                                                                                                                                            │
    at ZShepherd.<anonymous> (/home/pi/zigbee2mqtt/node_modules/zigbee-shepherd/lib/shepherd.js:160:14)                                                                                                            │
    at emitMany (events.js:147:13)                                                                                                                                                                                 │
    at ZShepherd.emit (events.js:224:7)

this is just a zigbee message without any information about the door :-)

from zigbee-herdsman-converters.

lolorc avatar lolorc commented on August 20, 2024

weird I was still running with 4.0.9, waiting for sensors to report :)

from zigbee-herdsman-converters.

lolorc avatar lolorc commented on August 20, 2024

looks ok with 4.0.10, Thanks

from zigbee-herdsman-converters.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.