Z-Wave sometimes doesn't update state of switch. Nonce failure?

Hello,

So I was thinking I would use the state of one of my Fibaro Walli Switches to also turn on another light.

I.e, when Fibaro state updates to ON → Turn my Zigbee light on. When Fibaro state updates to OFF → Turn my Zigbee light off.

This works, sort of. Randomly this doesn’t work which is quite frustrating. I’d say that on average every 5-10 times the Walli Switch does not get a status update. If I look in the Android app for example it might say it is off, when in fact it is on, and vice versa.

I have tried to look at the logs to figure out why. The only reoccuring thing that seems suspicious is the fact that something to do with the nonce seems to fail randomly.

E.g

2021-06-08 23:00:00.861 [DEBUG] [mmandclass.ZWaveSecurityCommandClass] - NODE 15: SECURITY_ERR No valid NONCE! null
2021-06-08 23:00:01.815 [DEBUG] [mmandclass.ZWaveSecurityCommandClass] - NODE 15: SECURITY_ERR No valid NONCE! null
2021-06-08 23:00:02.199 [DEBUG] [mmandclass.ZWaveSecurityCommandClass] - NODE 15: SECURITY_ERR No valid NONCE! null
2021-06-08 23:00:02.611 [DEBUG] [mmandclass.ZWaveSecurityCommandClass] - NODE 15: SECURITY_ERR NONCE ID invalid! 35<>79
2021-06-08 23:00:02.841 [DEBUG] [mmandclass.ZWaveSecurityCommandClass] - NODE 15: SECURITY_ERR NONCE ID invalid! 35<>79
2021-06-08 23:00:02.881 [DEBUG] [mmandclass.ZWaveSecurityCommandClass] - NODE 15: SECURITY_ERR NONCE ID invalid! 35<>79
2021-06-08 23:00:04.453 [DEBUG] [mmandclass.ZWaveSecurityCommandClass] - NODE 15: SECURITY_ERR NONCE ID invalid! 79<>236

I found some old threads dicussing this but the only conclusion seems to be “bad z-wave devices” or “signal issues”. So is it really that bad that one of the largest manufacturers and a weak signal (1 meter from USB-Z stick and multiple other devices) would cause a two way communication to fail? That surely cannot be the case? If it is, the Z-Wave is a joke and I regret buying any Z-wave devices.

Thread 1: OH2 Z-Wave refactoring and testing... and SECURITY - #1568 by chris
Thread 2:Danalock not reporting status - #13 by chris

Any ideas? The full log of the command and all items is attached. Node 15 is the Fibaro Walli Switch.

I know our own specialist @chris is a master of those kinds of things. Anyone have suggestions or had similar problems?

failing z-wave.txt (117.2 KB)

From a very quick look at your log, it seems that the controller is receiving the same message multiple times. This could be because the device is sending it multiple times, or it could be because the message it routed and also received directly. In any case, the binding only accepts the first command in secure mode - this is to prevent record and reply attacks. What you are effectively seeing is just the binding reporting that it’s ignoring the repeats.

Below is an example from your log -:

Here you see the same message (with nonce ID 35) received 3 times. The first time it is decoded, and you see the meter channel is updated. The subsequent reports that are received almost immediately are ignored.

So, this is fine - no joke, and nothing to worry about :slight_smile: . This is only a debug message, so just disable debug and it will be gone :slight_smile: .

1 Like

Okay, thanks for replying so quickly! So I guess that’s not what causes my issue then. My real concern is that sometimes, seemingly random every 5-15 times I press the switch, the switches state is not updated, hence not triggering my rule.

This of course causes my Z-Wave light and the corresponding Zigbee light to get out of sync. Now in order to turn on the Zigbee light I’d have to turn off the Z-wave switch and then turn it on again, hoping for better luck :frowning:

(Also, I tried to find the log tool you use but I seemed to only find the same broken link in every thread. Is it available anywhere?)

Thank you @chris

I don’t seem to find anything strange though, but of course my Z-wave skills are limited.

Yesterday pretty much every physical button switch sent the state to OH. Today most of the times I turn on or off this light the state does not change at all in OH. This is kind of a major problem as the state in OpenHAB rarely is correct in regards to the actual state of the device…

If you could see nothing else strange in the log, how come my state just seems to disappear into thin air? I mean surely Fibaro can’t have these severe issues in their HomeCenter with the state not updating? Hence it shouldn’t be the device/s. Ideas?

Update:
Attaching a log (test3zwave.txt)
test3zwave.txt (144 KB)

In attached log we can see the following (watch node 15)

  • First the light/switch is off
  • I press the wall switch → The light turns on → Update onoff set to on (as seen in log)-> Openhab shows switch status on
  • I press the wall switch → The light turns off → Update onoff set to off (as seen in log) → Openhab shows switch status off
  • I press the wall switch → The light turns on → No OnOff update in log → OpenHAB shows my light is off, the light is in fact on.

Testing with another identical device in another room (attaching test4zwave.txt). Watch node 5. In this scenario/log:

  • The switch is off
  • I press the wall switch
  • OpenHAB state shows the switch as off, but the light is on
    test4zwave.txt (60 KB)

Testing again with Node 5:
test5zwave.txt (68 KB)

  • First the light/switch is off
  • I press the wall switch → The light turns on → Update onoff set to on (as seen in log)-> Openhab shows switch status on
  • I press the wall switch → The light turns off → Update onoff set to off (as seen in log) → Openhab shows switch status off
  • I press the wall switch → The light turns on → No OnOff update in log → OpenHAB shows my light is off, the light is in fact on.

At least in the last example, the device uses a different command to report the state. It is using the BASIC_SET command to update the state rather than the BINARY_REPORT it uses elsewhere. Probably the database needs to be updated to handle this device differently so that it handles these basic reports.

I have now been comparing here:
OpenSmartHouse Z-Wave Device Database

With the reference manual here:

I can not see what could be wrong from my perspective, but then again, I’m not all that well into all the tricks and details of Z-Wave so I might just have water well above my head. I also tried comparing to Fibaros other dual switches etc but I can not find anything obviously different.

Now that I know the device I’ve made an update to the database.