Return light to previous level/state?

Is there a way to return a light to a previous level/state after a rule finishes?

In my rule, opening a door takes the closest light and sets it to 100% brightness.

After 10 seconds I’d like to return the light to whatever state it was in previously – either it was off, or whatever level it was set at before.

Is this possible?

@Arvin_Bautista, setting the device state to previous state is not currently supported in Rule Engine. But this similar use case is included in variable request. So user can set the device’s previous state to a variable before changing its state, and set it back from the stored variable value. Does this sound what you were trying to achieve?

Yes, that should work fine (and would obviously be much more robust). This is a feature that currently exists, or this is in development? If it’s the former I’d love to know how to use it, if it’s the latter I can’t wait to get my hands on it!

1 Like

It is still in my list. I have done some early proof of concept, but focus was shifted to other items with higher interests from the community. Showing your interests in community definitely helps us prioritize tasks. :cowboy_hat_face:

@Arvin_Bautista, we have released several Variables related features to SharpTools.io today that should support the scenario here pretty well. See the screenshot below for the quick example that you can store the current dim level to a variable before changing the light’s dim level, and use this variable to resume the light dim level later.

You can find more Variables release details from the post below, and feel free to let me know if you have any questions.