Variables on reboot

What happens to a hub "variable" value when a hub reboots? Does it retain the same value before it was rebooted?

I need to monitor a variable in mu hub, but I want to make sure it is not getting cleared or reset after a reboot.

Hub variables are written to the database and are thus preserved through a reboot/power loss.

2 Likes

Note that if you have rules with long delays that set the private boolean false at the start of the rule and true at the end, and the hub reboots while the rule is running, your private boolean will remain false (and keep the rule from triggering again if you're using the private boolean in the required expression). This was happening to me, so I created a rule that sets certain private booleans to true when the system starts up.

3 Likes

thanks guys

This is not true in general; it is true only in the specific case where the timer for your delay is up while the hub is off. Otherwise, a delay (or wait for elapsed time and other scheduled jobs as well as waits in general and other event subscriptions) is written to the database, which is preserved on reboot.

In general, a hub reboot does less than many people think. :smiley:

1 Like

Thanks, that's a good callout... I didn't consider that. But for these rules, better if they get reset to true if the situation happens because it's messed me up before.

1 Like