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] Error related to smoke detector CC Notification #948

Closed
crxporter opened this issue Mar 26, 2021 · 2 comments · Fixed by #950
Closed

[bug] Error related to smoke detector CC Notification #948

crxporter opened this issue Mar 26, 2021 · 2 comments · Fixed by #950
Assignees
Labels
bug Something isn't working

Comments

@crxporter
Copy link
Contributor

crxporter commented Mar 26, 2021

Checklist:

[x] I am not using HomeAssistant.
[x] I have checked the troubleshooting section and my problem is not described there.
[x] I have read the changelog problem was not mentioned there.

Build/Run method

[ ] Docker
[ ] PKG
[ ] Snap package
[x] Manually built (git clone - npm install - npm run build )

zwavejs2mqtt version: 7.0.0
zwave-js version: 3.0.1

Describe the bug

I am getting regular restarts which seem to be connected to my smoke detector nodes. The JSON esport of the node in question is here:

{"id":49,"deviceId":"312-3-1","manufacturer":"First Alert (BRK Brands Inc)","manufacturerId":312,"productType":1,"productId":3,"name":"Smoke","loc":"Bath","values":[{"id":"49-112-0-1","nodeId":49,"commandClass":112,"commandClassName":"Configuration","endpoint":0,"property":1,"propertyName":"SuperVision report timeout","type":"number","readable":true,"writeable":true,"description":"ZCOMBO will send the message over SuperVision Command Class and it will wait for the SuperVision report from the Controller for the SuperVision report timeout time.","label":"SuperVision report timeout","default":1500,"stateless":false,"min":500,"max":5000,"unit":"seconds","list":false,"value":1500,"lastUpdate":1616736002749,"newValue":1500},{"id":"49-112-0-2","nodeId":49,"commandClass":112,"commandClassName":"Configuration","endpoint":0,"property":2,"propertyName":"SuperVision retry count","type":"number","readable":true,"writeable":true,"description":"If the SuperVision report is not received within the SuperVision report timeout time, the ZCOMBO will retry sending the message again. Upon exceeding the max retry, the ZCOMBO device will send the next message available in the queue.","label":"SuperVision retry count","default":1,"stateless":false,"min":0,"max":5,"list":false,"value":1,"lastUpdate":1616736002750,"newValue":1},{"id":"49-112-0-3","nodeId":49,"commandClass":112,"commandClassName":"Configuration","endpoint":0,"property":3,"propertyName":"SuperVision wait time","type":"number","readable":true,"writeable":true,"description":"Before retrying the message, ZCOMBO will wait for the SuperVision wait time. Actual wait time is calculated using the formula: Wait Time = SuperVision wait time base-value + random-value + (attempt-count x 5 seconds). The random value will be between 100 and 1100 milliseconds.","label":"SuperVision wait time","default":5,"stateless":false,"min":1,"max":60,"unit":"s","list":false,"value":5,"lastUpdate":1616736002752,"newValue":5},{"id":"49-113-0-Smoke Alarm-Sensor status","nodeId":49,"commandClass":113,"commandClassName":"Notification","endpoint":0,"property":"Smoke Alarm","propertyName":"Smoke Alarm","propertyKey":"Sensor status","propertyKeyName":"Sensor status","type":"number","readable":true,"writeable":false,"label":"Sensor status","stateless":false,"ccSpecific":{"notificationType":1},"min":0,"max":255,"list":true,"states":[{"text":"idle","value":0},{"text":"Smoke detected","value":2}],"value":0,"lastUpdate":1616736002753,"newValue":0},{"id":"49-113-0-Smoke Alarm-Alarm status","nodeId":49,"commandClass":113,"commandClassName":"Notification","endpoint":0,"property":"Smoke Alarm","propertyName":"Smoke Alarm","propertyKey":"Alarm status","propertyKeyName":"Alarm status","type":"number","readable":true,"writeable":false,"label":"Alarm status","stateless":false,"ccSpecific":{"notificationType":1},"min":0,"max":255,"list":true,"states":[{"text":"idle","value":0},{"text":"Smoke alarm test","value":3},{"text":"Alarm silenced","value":6}],"value":0,"lastUpdate":1616736002755,"newValue":0},{"id":"49-113-0-CO Alarm-Sensor status","nodeId":49,"commandClass":113,"commandClassName":"Notification","endpoint":0,"property":"CO Alarm","propertyName":"CO Alarm","propertyKey":"Sensor status","propertyKeyName":"Sensor status","type":"number","readable":true,"writeable":false,"label":"Sensor status","stateless":false,"ccSpecific":{"notificationType":2},"min":0,"max":255,"list":true,"states":[{"text":"idle","value":0},{"text":"Carbon monoxide detected","value":2}],"value":0,"lastUpdate":1616736002756,"newValue":0},{"id":"49-113-0-CO Alarm-Maintenance status","nodeId":49,"commandClass":113,"commandClassName":"Notification","endpoint":0,"property":"CO Alarm","propertyName":"CO Alarm","propertyKey":"Maintenance status","propertyKeyName":"Maintenance status","type":"number","readable":true,"writeable":false,"label":"Maintenance status","stateless":false,"ccSpecific":{"notificationType":2},"min":0,"max":255,"list":true,"states":[{"text":"idle","value":0},{"text":"Replacement required, End-of-life","value":5}],"value":0,"lastUpdate":1616736002758,"newValue":0},{"id":"49-113-0-CO Alarm-Alarm status","nodeId":49,"commandClass":113,"commandClassName":"Notification","endpoint":0,"property":"CO Alarm","propertyName":"CO Alarm","propertyKey":"Alarm status","propertyKeyName":"Alarm status","type":"number","readable":true,"writeable":false,"label":"Alarm status","stateless":false,"ccSpecific":{"notificationType":2},"min":0,"max":255,"list":true,"states":[{"text":"idle","value":0},{"text":"Alarm silenced","value":6}],"value":0,"lastUpdate":1616736002759,"newValue":0},{"id":"49-113-0-System-Hardware status","nodeId":49,"commandClass":113,"commandClassName":"Notification","endpoint":0,"property":"System","propertyName":"System","propertyKey":"Hardware status","propertyKeyName":"Hardware status","type":"number","readable":true,"writeable":false,"label":"Hardware status","stateless":false,"ccSpecific":{"notificationType":9},"min":0,"max":255,"list":true,"states":[{"text":"idle","value":0},{"text":"System hardware failure","value":1}],"value":0,"lastUpdate":1616736002761,"newValue":0},{"id":"49-114-0-manufacturerId","nodeId":49,"commandClass":114,"commandClassName":"Manufacturer Specific","endpoint":0,"property":"manufacturerId","propertyName":"manufacturerId","type":"number","readable":true,"writeable":false,"label":"Manufacturer ID","stateless":false,"min":0,"max":65535,"list":false,"value":312,"lastUpdate":1616736002762,"newValue":312},{"id":"49-114-0-productType","nodeId":49,"commandClass":114,"commandClassName":"Manufacturer Specific","endpoint":0,"property":"productType","propertyName":"productType","type":"number","readable":true,"writeable":false,"label":"Product type","stateless":false,"min":0,"max":65535,"list":false,"value":1,"lastUpdate":1616736002764,"newValue":1},{"id":"49-114-0-productId","nodeId":49,"commandClass":114,"commandClassName":"Manufacturer Specific","endpoint":0,"property":"productId","propertyName":"productId","type":"number","readable":true,"writeable":false,"label":"Product ID","stateless":false,"min":0,"max":65535,"list":false,"value":3,"lastUpdate":1616736002765,"newValue":3},{"id":"49-128-0-level","nodeId":49,"commandClass":128,"commandClassName":"Battery","endpoint":0,"property":"level","propertyName":"level","type":"number","readable":true,"writeable":false,"label":"Battery level","stateless":false,"min":0,"max":100,"unit":"%","list":false,"value":95,"lastUpdate":1616736002767,"newValue":95},{"id":"49-128-0-isLow","nodeId":49,"commandClass":128,"commandClassName":"Battery","endpoint":0,"property":"isLow","propertyName":"isLow","type":"boolean","readable":true,"writeable":false,"label":"Low battery level","stateless":false,"list":false,"value":false,"lastUpdate":1616736002768,"newValue":false},{"id":"49-132-0-wakeUpInterval","nodeId":49,"commandClass":132,"commandClassName":"Wake Up","endpoint":0,"property":"wakeUpInterval","propertyName":"wakeUpInterval","type":"number","readable":false,"writeable":true,"label":"Wake Up interval","default":4200,"stateless":false,"min":4200,"max":4200,"step":0,"list":false,"value":4200,"lastUpdate":1616736002769,"newValue":4200},{"id":"49-132-0-controllerNodeId","nodeId":49,"commandClass":132,"commandClassName":"Wake Up","endpoint":0,"property":"controllerNodeId","propertyName":"controllerNodeId","type":"any","readable":true,"writeable":false,"label":"Node ID of the controller","stateless":false,"list":false,"value":1,"lastUpdate":1616736002771,"newValue":1},{"id":"49-134-0-libraryType","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"libraryType","propertyName":"libraryType","type":"any","readable":true,"writeable":false,"label":"Library type","stateless":false,"list":false,"value":6,"lastUpdate":1616736002772,"newValue":6},{"id":"49-134-0-protocolVersion","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"protocolVersion","propertyName":"protocolVersion","type":"any","readable":true,"writeable":false,"label":"Z-Wave protocol version","stateless":false,"list":false,"value":"6.7","lastUpdate":1616736002773,"newValue":"6.7"},{"id":"49-134-0-firmwareVersions","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"firmwareVersions","propertyName":"firmwareVersions","type":"any","readable":true,"writeable":false,"label":"Z-Wave chip firmware versions","stateless":false,"list":false,"value":["11.0","7.0"],"lastUpdate":1616736002775,"newValue":["11.0","7.0"]},{"id":"49-134-0-hardwareVersion","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"hardwareVersion","propertyName":"hardwareVersion","type":"any","readable":true,"writeable":false,"label":"Z-Wave chip hardware version","stateless":false,"list":false,"value":2,"lastUpdate":1616736002776,"newValue":2},{"id":"49-134-0-sdkVersion","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"sdkVersion","propertyName":"sdkVersion","type":"any","readable":true,"writeable":true,"label":"sdkVersion (property)","stateless":false,"list":false,"value":"6.81.6","lastUpdate":1616736002778,"newValue":"6.81.6"},{"id":"49-134-0-applicationFrameworkAPIVersion","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"applicationFrameworkAPIVersion","propertyName":"applicationFrameworkAPIVersion","type":"any","readable":true,"writeable":true,"label":"applicationFrameworkAPIVersion (property)","stateless":false,"list":false,"value":"4.3.0","lastUpdate":1616736002779,"newValue":"4.3.0"},{"id":"49-134-0-applicationFrameworkBuildNumber","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"applicationFrameworkBuildNumber","propertyName":"applicationFrameworkBuildNumber","type":"any","readable":true,"writeable":true,"label":"applicationFrameworkBuildNumber (property)","stateless":false,"list":false,"value":52445,"lastUpdate":1616736002781,"newValue":52445},{"id":"49-134-0-hostInterfaceVersion","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"hostInterfaceVersion","propertyName":"hostInterfaceVersion","type":"any","readable":true,"writeable":true,"label":"hostInterfaceVersion (property)","stateless":false,"list":false,"value":"unused","lastUpdate":1616736002782,"newValue":"unused"},{"id":"49-134-0-hostInterfaceBuildNumber","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"hostInterfaceBuildNumber","propertyName":"hostInterfaceBuildNumber","type":"any","readable":true,"writeable":true,"label":"hostInterfaceBuildNumber (property)","stateless":false,"list":false,"value":0,"lastUpdate":1616736002783,"newValue":0},{"id":"49-134-0-zWaveProtocolVersion","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"zWaveProtocolVersion","propertyName":"zWaveProtocolVersion","type":"any","readable":true,"writeable":true,"label":"zWaveProtocolVersion (property)","stateless":false,"list":false,"value":"6.7.0","lastUpdate":1616736002785,"newValue":"6.7.0"},{"id":"49-134-0-zWaveProtocolBuildNumber","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"zWaveProtocolBuildNumber","propertyName":"zWaveProtocolBuildNumber","type":"any","readable":true,"writeable":true,"label":"zWaveProtocolBuildNumber (property)","stateless":false,"list":false,"value":97,"lastUpdate":1616736002786,"newValue":97},{"id":"49-134-0-applicationVersion","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"applicationVersion","propertyName":"applicationVersion","type":"any","readable":true,"writeable":true,"label":"applicationVersion (property)","stateless":false,"list":false,"value":"11.0.0","lastUpdate":1616736002788,"newValue":"11.0.0"},{"id":"49-134-0-applicationBuildNumber","nodeId":49,"commandClass":134,"commandClassName":"Version","endpoint":0,"property":"applicationBuildNumber","propertyName":"applicationBuildNumber","type":"any","readable":true,"writeable":true,"label":"applicationBuildNumber (property)","stateless":false,"list":false,"value":0,"lastUpdate":1616736002789,"newValue":0}],"groups":[{"text":"Lifeline","value":1,"maxNodes":1,"isLifeline":true,"multiChannel":true},{"text":"Lifeline","value":1,"maxNodes":1,"isLifeline":true,"multiChannel":true}],"neighbors":[10,11,12,13,14,15,17,18,19,2,20,21,22,23,24,25,26,27,28,29,3,30,31,33,34,35,36,37,4,47,5,51,6,8],"ready":true,"available":true,"hassDevices":{},"failed":false,"lastActive":1616736002790,"firmwareVersion":"11.0","isSecure":false,"keepAwake":false,"maxBaudRate":null,"isRouting":true,"isFrequentListening":false,"isListening":false,"inited":true,"hexId":"0x0138-0x0001-0x0003","dbLink":"https://devices.zwave-js.io/?jumpTo=0x0138:0x0001:0x0003:11.0","productLabel":"ZCOMBO","productDescription":"ZCombo-G Smoke/CO Alarm","protocolVersion":3,"zwavePlusVersion":1,"zwavePlusNodeType":0,"zwavePlusRoleType":6,"endpointsCount":0,"isControllerNode":false,"dataRate":40000,"deviceClass":{"basic":4,"generic":7,"specific":1},"status":"Asleep","interviewStage":"Complete","_name":"Smoke (Bath)"}

