I have a simple rule that announces weather wind variables derived from Openweathermap when wind direction changes. I'd like to report the old variable value and the new value as in, "The wind direction has changed from 013 degrees to 090 degrees. How do I save the old variable value before it changes?
Use a local variable that you update to the current value at the end of your rule so that when the rule begins it will hold the previous value.
Thank you very much. Perfect.
Doing what you wanted?
You should be explicit in closing an If statement with with an End If.
And place the variable updates outside the If so you truly get the last update and not the last update that happen between your time range. Unless that is what you are wanting.
It worked for half a day and now reports the same value for old as for new. I will restructure the rule to clean it up.
Okay, it's working. Not the most elegant solution. Clearly, I don't understand how global variables work.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.