Wind gust announcer

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.

Jeff

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.

I would say resetting the threshold value 24hrs past the initial trigger would work. I forgot to mention that earlier.

I don't have any screenshots of the rule as I haven't created it yet since I can't get past how to create a trigger for it.

The Alexa stuff I already know how to do, just need some ideas on how someone else may do this.

My thinking is something like a trigger staircase. Once the first step is reached - announce. Then the next step is reached - announce and so on.

Jeff

Trigger could simply be "Wind Speed" 'Changes'

Create a local variable 'SpeedThreshold' to hold the initial threshold that is reset each day via another rule (e.g. SpeedThreshold = 40)

Add a conditional action

IF Wind Speed GreaterThan SpeedThreshold Then
  Set SpeedThreshold = SpeedThreshold + 10
  Announce "Windspeed is currently %value%"
END IF
1 Like

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.

1 Like

Ok, came up with this. Should work, correct?

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.

Jeff

2 Likes

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.

1 Like

For some additional ideas, here is a rule I use. I have it set to only notify me once every hour.

I get wind gust in another rule that fills a global that is put on the dashboard.

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.

Jeff

1 Like