# How to convert text to number variable

**URL:** <https://community.homey.app/t/how-to-convert-text-to-number-variable/78332>\
**Category:** Questions & Help\
**Tags:** homey-pro, homey-bridge\
**Created:** [March 24, 2023, 4:17pm UTC](https://community.homey.app/t/how-to-convert-text-to-number-variable/78332 "2023-03-24T16:17:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![parody](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/parody/32/67985_2.png) [@parody](https://community.homey.app/u/parody)\
**Post date:** [March 24, 2023, 4:17pm UTC](https://community.homey.app/t/how-to-convert-text-to-number-variable/78332/1 "2023-03-24T16:17:56Z")

</div>

I’m struggling with data type conversion…

I have a web hook event that sets my electricity meter reading every 5 seconds. This will always be a number but the webhook only uses a text tag.

There is a convert text to number-tag card, but it doesn’t seem to do anything to the text tag, make another tag available, or anything. Ultimately I want to set a number variable so I can later use less than/more than logic on it, but i can’t get that far because the flow won’t let me set a number variable to the value of a text tag.

How is this convert card supposed to be used? (I am on homey pro web with local homey bridge)

Thanks

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [March 25, 2023, 8:22am UTC](https://community.homey.app/t/how-to-convert-text-to-number-variable/78332/2 "2023-03-25T08:22:31Z")

</div>

Create a numeric variable  
Use the Logics THEN “calculate a value” card  
Pick your numeric variable and the textvariable as seen in my example flow below.  
 → you should pick the local variable from your webhook.  
Keep in mind to delay the card that is used to use the converted text to num variable, while the action flowcards are fired at once (asynchronious).

> [@MQTT NodeRed values](https://community.homey.app/t/mqtt-nodered-values/60459/4):
>
> If the topic “text” contains only numbers, you can create a numeric variable from the text variable [message received from] Example to “Convert” a textvar which holds only numbers, to a numvar: . If numvar changes, set color to the value stored in [numvar]: Probably this app is interesting to you

---

<div class="post-metadata">

**Author:** ![parody](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/parody/32/67985_2.png) [@parody](https://community.homey.app/u/parody)\
**Post date:** [March 25, 2023, 9:12am UTC](https://community.homey.app/t/how-to-convert-text-to-number-variable/78332/3 "2023-03-25T09:12:03Z")

</div>

@Peter_Kawa Thanks so much, I was using the wrong card. That works using the “calculate a value”. I am still interested to know how the “convert” card is supposed to be used.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [March 25, 2023, 4:49pm UTC](https://community.homey.app/t/how-to-convert-text-to-number-variable/78332/4 "2023-03-25T16:49:02Z")

</div>

You’re welcome, @parody !

> [@parody](#):
>
> I am still interested to know how the “convert” card is supposed to be used.

At first I didn’t get which card you meant, but a bell rang today 😜 , and I found it. I just tested it and it works.

I guess you did not draw a line between the logics card output and other card input, before you tried to make it work.  
Only when the cards are connected, the _local tag_**[Result]** becomes available.

String variable:  
 ![Screenshot from 2023-03-25 17-44-01](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/3/43c608bed9e73c7870a9eb5e9a47850e19e8a400.png)

Flow:

 ![Screenshot from 2023-03-25 17-46-20](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/d/dd050a7d7e4590eda67d0e899778fda81d8ee990.png)

---

<div class="post-metadata">

**Author:** ![parody](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/parody/32/67985_2.png) [@parody](https://community.homey.app/u/parody)\
**Post date:** [March 25, 2023, 8:17pm UTC](https://community.homey.app/t/how-to-convert-text-to-number-variable/78332/5 "2023-03-25T20:17:20Z")

</div>

The homey pro cloud flows do not have lines, just more simple IFTTT style.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [March 25, 2023, 10:03pm UTC](https://community.homey.app/t/how-to-convert-text-to-number-variable/78332/6 "2023-03-25T22:03:51Z")

</div>

Ah my bad.  
On the cloud version, I can’t find this card:

> [@parody](#):
>
> There is a convert text to number-tag card

Or do you get more cards then this set when you have Premium?

 ![Screenshot from 2023-03-25 22-59-49](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/3/73b02da77ba6f14a3297f8d122659c6ceee4ac92.png)

Can you post a screenshot of that card?

---

<div class="post-metadata">

**Author:** ![parody](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/parody/32/67985_2.png) [@parody](https://community.homey.app/u/parody)\
**Post date:** [March 25, 2023, 10:16pm UTC](https://community.homey.app/t/how-to-convert-text-to-number-variable/78332/7 "2023-03-25T22:16:21Z")

</div>

Yes I have 18 in total, here are some of them including those converts

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

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [March 25, 2023, 10:36pm UTC](https://community.homey.app/t/how-to-convert-text-to-number-variable/78332/8 "2023-03-25T22:36:43Z")

</div>

I’m a bit confused about the Homey model you own. 🤗

> [@parody](#):
>
> I am on homey pro web with local homey bridge

> [@parody](#):
>
> homey pro cloud flows

For clarity: Homey Pro = white ball  
Homey Pro 23 = hockey puck  
Homey bridge, an accessory to Homey Cloud (the Homey app without hardware) = hockey puck

That is really odd, the cards with “as xxx-tag” are only available for the advanced flow (with the lines) afaik…  
And advanced flow is only available on Homey Pro

Even on a Pro these cards you show are not available in standard flow (the top to bottom system) because you can’t do anything with the tag in standard flow…

What does HomeyModelName say, when you check here?  
[https://tools.developer.homey.app/tools/system](https://tools.developer.homey.app/tools/system)

This is what Homey Cloud returns:

 ![Screenshot from 2023-03-25 23-25-41](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/2/f2c0dd9155f3500c3eb2afebe4cce3d18c401da7.png)

Only with advanced flow I can choose from the cards you showed

 ![Screenshot from 2023-03-25 23-38-32](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/2/a24d0c1c594bbd5966c10938da020aa9683f42bf.png)

---

<div class="post-metadata">

**Author:** ![parody](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/parody/32/67985_2.png) [@parody](https://community.homey.app/u/parody)\
**Post date:** [March 26, 2023, 6:36am UTC](https://community.homey.app/t/how-to-convert-text-to-number-variable/78332/9 "2023-03-26T06:36:36Z")

</div>

I’m sorry, let me get my terminology correct.

When I said web I mean cloud.

When I said pro I meant premium.

So I have a bridge locally, and cloud premium.

I did it this way to experiment before diving into the pro, with the plan of using the bridge as a satellite in the end.
