Thanks, @M874585684875. Solving the underlying issue would be great. I agree that, in an ideal world, I wouldn't have my sensors get out of sync with Hubitat in the first place. I'm not clear whether the Z-Wave and Zigbee protocols themselves guarantee reliable transmission, but we can set that consideration aside.
Here is background information for you to help diagnose the underlying issue: I have a mesh network with 120+ Z-Wave devices, almost all of which are Z-Wave Plus and about half of which are hardwired repeaters, in a two-story 2000-square-foot house (so the mesh network has a lot of redundancy to cover not a particularly large space). I don't have any other Z-Wave hubs or devices or any baby monitor or cordless phone causing interference, and I'm not aware of any neighbors with Z-Wave devices, baby monitors, or cordless phones. The sensors in question are standard Dome motion sensors and Ecolink contact sensors, all Z-Wave Plus, all listed by the Hubitat website as officially supported devices for the platform, and all running the factory-installed default "generic" drivers. All of them have newish batteries (with levels reported above 95). I repair the network after each add/remove of a repeater, most recently yesterday p.m., and the repair doesn't surface any errors. The only apps I have on the hub are the factory-installed Amazon Echo app, Rule Machine, IFTTT integration, and Life360 integration, as well as a single third-party app, Echo Speaks. The intermittent issues were present before I installed Echo Speaks (when I had only factory-installed apps on my hub).
Please let me know if you have any suggestions about what could be causing the underlying issue or how to resolve it.
Hubitat could, for example, give a software contact sensor an "open" action and a "close" action (or a "setState" action that takes open/close as an argument), very much like what virtual sensors already have.
Sounds like you might not use the proposed feature, which is fine. For me, at least, one practical use case is that if I go out the door, close it, and lock up, but then Hubitat reminds me as I'm walking away to close the door (which, Hubitat says, is still open), I would love to have access to a "close" action (callable, for example, as a Custom Action via Rule Machine) so I could sync the software device state to the physical device state without having to open+close the door again. This would enable me to "arm" the contact sensor for security purposes after I have left and closed the door.
To my knowledge, apps and device drivers on the Hubitat platform are still not thread-safe. A variety of related issues are discussed in other places on this forum; here is an example: https://community.hubitat.com/t/thread-synchronization-safety-when-multiple-commands-run-simultaneously