Zwave.js fails to load

I see this when it tries to load:

[00:14:10] INFO: Successfully send discovery information to Home Assistant.
Error: failed loading config file /etc/zwave_config.json
Error: Invalid key format for securityKeys.S0_Legacy option
    at normalizeKey (/usr/src/node_modules/@zwave-js/server/dist/bin/server.js:16:11)
    at /usr/src/node_modules/@zwave-js/server/dist/bin/server.js:59:53
    at Object.<anonymous> (/usr/src/node_modules/@zwave-js/server/dist/bin/server.js:118:3)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47
[00:14:11] INFO: Successfully send discovery information to Home Assistant.

I have no idea why this suddenly happened. It was crashed, so I started it, and now it shows this?

Can’t load config because wrong key format
May need open config and fix if not able by UI

1 Like

Have you just updated Z-wave JS to 0.1.41?

1 Like

There seems to be some changes around the security keys recently

It looks like it’s causing problems.

I’d file a github issue

1 Like

Same error for me after updating Z-wave JS to 0.1.41.
Had a quick look and I do not have the file : /etc/zwave_config.json

1 Like

Look here: Z-wave JS stopped working. Most of my home out of order... Here we go again

1 Like

Someone already did

1 Like

It was me… :wink:

2 Likes

Just saw it, and looks like the fix will be released in the beta core update tomorrow.

So either wait until tomorrow for the update, or restore your backup/snapshot prior to updating the addon and restart.

1 Like

Go into the addon configuration and fix the s0_legacy_key setting so it’s in the Z-Wave JS format, not the OZW format. That means instead of 0x11, 0x22, 0x33, ... it’s 112233. No hex prefixes, commas, or spaces. After that, you’ll still need to wait for the update that was already mentioned.

3 Likes

Hi All
Wow, that was a lot of great information. I’m going to roll back, it had done the update automagically.
It’s not a VERY big issue here, as I only have my lock on z-wave, but the lock is rather essential though :slight_smile:

EDIT: And the rollback is done, and it’s working again…

I had the same error.
But changing the key format fixed it! thank you

Can you post an example?

I just tried the same but failed. Using v0.1.42

After upgrading I changed the keyformat and removed ,0x so it’s just one long hexadecimal string, and then it worked.

1 Like

@freshcoast has explained it above:
in the supervisor you go to the configuration of the Z-Wave JS module.
There I changed my s0_legacy_key and network_key.
Mine had these 0x?? hex prefix in it. just remove them like mentioned above.
Than save and reboot ha.



You can see the beginning of my key.
That was written as:
0xF0, 0xC7, …
and now it’s just
F0C7…

1 Like

Thanks all!

You should also empty the network_key field. :wink: That was my mistake…