# Send email if variable is \< x but only once

**URL:** <https://community.homey.app/t/send-email-if-variable-is-x-but-only-once/126998>\
**Category:** Questions & Help\
**Created:** [January 8, 2025, 10:12am UTC](https://community.homey.app/t/send-email-if-variable-is-x-but-only-once/126998 "2025-01-08T10:12:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![widameista](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/widameista/32/23333_2.png) [@widameista](https://community.homey.app/u/widameista)\
**Post date:** [January 8, 2025, 10:12am UTC](https://community.homey.app/t/send-email-if-variable-is-x-but-only-once/126998/1 "2025-01-08T10:12:16Z")

</div>

Scenario:  
Water tank → variable from 0 to 100%  
I want to get an email when variable is less than 10, but only once.  
Currently my flow is simply:  
If Variable has changes  
and Variable is less than 10  
THEN send email

this triggers a lot of emails, as every change will fire.

i’m looking for an elegant way to only get one email until level is above 10 again!

Thanks

---

<div class="post-metadata">

**Author:** ![ricercar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ricercar/32/101928_2.png) [@ricercar](https://community.homey.app/u/ricercar)\
**Post date:** [January 8, 2025, 10:28am UTC](https://community.homey.app/t/send-email-if-variable-is-x-but-only-once/126998/2 "2025-01-08T10:28:23Z")

</div>

Why don’t you add another boolean variable “mailsent” ?

---

<div class="post-metadata">

**Author:** ![widameista](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/widameista/32/23333_2.png) [@widameista](https://community.homey.app/u/widameista)\
**Post date:** [January 8, 2025, 10:48am UTC](https://community.homey.app/t/send-email-if-variable-is-x-but-only-once/126998/3 "2025-01-08T10:48:25Z")

</div>

thats the easiest way, but i was curious, if there is any other way without additional status variables…  
thanks

---

<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:** [January 8, 2025, 10:53am UTC](https://community.homey.app/t/send-email-if-variable-is-x-but-only-once/126998/4 "2025-01-08T10:53:56Z")

</div>

Maybe this one:  
If Variable has changes  
And Variable is exactly 10 (or maybe 9) %  
Then…

Another one:  
If Variable has changes  
And Variable is \< 10 %  
And Variable is \> 8 %  
Then…

Of course, I don’t know if such a situation can happen, or if the variable is only updated for example every x minutes and then a jump from 11 to 8 % is theoretically possible. In this case no email will be sent.  
Furthermore I don’t know how exactly the percents are reported, with or without decimals. For example, if the following values are reported: 9.9 / 9.8 / 9.7 and so on, then several emails would also be sent.

Another one:  
Deactivate the flow with a second flow, if the variable has changed \< 10 %. And activate the flow again if the variable has changed to \> 10 %.

---

<div class="post-metadata">

**Author:** ![ricercar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ricercar/32/101928_2.png) [@ricercar](https://community.homey.app/u/ricercar)\
**Post date:** [January 8, 2025, 11:02am UTC](https://community.homey.app/t/send-email-if-variable-is-x-but-only-once/126998/5 "2025-01-08T11:02:43Z")

</div>

why the easy way indeed if there is more complicated ? 🤣

---

<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:** [January 9, 2025, 1:50am UTC](https://community.homey.app/t/send-email-if-variable-is-x-but-only-once/126998/6 "2025-01-09T01:50:53Z")

</div>

We humans have our quirks I guess 😜😉

---

<div class="post-metadata">

**Author:** ![widameista](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/widameista/32/23333_2.png) [@widameista](https://community.homey.app/u/widameista)\
**Post date:** [January 9, 2025, 1:13pm UTC](https://community.homey.app/t/send-email-if-variable-is-x-but-only-once/126998/7 "2025-01-09T13:13:58Z")

</div>

thats how i solved it …

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

---

<div class="post-metadata">

**Author:** ![ricercar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ricercar/32/101928_2.png) [@ricercar](https://community.homey.app/u/ricercar)\
**Post date:** [January 9, 2025, 3:12pm UTC](https://community.homey.app/t/send-email-if-variable-is-x-but-only-once/126998/8 "2025-01-09T15:12:07Z")

</div>

The 3rd line seems superfluous. You could toggle the boolean and send the mail in the same breath.Couldn;t you ?

---

<div class="post-metadata">

**Author:** ![DirkH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkh/32/78952_2.png) [@DirkH](https://community.homey.app/u/DirkH)\
**Post date:** [January 9, 2025, 3:18pm UTC](https://community.homey.app/t/send-email-if-variable-is-x-but-only-once/126998/9 "2025-01-09T15:18:21Z")

</div>

Hi @ricercar ,  
You could if you check the status of the boolean variable, but for readability it seems to me as good as it is - with the third line.