To Reproduce

Steps to reproduce the behavior:

  1. Start zwavejs2mqtt
  2. Wait for a smoke detector to report
  3. Watch the logs to see errors

Expected behavior

I'm not sure how the error can be fixed, but I'll provide the logs below.

NOTE: I'm running zwavejs2mqtt as a system service - I will put below the logs from the time the CC Notification was received through when my system service was restarted by systemd

Additional context

Logs:

Mar 26 00:19:53 zwavejs npm[390]: 2021-03-26 00:19:53.435 INFO ZWAVE: Node 49 CC Notification {
Mar 26 00:19:53 zwavejs npm[390]:   type: 9,
Mar 26 00:19:53 zwavejs npm[390]:   event: 5,
Mar 26 00:19:53 zwavejs npm[390]:   label: 'System',
Mar 26 00:19:53 zwavejs npm[390]:   eventLabel: 'Heartbeat',
Mar 26 00:19:53 zwavejs npm[390]:   parameters: undefined
Mar 26 00:19:53 zwavejs npm[390]: }
Mar 26 00:19:53 zwavejs npm[390]: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Mar 26 00:19:53 zwavejs npm[390]: TypeError: Cannot read property 'replace' of undefined
Mar 26 00:19:53 zwavejs npm[390]:     at Object.removeSlash (/home/pi/zwavejs2mqtt/lib/utils.js:143:34)
Mar 26 00:19:53 zwavejs npm[390]:     at Gateway.valueTopic (/home/pi/zwavejs2mqtt/lib/Gateway.js:1116:26)
Mar 26 00:19:53 zwavejs npm[390]:     at Gateway.onNotification (/home/pi/zwavejs2mqtt/lib/Gateway.js:342:22)
Mar 26 00:19:53 zwavejs npm[390]:     at ZwaveClient.emit (events.js:314:20)
Mar 26 00:19:53 zwavejs npm[390]:     at ZwaveClient.EventEmitter.emit (domain.js:483:12)
Mar 26 00:19:53 zwavejs npm[390]:     at ZwaveClient.onNodeNotification (/home/pi/zwavejs2mqtt/lib/ZwaveClient.js:716:8)
Mar 26 00:19:53 zwavejs npm[390]:     at ZWaveNode.emit (events.js:314:20)
Mar 26 00:19:53 zwavejs npm[390]:     at ZWaveNode.EventEmitter.emit (domain.js:483:12)
Mar 26 00:19:53 zwavejs npm[390]:     at ZWaveNode.handleNotificationReport (/home/pi/zwavejs2mqtt/node_modules/zwave-js/src/lib/node/Node.ts:2447:10)
Mar 26 00:19:53 zwavejs npm[390]:     at ZWaveNode.handleCommand (/home/pi/zwavejs2mqtt/node_modules/zwave-js/src/lib/node/Node.ts:1861:16)
Mar 26 00:19:53 zwavejs npm[390]: npm ERR! code ELIFECYCLE
Mar 26 00:19:53 zwavejs npm[390]: npm ERR! errno 1
Mar 26 00:19:53 zwavejs npm[390]: npm ERR! zwavejs2mqtt@3.0.1 start: `node bin/www`
Mar 26 00:19:53 zwavejs npm[390]: npm ERR! Exit status 1
Mar 26 00:19:53 zwavejs npm[390]: npm ERR!
Mar 26 00:19:53 zwavejs npm[390]: npm ERR! Failed at the zwavejs2mqtt@3.0.1 start script.
Mar 26 00:19:53 zwavejs npm[390]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Mar 26 00:19:53 zwavejs npm[390]: npm ERR! A complete log of this run can be found in:
Mar 26 00:19:53 zwavejs npm[390]: npm ERR!     /home/pi/.npm/_logs/2021-03-26T05_19_53_563Z-debug.log
Mar 26 00:19:53 zwavejs systemd[1]: zwavejs2mqtt.service: Main process exited, code=exited, status=1/FAILURE
Mar 26 00:19:53 zwavejs systemd[1]: zwavejs2mqtt.service: Failed with result 'exit-code'.
Mar 26 00:19:53 zwavejs systemd[1]: zwavejs2mqtt.service: Service RestartSec=100ms expired, scheduling restart.
Mar 26 00:19:53 zwavejs systemd[1]: zwavejs2mqtt.service: Scheduled restart job, restart counter is at 1.
Mar 26 00:19:53 zwavejs systemd[1]: Stopped zwavejs2mqtt.
Mar 26 00:19:53 zwavejs systemd[1]: Started zwavejs2mqtt.
@crxporter crxporter added the bug Something isn't working label Mar 26, 2021
robertsLando added a commit that referenced this issue Mar 26, 2021
@robertsLando
Copy link
Member

Fix in PR

robertsLando added a commit that referenced this issue Mar 26, 2021
* fix: undefined propertyName in notifications

Fixes #948

* fix: lint issues
@crxporter
Copy link
Contributor Author

Thank you sir! It's working much better with 3.0.2.

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.

2 participants