Hi All, I have weather station that captures lightning activity. Every minute, a rule runs that captures the total count for the day and the most recent strike’s distance.
A supertile shows how many lightning strikes and the distance to the last strike. If #WeatherLightningCount > 0 then the tile is highlighted (purple). When the storm passes, it’s still highlighted, but that’s not what I want.
What I want is if the tile #WeatherLightningCount hasn’t changed for 10 minutes, then turn the tile back to its default state (green). The tile will continue to show the strike count for the day, but it reverts to its default color state.
These are my current variables:
#WeatherLightningDistance
#WeatherLightningCount
#WeatherLightningDate (captured in ISO 8601 format)
Alternatively, I think a date function would work too but I don’t know how to have a rule run IF #WeatherLighntingDate is > 10 minute ago, THEN revert the tile to green.
So, I don’t know how to get either option to work .
I suspect that you would need to calculate a separate variable that combines these two conditions into a single variable. If I understand that logic correctly, you want the tile to be highlighted when the LightningCount > 0 and the last strike was within the last 10 minutes?
Here’s an expression with some sample variables that you can play with:
Here’s what I did. I created a variable called #WeatherLightningRecent. Then I built two rules. One updates that variable to either “active-tick” or “active-tock”. A second rule changes the variable to “idle” if the variable stays “active-tick” or “active-tock” for 10 minutes. It does what I want!