-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
fix: better node initialization #240
Conversation
@ahochsteger could you give this a try? |
Pull Request Test Coverage Report for Build 493662310
💛 - Coveralls |
@robertsLando I just tried out this branch with your changes. Unfortunately it happened again that a battery-powered device (Fibaro Button) results in an "Unknown manufacturer" / "Unknown product", even though zwave-js was able to detect the manufacturer after a "Refresh info": Here are the full logs: I suspect that the problem lies in the fact that if a battery-powered device cannot be fully initialized, zwave-js will eventually set the node to ready without knowing the manufacturer and product. Here are the relevant parts of the logfiles from above: ...
# zwave-js: Ping failed on sleeping device
14:37:15.715 CNTRLR [Node 013] ping failed: The node is asleep
14:37:15.715 CNTRLR » [Node 013] querying node info...
...
# zwave-js: NodeInfo stage completes (failed):
15:12:22.635 CNTRLR [Node 013] querying the node info failed
15:12:22.643 CNTRLR [Node 013] Interview stage completed: NodeInfo
15:12:22.643 CNTRLR [Node 013] WakeUpCC: doing a complete interview...
15:12:22.644 CNTRLR » [Node 013] retrieving wakeup interval from the device...
...
# Button is pressed on the device:
2021-01-17 15:34:42.494 INFO ZWAVE: Node 13: value added: 113-0-Home Security-Sensor status => 2
2021-01-17 15:34:42.554 INFO ZWAVE: Node 13: metadata updated: 91-0-scene-001
2021-01-17 15:34:42.561 INFO ZWAVE: Node 13: value notification: 91-0-scene-001 0
...
# zwave-js signals that the node is now ready to be used (although no manufacturer id and product id is known):
15:59:30.756 CNTRLR [Node 013] Interview completed
15:59:30.779 CNTRLR [Node 013] The node is ready to be used
2021-01-17 15:59:30.542 INFO ZWAVE: Node 13: value added: 132-0-wakeUpInterval => 3600
2021-01-17 15:59:30.542 INFO ZWAVE: Node 13: value added: 132-0-controllerNodeId => 1
2021-01-17 15:59:30.743 INFO ZWAVE: Node 13: value updated: 132-0-wakeUpInterval 3600 => 3600
2021-01-17 15:59:30.745 INFO ZWAVE: Node 13: value updated: 132-0-controllerNodeId 1 => 1
2021-01-17 15:59:30.779 DEBUG GATEWAY: Publishing discovery: {
type: 'sensor',
object_id: 'scene_state_001_scene',
discovery_payload: {
state_topic: 'zwavejs2mqtt/nodeID_13/91/0/scene/001',
value_template: '{{ value_json.value}}',
json_attributes_topic: 'zwavejs2mqtt/nodeID_13/91/0/scene/001',
device: {
identifiers: [ 'zwavejs2mqtt_0xcb10ff7c_node13', [length]: 1 ],
manufacturer: 'Unknown manufacturer undefined',
model: 'undefined (Unknown product undefined)',
name: 'nodeID_13',
sw_version: '1.0.0-beta.0'
},
name: 'nodeID_13_scene_state_001_scene',
unique_id: 'zwavejs2mqtt_0xcb10ff7c_13-91-0-scene-001'
},
discoveryTopic: 'sensor/nodeID_13/scene_state_001_scene/config',
values: [ '91-0-scene-001', [length]: 1 ],
persistent: false,
ignoreDiscovery: false
}
2021-01-17 15:59:30.768 INFO ZWAVE: Node 13: value added 13-132-0-wakeUpInterval => 3600
2021-01-17 15:59:30.778 INFO ZWAVE: Node 13: value added 13-132-0-controllerNodeId => 1
# zwavejs2mqtt completes node initialization as "unknown manufacturer/product":
2021-01-17 15:59:30.779 INFO ZWAVE: Node 13 ready: Unknown manufacturer undefined - Unknown product undefined (Unknown)
2021-01-17 15:59:30.780 INFO ZWAVE: Node 13: interview completed, all values are updated
2021-01-17 15:59:31.860 INFO ZWAVE: Node 13 is now asleep
...
# Manually trigger "Refresh info" for node 13 from zwavejs2mqtt and pressing Fibaro button 6x (for wakeup and send node info)
2021-01-17 19:19:29.797 INFO APP: Zwave api call: refreshInfo [ 13, [length]: 1 ]
2021-01-17 19:19:29.836 INFO ZWAVE: Success zwave api call refreshInfo
2021-01-17 19:19:38.790 INFO ZWAVE: Node 13 is now asleep
2021-01-17 19:19:44.271 INFO ZWAVE: Node 13 is now awake
# Here the manufacturerId, productType and productId are correctly updated:
2021-01-17 19:19:45.380 INFO ZWAVE: Node 13: value added: 114-0-manufacturerId => 271
2021-01-17 19:19:45.382 INFO ZWAVE: Node 13: value added: 114-0-productType => 3841
2021-01-17 19:19:45.383 INFO ZWAVE: Node 13: value added: 114-0-productId => 4096
# zwavejs2mqtt does not update manufacturer and product name in the UI and still shows it as "unknown"
... |
@AlCalzone what I don't understand here is why the ready event is triggered if the node isn't really ready? At least based on the supposition of @ahochsteger seems that when the ready event is triggered we are missing the manufacturer product type and id CCs |
That's it:
Querying the node info fails for some reason, meaning we don't know which CCs are supported. |
So with the linked PR, we now abort the interview if requesting the node info fails. |
here my logs from linux using npm zwavejs2mqtt.log the same devices are well found from raspberry but here there is in logs : here the logs from the raspberry using npm: zwavejs2mqtt.log
|
@bdbogjoe the difference is that log one shows a restart from cache and log two a complete interview, including manufacturer info. |
here the logs from linux, now works fine with this branch ! |
Hm, probably was a fluke. If the issue persists after a refreshInfo, let me know. |
Fixes #217
Fixes #256