I had been using the setVariable attribute in the Virtual Omni Sensor to store store per-user data used in rules. But does that data persist after a hub restart? Recently the values in the omni sensor were not correct and I suspect it was due to a hub restart / upgrade.
The reason I store data in a device and not a global variable is because my workflow is to update a template rule and then update per-user rules by cloning the template... and the cloning process nicely prompts for the update of devices.
So is the persistency of device states/attributes dependent on who/how the device code is written? Meaning I would need to test it by setting a device attribute, reboot, and then see if the attribute is the same?
Not generally, no. Reboot is generally a no-op as to all devices and apps, certainly to their states. It would take explicit effort for a driver or app to intentionally deal with reboot. This is done in certain drivers, such as the Lutron Telnet driver that needs to reestablish a connection upon system start. But, in general, device state and attributes are not affected by reboot. Device attribute values are certainly expected to be the same after a reboot as they were before.