Check/Set default variable value

When you create a new variable in a Homey flow, you have to set a value. This value is the default value that the variable is instantiated on when Homey reboots.

Is there a way to check and set these default variable values? I have a value that I would like to change, but cannot find how to do this anywhere.
Deleting the variable and creating a new one with the same name does not work, references are lost.

Does anyone have a solution?

Thanks!

With a Logic card?

I’m not sure if I understand you correctly. However, the last value before the restart is restored, not the “default” value.

And there is a possibility to check the content of a variable after Homey was restarted:

To be able to get this flow card Homey Pro was started, you have to activate the Power User in the Homey smartphone app: More → Settings → Experiments → Power User

Thanks.

I have indeed seen the “restart card”, and have implemented that today. But it is not the last value, but the initial value at creation that is restored after reboot.

It seems silly that there is no way to change the default value…there should be an easier way than creating logic that runs at startup…

Logic cards change the actual value, not the default one…unfortunately

If this would be the case, what it’s definitely not for me, than the most of my flows with variables would not work after a restart. And I have about 130 variables, most of them are yes/no and number variables.

3 Likes

@Perron If the variable were set to default after a restart then Homey has a big problem
Let’s say a default car Light on has as default no.

IF time is 18:00
THEN light on
Variable Light on to yes.

Homey restart.

IF time is 22:00
AND variable Light on =yes
THEN light off.

So the light will not turn off because a restart did set the variable to no.

Is it something like this?

Yes exactly.

I have a variable that holds the set temperature for my airco. It was set to 23 when I created the variable.
The variable was at 25 this morning. After reboot it was back to 23.

Problem is that this happens also when Homey gets a new software release.

Please contact Athom Support!!!

1 Like

With which card?

Just FIY you can view (and edit) all variables’ current values here (the 3 squares button):
image

In the mobile app: goto …More > Variables

Indeed Variables should absolutely not get changed SOLELY by a restart event;
TAGS however, provided by the apps & devices, of course can change at any time.

It’s easy to monitor a variable, just create a flow like this:
Screenshot from 2024-09-06 14-45-11

Not with a card, but through the menu item…

Your issue ia not as it should be. The last value is always stored, there is no “default” value in a variable. Contact Athom Support regarding your issue.

That could be just the case. You have to make a better testplan to be shure: make a variable with a value with the menu, change it once with a flow. And check its value before and after a restart.

Thank you all for your replies.

Last week my Homey got ‘stuck’ and I rebooted. My airco variable was back at 23. Today I rebooted again, and my airco started up, because of 23.

Today I did several tests and it did not go back to 23. So I am confused, and will monitor future reboots.
For now, it seems that all is ok, although it was not a few times this week.

Thanks again for your insights, a variable should come back to its last value, and that sounds ok.

That is what I did. And today it all worked fine.
I will monitor future reboots, as it has gone wrong at least three times. But I cannot reproduce…

Maybe you found a “bug”. Keep monitoring and report to Athom your findings.

@Perron Maybe the device lost the connection and after the Homey restart the connection was back and did change the valua after connection.