Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] recent binary sensor changes break double taps and other undefined notification events #421

Closed
2 tasks
blhoward2 opened this issue Feb 2, 2021 · 1 comment · Fixed by #422
Closed
2 tasks
Assignees
Labels
bug Something isn't working

Comments

@blhoward2
Copy link
Collaborator

blhoward2 commented Feb 2, 2021

Before submitting a bug please read: https://zwave-js.github.io/zwavejs2mqtt/#/troubleshooting/bug_report

Version

Build/Run method

  • [X ] Docker
  • PKG
  • Manually built (git clone - npm install - npm run build )

zwavejs2mqtt version: 1.0.0
zwavejs version: 6.0.0

Describe the bug

#396 changed the manner in which binary sensors with only two states are handled. As a result, double tap events no longer work because they are not a valueId.list and the nesting of the else statement prevents a sensor_generic being setup. While investigating this, I realized that fixing it by re-nesting the else statement to the correct position broke other notification events that ARE a valueId.list but whose length is longer than 2.

To Reproduce

Steps to reproduce the behavior:

  1. Run the most recent dev image or build from master

Expected behavior

Double taps should keep working as they were

Additional context

MQTT log:

2021-02-01 20:40:37.572 INFO ZWAVE: Node 3 is alive
2021-02-01 20:40:37.725 ERROR GATEWAY: Error while discovering value 3-32-0-event of node 3: Cannot read property 'discovery_payload' of undefined Cannot read property 'discovery_payload' of undefined
TypeError: Cannot read property 'discovery_payload' of undefined
    at Gateway.discoverValue (/usr/src/app/lib/Gateway.js:1828:25)
    at Gateway.onNodeStatus (/usr/src/app/lib/Gateway.js:358:12)
    at ZwaveClient.emit (events.js:314:20)
    at ZwaveClient.EventEmitter.emit (domain.js:483:12)
    at ZwaveClient.onNodeStatus (/usr/src/app/lib/ZwaveClient.js:317:10)
    at ZwaveClient.onNodeReady (/usr/src/app/lib/ZwaveClient.js:361:16)
    at ZWaveNode.emit (events.js:326:22)
    at ZWaveNode.EventEmitter.emit (domain.js:483:12)
    at ZWaveNode.onReadyChange (/usr/src/app/node_modules/zwave-js/src/lib/node/Node.ts:424:19)
    at /usr/src/app/node_modules/zwave-js/src/lib/node/Node.ts:217:10
    at Interpreter.update (/usr/src/app/node_modules/xstate/lib/interpreter.js:255:17)
    at /usr/src/app/node_modules/xstate/lib/interpreter.js:125:23
    at Scheduler.process (/usr/src/app/node_modules/xstate/lib/scheduler.js:60:13)
    at Scheduler.schedule (/usr/src/app/node_modules/xstate/lib/scheduler.js:44:14)
    at Proxy.Interpreter.send (/usr/src/app/node_modules/xstate/lib/interpreter.js:121:29)
    at ZWaveNode.onStatusChange (/usr/src/app/node_modules/zwave-js/src/lib/node/Node.ts:366:21)

After re-nesting the else statement, I get:

2021-02-02 00:02:05.563 ERROR GATEWAY: Error while discovering value 77-113-0-Power Management-Battery maintenance status of node 77: Cannot read property 'discovery_payload' of undefined Cannot read property 'discovery_payload' of undef$
TypeError: Cannot read property 'discovery_payload' of undefined
    at Gateway.discoverValue (/usr/src/app/lib/Gateway.js:1828:25)
    at Gateway.onNodeStatus (/usr/src/app/lib/Gateway.js:358:12)
    at ZwaveClient.emit (events.js:314:20)
    at ZwaveClient.EventEmitter.emit (domain.js:483:12)
    at ZwaveClient.onNodeStatus (/usr/src/app/lib/ZwaveClient.js:317:10)
    at ZwaveClient.onNodeReady (/usr/src/app/lib/ZwaveClient.js:361:16)
    at ZWaveNode.emit (events.js:326:22)
    at ZWaveNode.EventEmitter.emit (domain.js:483:12)
    at ZWaveNode.onReadyChange (/usr/src/app/node_modules/zwave-js/src/lib/node/Node.ts:424:19)
    at /usr/src/app/node_modules/zwave-js/src/lib/node/Node.ts:217:10
    at Interpreter.update (/usr/src/app/node_modules/xstate/lib/interpreter.js:255:17)
    at /usr/src/app/node_modules/xstate/lib/interpreter.js:125:23
    at Scheduler.process (/usr/src/app/node_modules/xstate/lib/scheduler.js:60:13)
    at Scheduler.schedule (/usr/src/app/node_modules/xstate/lib/scheduler.js:44:14)
    at Proxy.Interpreter.send (/usr/src/app/node_modules/xstate/lib/interpreter.js:121:29)
    at ZWaveNode.onStatusChange (/usr/src/app/node_modules/zwave-js/src/lib/node/Node.ts:366:21)

and:

2021-02-02 00:03:34.918 ERROR GATEWAY: Error while discovering value 120-113-0-Heat Alarm-Heat sensor status of node 120: Cannot read property 'discovery_payload' of undefined Cannot read property 'discovery_payload' of undefined
TypeError: Cannot read property 'discovery_payload' of undefined
    at Gateway.discoverValue (/usr/src/app/lib/Gateway.js:1828:25)
    at Gateway.onNodeStatus (/usr/src/app/lib/Gateway.js:358:12)
    at ZwaveClient.emit (events.js:314:20)
    at ZwaveClient.EventEmitter.emit (domain.js:483:12)
    at ZwaveClient.onNodeStatus (/usr/src/app/lib/ZwaveClient.js:317:10)
    at ZwaveClient.onNodeReady (/usr/src/app/lib/ZwaveClient.js:361:16)
    at ZWaveNode.emit (events.js:326:22)
    at ZWaveNode.EventEmitter.emit (domain.js:483:12)
    at ZWaveNode.onReadyChange (/usr/src/app/node_modules/zwave-js/src/lib/node/Node.ts:424:19)
    at /usr/src/app/node_modules/zwave-js/src/lib/node/Node.ts:217:10
    at Interpreter.update (/usr/src/app/node_modules/xstate/lib/interpreter.js:255:17)
    at /usr/src/app/node_modules/xstate/lib/interpreter.js:125:23
    at Scheduler.process (/usr/src/app/node_modules/xstate/lib/scheduler.js:60:13)
    at Scheduler.schedule (/usr/src/app/node_modules/xstate/lib/scheduler.js:44:14)
    at Proxy.Interpreter.send (/usr/src/app/node_modules/xstate/lib/interpreter.js:121:29)
    at ZWaveNode.onStatusChange (/usr/src/app/node_modules/zwave-js/src/lib/node/Node.ts:366:21)
@blhoward2 blhoward2 added the bug Something isn't working label Feb 2, 2021
@blhoward2 blhoward2 changed the title [bug] recent binary sensor changes break double taps [bug] recent binary sensor changes break double taps and other undefined notification events Feb 2, 2021
@varet80
Copy link
Collaborator

varet80 commented Feb 2, 2021

That is something we can fix.

Can you post:

  1. node export
  2. the specific endpointn breaking?

I need to find the bug, I did not face this! but It doesn't mean it does not exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants