# Once only notifications

**URL:** <https://community.homey.app/t/once-only-notifications/106451>\
**Category:** Questions & Help\
**Tags:** flow, homey-pro\
**Created:** [March 17, 2024, 2:37am UTC](https://community.homey.app/t/once-only-notifications/106451 "2024-03-17T02:37:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Bittner](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_bittner/32/16698_2.png) [@Peter\_Bittner](https://community.homey.app/u/Peter_Bittner)\
**Post date:** [March 17, 2024, 2:37am UTC](https://community.homey.app/t/once-only-notifications/106451/1 "2024-03-17T02:37:26Z")

</div>

I am looking for some logic help. I want to be notified when a variable (BatterySoC) reaches a certain value. But I only want to be notified once. So set a flag and test it before being notified. The problem is that it has to be reset at some time. The problem I have is that even when it is set under certain conditions I still keep getting notified for some reason, maybe because the flag gets reset.  
So I’m looking to your collective experience to come up with a better way.  
Might this be better done in Homey Script?

Here is an example of the flow I developed.

 ![Screenshot 2024-03-17 at 12.14.10 pm](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/e/ee7f7f890aad2ac81c62e455c5d1ad8875530487.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 17, 2024, 3:25am UTC](https://community.homey.app/t/once-only-notifications/106451/2 "2024-03-17T03:25:28Z")

</div>

I think this should do, Peter.

When…  
-logic value X changed  
And…  
-logic value X is less than 500  
-logic [powerfromgridnotified] is No  
Then…  
-send notification power is imported from grid (less than 500W)  
-set logic [powerfromgridnotified] to Yes  
Else…  
-set logic [powerfromgridnotified] to No

This should send a notification when value X is below 500,  
and when the logic switch [powerfromgridnotified] is set to No.  
It also sets the logic switch to Yes.

Now, when value X changed, and it’s is _again_ below 500, it won’t send a notif, while [powerfromgridnotified] is Yes.

Only when value X changed to _greater_ than 500, it sets the logic switch [powerfromgridnotified] to No.

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [March 17, 2024, 3:25am UTC](https://community.homey.app/t/once-only-notifications/106451/3 "2024-03-17T03:25:55Z")

</div>

During the day the power will rise several times above 500 and will fall below 500 as clouds go by. So you have to set Setpowerfromgrid to no at midnight in a second flow.

---

<div class="post-metadata">

**Author:** ![Peter\_Bittner](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_bittner/32/16698_2.png) [@Peter\_Bittner](https://community.homey.app/u/Peter_Bittner)\
**Post date:** [March 17, 2024, 5:00am UTC](https://community.homey.app/t/once-only-notifications/106451/4 "2024-03-17T05:00:19Z")

</div>

Thanks guys
