Hello there!
I wanted to make a notification flow, that gets the average electricity price aep from a sensor and compares that to the current electricity price cep from another sensor.
This flow sends a notification to my phone on every run (once per hour) about the current price and if the price is below or above average. So far so good, i have got that part working.
This is fine, but 24 notifications a day are quite annoying if it would suffice to get a notification only if the price falls below or rises above the average price.
what i want is the following.
i want to modify the flow to check the price (maybe every 5 minutes) but only notifies me once the cep falls below aep and also once the cep rises obove the aep.
if, for example, the cep was below the aep the last time the flow was running (i.e. run 1 cep = 0.292 aep 0.310) and is below the aep again (i.e.run 2 cep 0.298 aep 0.310), i dont want to get notified.
Basically i only want to get notified if the state changes from cep < aep to cep > aep or cep > aep to cep < aep.
How would i get this state-change-part to work?
I dont want a "drop in solution" from you guys, but a hint in the right direction.
i have no expirience in this stuff, but i want to get a grasp on it an learn, so if someone can come up with a viable idea i am all ears 
I am also fine with the right "searchterm" for the Forum-Search-Function
thanks for your time
(btw, sry if i butchered the english language, obviously it is not my fist language)
