OpenZWave / node-openzwave-shared

OpenZWave addon for Node.js (all versions) including management and security functions
Other
199 stars 113 forks source link

Name/Location deleted on restart #253

Closed Harel-M closed 5 years ago

Harel-M commented 6 years ago

According to the documentation, the the node's name and location are stored on the device itself. But after I reset my node.js controller application I don't see this values anymore.

I tried fetching it with zwave.getNodeName(nodeid) and zwave.getNodeLocation(nodeid) - After setting the name and location I get the values, but after stop and starting the application the values are empty.

I also see nothing in the openZwave log after calling the getNodeName() and getNodeLocation() functions... (the set function results in one line NodeNaming in the log).

Anyone have any experience with this values?

Thanks,

ekarak commented 5 years ago

Apologies for the confusion, the readme needs changing here.

The node type and manufacturer info are values fetched from the device when the node is first added to the network, and this happens only once. Its name and location are user-definable settings that some devices are able to store and retrieve, so the OZW library caches this in its node data (effectively the zwcfg-xxx.xml file that the underlying OpenZWave library uses to persist the ZWave network to disk). Therefore you need to 1) define the path to that file using the UserPath config property and 2) make sure to call writeConfig() to store that file before you exit your Node.JS app.

ekarak commented 5 years ago

https://github.com/OpenZWave/node-openzwave-shared/commit/01f49f4da5e5b350373adc8821cf2774c27e6b16