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

Is it possible to backup/export DSK codes? #3296

Closed
schmitzkr opened this issue Sep 21, 2023 · 5 comments
Closed

Is it possible to backup/export DSK codes? #3296

schmitzkr opened this issue Sep 21, 2023 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@schmitzkr
Copy link

Hi there, in the past year I have started using zwave with zwave-js-ui on home assistant and now have several devices. I also have a box of scraps of paper and cardboard that have all the DSK codes for each of my devices.
Is there a way to export this from zwave-js-ui ? (or elsewhere?)

Thanks!

@schmitzkr schmitzkr added the question Further information is requested label Sep 21, 2023
@kpine
Copy link
Contributor

kpine commented Sep 22, 2023

This driver code snippet will print all of the DSKs to the ZUI logs:

const { dskToString } = this.require('@zwave-js/core')
driver.controller.nodes.forEach((node) => {
  if (node.dsk) {
    console.log(node.id, ":", dskToString(node.dsk))
  }
})

Or just extract them from the cache files as mentioned here.

If they are in the SmartStart provisioning list, than can be exported to a JSON file in the UI.

@schmitzkr
Copy link
Author

Thank you, my home assistant instance is running in a container, I have no idea where these cache files are.

I added this snippet and scheduled it, I think its working but I am not able to decipher the log, looking at the snippet I expect to see a series of lines (one for each node) that looks like this 001:85392-40675-66566-65666-45987-32333-32323-98989
where 001 is the nodeID and the string of numbers and dashes is the dsk.
Is this correct?

@kpine
Copy link
Contributor

kpine commented Sep 22, 2023

Thank you, my home assistant instance is running in a container, I have no idea where these cache files are.

The cache files are part of Z-Wave JS UI, nothing to do with Home Assistant. If you are using container, they are in the directory you mapped to the store. Or you can download them from the Store Explorer.

I added this snippet and scheduled it, I think its working but I am not able to decipher the log, looking at the snippet I expect to see a series of lines (one for each node) that looks like this 001:85392-40675-66566-65666-45987-32333-32323-98989 where 001 is the nodeID and the string of numbers and dashes is the dsk. Is this correct?

Sorry, I don't know what you mean by "scheduling". You can just go to "Driver function" in the Advanced Actions menu and run the code immediately. Yes, it logs the node ID and DSK to the ZUI debug logs (which can be opened in another window from Debug, or viewed in the log file) in the format <nodeId> : <dsk>. You can customize the logging to however you want.

@schmitzkr
Copy link
Author

Thanks, I was able to get the DSK from the debug log now.
Scheduling as a cron job in the general settings (this was the first place I found that I could add a snippet)
Thanks again!

@robertsLando
Copy link
Member

Scheduling as a cron job in the general settings (this was the first place I found that I could add a snippet)

This is wrong, you have to execute the driver function from control panel: https://zwave-js.github.io/zwave-js-ui/#/usage/driver_function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants