Z-wave resend to device not receiving command

Hello.

I’ve got a z-wave network where one switch occasionally doesn’t execute a command sent to it. This also happens to be the one furthest away with no direct connection to controller according to the z-wave network viewer.

This problem is not specific to openhab as I had it with Home Assistant as well. In HA I solved it with automation resending command until device changes state.

Now, according to this thread How to be sure about z-wave device state? item state doesn’t necessarily show actual device state.

This also corresponds with my event log where item state does change.

How would I go about writing a rule in openhab to do resends if I cannot trust/use the item state?

Which version of OH are you using, and what is the Command Poll Period for that device set to? A section of the event log starting with the send command would be helpful.

Hopefully you won’t need this, but you can send the REFRESH command to the device to query its current state.

Sorry, it’s openhabian with openhab2 pkg version 2.5.5-1.
Command Poll Period is set to 1500.

This only happens once or twice over a month so currently I only have event log with items and no z-wave from last night. Switch in question is SwAkvarium.

2020-07-20 22:00:00.009 [ome.event.ItemCommandEvent] - Item 'TimedSwitches' received command OFF
2020-07-20 22:00:00.012 [ome.event.ItemCommandEvent] - Item 'SwKHylla' received command OFF
2020-07-20 22:00:00.027 [ome.event.ItemCommandEvent] - Item 'SwKBank' received command OFF
2020-07-20 22:00:00.045 [ome.event.ItemCommandEvent] - Item 'SwRack' received command OFF
2020-07-20 22:00:00.062 [ome.event.ItemCommandEvent] - Item 'SwAkvarium' received command OFF
2020-07-20 22:00:00.082 [nt.ItemStatePredictedEvent] - SwKHylla predicted to become OFF
2020-07-20 22:00:00.093 [nt.ItemStatePredictedEvent] - SwKBank predicted to become OFF
2020-07-20 22:00:00.117 [nt.ItemStatePredictedEvent] - SwRack predicted to become OFF
2020-07-20 22:00:00.128 [nt.ItemStatePredictedEvent] - SwAkvarium predicted to become OFF
2020-07-20 22:00:00.142 [GroupItemStateChangedEvent] - TimedSwitches changed from OFF to ON through SwKHylla
2020-07-20 22:00:00.145 [vent.ItemStateChangedEvent] - SwKHylla changed from ON to OFF
2020-07-20 22:00:00.147 [vent.ItemStateChangedEvent] - SwKBank changed from ON to OFF
2020-07-20 22:00:00.149 [vent.ItemStateChangedEvent] - SwRack changed from ON to OFF
2020-07-20 22:00:00.151 [GroupItemStateChangedEvent] - TimedSwitches changed from ON to OFF through SwAkvarium
2020-07-20 22:00:00.153 [vent.ItemStateChangedEvent] - SwAkvarium changed from ON to OFF

So SendCommand(REFRESH)? I guess the refresh command could get lost as well? Can I somehow distinguish how an item state was achieved?

Increasing the Command Poll Period may help. It goes up to 15s.

How many devices are in your network? If the network is weak, there can be communication bottlenecks. Adding any mains powered device will help strengthen the network.

SwKHylla.sendCommand(RefreshType.REFRESH)

There will be no way to tell when this happens. If the Command Poll Period doesn’t help, I’d look into the health of the network. If you can’t fix it, there’s really no need to write a rule to check the state of the light… just send the command twice.

Thank you! I’ll start with increasing the poll period and see what happens.

This is my network, 24 is the problematic oneScreenshot_20200721_165241
The attributes of 24 says 6 neighbors (8, 17, 18, 23, 26, 27).