# \[APP\]\[Pro\] Temporary Variables

**URL:** <https://community.homey.app/t/app-pro-temporary-variables/67482>\
**Category:** Apps\
**Created:** [August 17, 2022, 7:39am UTC](https://community.homey.app/t/app-pro-temporary-variables/67482 "2022-08-17T07:39:51Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [August 17, 2022, 7:39am UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/1 "2022-08-17T07:39:51Z")

</div>

# Temporary Variables

Temporary variables that only exist for the duration that the flow runs.  
**Advanced Flows only 🙂**

 ![xlarge](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/e/ee02ab26a05ba17463cdb505669a4e50394e4199.png)

### Flow Cards

- Calculate floats (e.g. 10.457)
- Calculate numbers (e.g. 10, automatically rounds up or down)
- Simple number
- Simple string
- Simple boolean

### Links

- [Temporary Variables on Homey Store](https://homey.app/a/com.spkes.temporaryVariables/)
- [Temporary Variables on GitHub](https://github.com/spkesDE/TemporaryVariables)
- [Test version of Temporary Variables](https://homey.app/en-gb/app/com.spkes.temporaryVariables/Temporary-Variables/Test)

### Feedback / Bugs

Any requests please post them in the Temporary Variables topic on the Athom Community forum  
Please report issues at the [issues section on Github](https://github.com/spkesDE/TemporaryVariables/issues) otherwise in this topic.

### Would you like to buy me a coffee ☕ or a beer? 🍺

Feel free to [donate](https://www.paypal.com/paypalme/spikes022) to me for my work 🙂 It’s highly appreciated!

#### Check out my other apps

- [[APP][Pro] Telegram](https://community.homey.app/t/66622)
- [[APP][Pro] Insight Trends Reloaded](https://community.homey.app/t/71307)
- [[APP][Pro] Temporary Variables](https://community.homey.app/t/67482)
- [[APP][Pro] VeSync (Levoit)](https://community.homey.app/t/71369)
- [[APP][Pro] Weather by Open-Meteo](https://community.homey.app/t/76977)
- [[App][Pro] Tasmota MQTT](https://community.homey.app/t/app-pro-tasmota-mqtt/26164)

### Changelog

> ### v1.0.0
> 
> - Initial release

---

<div class="post-metadata">

**Author:** ![Mike1233](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mike1233/32/20991_2.png) [@Mike1233](https://community.homey.app/u/Mike1233)\
**Post date:** [August 17, 2022, 8:56am UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/2 "2022-08-17T08:56:36Z")

</div>

The link on the app store “Bezoek forum” is not correct.  
It is linking to the Telegram page of the community.  
But the app Temporary Variables looks nice.

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [August 17, 2022, 9:01am UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/3 "2022-08-17T09:01:16Z")

</div>

Yeah, have to change that later. I didnt want to create the thread before the release

---

<div class="post-metadata">

**Author:** ![Mike1233](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mike1233/32/20991_2.png) [@Mike1233](https://community.homey.app/u/Mike1233)\
**Post date:** [August 17, 2022, 9:04am UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/4 "2022-08-17T09:04:00Z")

</div>

OK, no problem.  
I understand.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [August 17, 2022, 10:02am UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/5 "2022-08-17T10:02:28Z")

</div>

Maybe i am missing something, buth these are just tags, not variables: how can i change/update a variable and than reuse the first token but get the latest value?  
**Is this possible with this app?**

That at least is what i and many more others need: in-flow variables.

But unless i am missing something, this just looks (mostly) like the buildin create a text/number/yesno tag.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [August 17, 2022, 10:19am UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/6 "2022-08-17T10:19:42Z")

</div>

There are multiple places where in-flow-variables are discussed or “requested”:

- [Advanced Flow — Community Q&A (from Ask Me Anything 05-07-2022) - Questions & Help - Homey Community Forum](https://community.homey.app/t/advanced-flow-community-q-a-from-ask-me-anything-05-07-2022/65579/229)
- [Advanced Flows - Temporary Variables - Ideas & Suggestions - Homey Community Forum](https://community.homey.app/t/advanced-flows-temporary-variables/67220)

A, i see you response there 😉

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [August 17, 2022, 10:19am UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/7 "2022-08-17T10:19:46Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> Is this possible with this app?

Not with this version, I could create a system for that. But you would have a new token everytime the variable changes. I can‘t think about a system that would currently allow to change a tag value after it was created. maybe i‘m missing something in the sdk, i‘ll take a look once I have some free time.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [August 17, 2022, 10:27am UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/8 "2022-08-17T10:27:08Z")

</div>

Yeah, i know, i have been banging my head on it also, allready tried it a couple of ways.  
But without a currentRunningFlowId it would need at least 2 flowcards to use and you would need the user to fill in the uniqueId-tag to retrieve the unique in-flow-value.  
So not very user friendly.  
But since the buildin (general) variables just requires one flowcard to set and no flow card to use, it is, at least for me, still the easier way (except that it is not scoped).

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [August 17, 2022, 12:23pm UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/9 "2022-08-17T12:23:05Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> you would need the user to fill in the uniqueId-tag to retrieve the unique in-flow-value.

Yes and then u have global variables again in a another name.

I mainly created the app for me to have a simple math card that doesnt require a text to int parse.

---

<div class="post-metadata">

**Author:** ![Quenderin](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/quenderin/32/57449_2.png) [@Quenderin](https://community.homey.app/u/Quenderin)\
**Post date:** [February 25, 2023, 1:59pm UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/10 "2023-02-25T13:59:05Z")

</div>

Would be very useful if you could add (better) support for multiple variables. Currently if you have multiple variables of the same type they all show up with the same name, so it is hard to identify them from each other. Maybe add a field the THEN card where you can name the variable?

It would also be great if you could add an optional “with decimal points” field to the float variable THEN card. It would give us better flexibility. Sometimes I have to reduce decimals to 1 before I for instance send it to a device. Would be nice if this was possible to do at the same time as the number was created.

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [February 25, 2023, 3:16pm UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/11 "2023-02-25T15:16:40Z")

</div>

> [@Quenderin](#):
>
> Would be very useful if you could add (better) support for multiple variables. Currently if you have multiple variables of the same type they all show up with the same name, so it is hard to identify them from each other. Maybe add a field the THEN card where you can name the variable?

Sadly, the Homey SDK does not support dynamic token naming. Unfortunately, they had to have pre-defined.

> [@Quenderin](#):
>
> It would also be great if you could add an optional “with decimal points” field to the float variable THEN card. It would give us better flexibility. Sometimes I have to reduce decimals to 1 before I for instance send it to a device. Would be nice if this was possible to do at the same time as the number was created.

You mean a way to round a number to a decimal? e.g. 0.0006 to 0.001

---

<div class="post-metadata">

**Author:** ![Tjar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tjar/32/61177_2.png) [@Tjar](https://community.homey.app/u/Tjar)\
**Post date:** [September 26, 2023, 6:41am UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/12 "2023-09-26T06:41:24Z")

</div>

Hey wow, I was already looking for something like this!  
I expected this to be integrated in homey by default but wasn’t.  
Great job!

---

<div class="post-metadata">

**Author:** ![vletroye](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vletroye/32/101044_2.png) [@vletroye](https://community.homey.app/u/vletroye)\
**Post date:** [February 18, 2024, 9:01pm UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/14 "2024-02-18T21:01:04Z")

</div>

Being a newbie with Homey, I need some help to properly use your App.

I have created a text variable “Scenes” which contains the following string :  
`Rest,#ffa028,Relax,#ffb854,Read,,Concentrate,#ffe8c0,Energize,#fffefd,Cool bright,#ffe3b5,Bright,#ffc875,Dimmed,#ffc671,Nightlight,#ff6c0ff`

For testing purpose, I take the 2nd element of that string to put in a temporary variable, using the formula {{ (‘Scenes’.split(‘,’)[2]) }}

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/a/2a8f4b80f0151727bd6bff3d44d70574aad08073.png)

But for some reasons, double quotes are added to the value

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/b/bb0af257977e97d8a4662a9b1469eb781ac5d996.png)

And due to these quotes, my next card, assumed to get a, RGB code via the temporary string, fails:

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/7/77df60032deb0f8bf800e53cfbfd808b337ab05c.png)

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/f/df200d582058d83d248e044dcf6df850488a94ac.png)

Any idea what I am doing wrong ? I guess it’s due to the formula (split) as I don’t get extra quotes when I use a simple text variable instead of a formula \*…

V.

[\*]. I did try with a json in my variable Scenes instead of an “array”, and with a simple logic card to get the 2nd element, assigning next the result into a temporary text variable. Then, I get a value without double quotes:

```auto
{"scenes":[{"name":"Rest","rgb":"#ffa028"},{"name":"Relax","rgb":"#ffb854"},{"name":"Read","rgb":"#ffcd80"},{"name":"Concentrate","rgb":"#ffe8c0"},{"name":"Energize","rgb":"#fffefd"},{"name":"Cool rgbght","rgb":"#ffe3b5"},{"name":"rgbght","rgb":"#ffc875"},{"name":"Dimmed","rgb":"#ffc671"},{"name":"Nightlight","rgb":"#ff6c0ff"}]}

```

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/c/acb7befb1bce7a19dfcb0773717146a07c608d10.png)

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [February 18, 2024, 10:28pm UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/15 "2024-02-18T22:28:07Z")

</div>

That’s Homey side. I don’t modify the string at all. Use for this [HomeyScript](https://homey.app/a/com.athom.homeyscript/)

---

<div class="post-metadata">

**Author:** ![vletroye](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vletroye/32/101044_2.png) [@vletroye](https://community.homey.app/u/vletroye)\
**Post date:** [February 20, 2024, 6:31pm UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/16 "2024-02-20T18:31:56Z")

</div>

Thx for the feedback. I will keep my alternative for the moment as, being a newbie, I still need to deep dive the HomeyScript.

---

<div class="post-metadata">

**Author:** ![naehle](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/naehle/32/79073_2.png) [@naehle](https://community.homey.app/u/naehle)\
**Post date:** [February 2, 2025, 4:00pm UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/17 "2025-02-02T16:00:55Z")

</div>

Hi, I am just wondering: How long and within which scope is temporary variable valid?  
E. g., I am using am advanced flow right now that is run every 15 min. - and I need to store a boolean value that is checked the next time the flow is executed, but I don’t need that variable outside of this flow…

Regards

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [February 2, 2025, 5:06pm UTC](https://community.homey.app/t/app-pro-temporary-variables/67482/18 "2025-02-02T17:06:16Z")

</div>

Only while the flow is running
