Not a programmer but trying to figure out how to do this. I'd like Alexa to announce whenever wind gusts exceed certain threshold peaks in say, 10mph increments with Rule Machine. Where I'm stuck is, lets say the first wind gust to announce is over 40mph. Alexa announces this. Then, over time it exceeds 50mph and Alexa announces this. Then 60 etc. If the wind drops below 40, then back up to 60, she will announce all of those again. I want her to announce only when gusts are increased by a value and never the previous lower gust speeds.
So specifically, I'm stuck at how do I increment a trigger starting at a certain threshold? If I create a variable "Wind Gust" and make it 40, I can trigger on > 40. But once it triggers on > 40, it needs to only trigger on > 50 and so on. Not sure how to do go about incrementing this variable trigger or am I even on the right path on thinking how to do this? Thanks for the help.
Will you be resetting the threshold value every, say, midnight? Also, it would be instructive to see screenshots of your existing rule (include Trigger, Actions and Variables section) for reference.
P.S. Yes, this can be easily achieved. I just want to base my suggestion off your rule's current layout.
Completely agree with the logic flow proposed by @ogiewon , but took it a step further to wrap both functions ("exceeds threshold" and "reset at midnight") into a single rule:
The IF-THEN section simply checks whether the threshold has NOT been exceeded (meaning "Time" has triggered the rule), in which case it resets the local threshold variable and exits.
Hope this construct makes sense. Note that I haven't quite implemented the "raise threhold by 10" requirement of the OP, but that would be an easy thing to adjust (in the final "Set" action). My rule instead keeps reporting new maximum wind speeds with decimal precision.
I like what you did @harmony. I'm going to have to give your's more thought. Since storms (or hurricanes) come and go over time, I don't think a threshold reset at a specific time would be ideal. Maybe have another rule as @ogiewon suggested trigger at the same time with a Wait for Event - Elapsed Time = 24hrs, then reset variable back to 40.
I like your rule a lot since it leverages hub variables (which are visible to other rules and arguably easier to edit in the future), and correctly bumps the threshold by +10 at execution. Good choice of Trigger, too! Lots of ways to skin that cat, but bonus points for being concise.
Thanks for the assistance @ogiewon and @harmony7. This opens up some new possibilities. Also appreciate the sharing of your programming logic vs my (non) programming logic. It really helps out.