Variables "in memory" usage

I recently noticed that every time I rebooted the hub, some flows stopped working and were producing an error message on if statements related to variables. What I saw was that on reboot, every variable that was flagged “in memory” was deleted until the flow setting that variable activated again.

The fix I’ve tried is to recreate the variables in the flows without the “in memory” box checked.

What is the purpose/meaning of a variable being “in memory”? I (incorrectly) expected it would make the variable more easily accessible, but the result was the opposite.

@espen do you know how selecting “in memory” is different than not selecting it?

The value is stored in memory which is cleared on reboot.
If its not checked it will be stored on disk and be used also after reboot.

1 Like

I dont understand this “in Memory” value.
If I create a global bool variable, and then change it between True and False at different times during the day with the “Set variable->static value->true/false” . But the “in memory” value is always True. It never changes. When is the actual variable value ever written to the “memory”?
I would have guessed the In memory would always store the latest value of the variable, to use later on in other flows ? In that case “value” and “in memory” should always be the same after you change it?
Maybe I have done something strange in my flow, but please explain how it should work :slight_smile:

Edit: or does “In memory = True” simply a status flag meaning that it is stored in memory ?

In memory is a flag that means it is only stored in memory, and not on disk. So after a reboot the variable isn’t there until it is recreated by a flow.

I haven’t found a use for this, but my flows are simple compared to some others.