Help Save Variable Value Before Change

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?

Two things.

  1. You should be explicit in closing an If statement with with an End If.

  2. 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. 4DE7C96E-D083-43FA-B909-7458EC2BEE99

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.