Knowing the previous mode in a mode change handler

In a mode change handler (subscribe(location, “mode”, modeChangeHandler)) is there a way for me to know the previous mode smartthings was in before changing to the new mode (evt.value)?

I think (still learning) that you’ll have to store the mode when it changes in the “state” object. So the next time it runs you can check what it was the last time.

1 Like