# Advanced Flow - Use of Variables

**URL:** <https://community.homey.app/t/advanced-flow-use-of-variables/68719>\
**Category:** Questions & Help\
**Tags:** flow, advancedflow\
**Created:** [September 11, 2022, 10:46am UTC](https://community.homey.app/t/advanced-flow-use-of-variables/68719 "2022-09-11T10:46:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Busta999](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/busta999/32/10053_2.png) [@Busta999](https://community.homey.app/u/Busta999)\
**Post date:** [September 11, 2022, 10:46am UTC](https://community.homey.app/t/advanced-flow-use-of-variables/68719/1 "2022-09-11T10:46:05Z")

</div>

I have determined average Whole House Battery State Of Charges (SOC) for all the hours of the day and want to set an alert that I only receive if the current SOC is less than the average SOC - I may need to check everything is working OK.

I have a use case where:-

At 08:00 Get House Battery State of Charge - If SOC \< VARIABLE[AverageBatterySOC08:00] Then Send Message to User “ALERT - Battery SOC is less than Target #TAG SOC, Target VARIABLE 'AverageBATTERYSOC08:00”

1. Cannot work out How to compare a TAG to Variable (assuming both are NUMBERS)
2. Cannot work out how to insert VARIABLES into Text Strings for messages

I have been searching the Forum but was unable to locate the correct search parameters to illicit a useful response.

Anyone any ideas?

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [September 11, 2022, 11:11am UTC](https://community.homey.app/t/advanced-flow-use-of-variables/68719/2 "2022-09-11T11:11:53Z")

</div>

> [@Busta999](#):
>
> 1. Cannot work out How to compare a TAG to Variable (assuming both are NUMBERS)

Logic flow card in the _ **And…** _ section:  
– Number (as tag/variable) is less than Number (as tag/variable)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/4/84032d856c6ff06f042075d263dc6b5aa645e88a.png)

> [@Busta999](#):
>
> 1. Cannot work out how to insert VARIABLES into Text Strings for messages

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

The whole flow will look something like this:

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

---

<div class="post-metadata">

**Author:** ![Busta999](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/busta999/32/10053_2.png) [@Busta999](https://community.homey.app/u/Busta999)\
**Post date:** [September 11, 2022, 11:20am UTC](https://community.homey.app/t/advanced-flow-use-of-variables/68719/3 "2022-09-11T11:20:15Z")

</div>

Thanks!!!

I did not make the leap that a Tag can also be a Variable - got it thanks.

The alternative one I came up with was HUGE!!! Will trim down now with better logic 🙂
