Save and Restore Device State

A great feature of webcore was the ability to save and restore device states before making a change. Use scenario: I turn on certain lights when motion is detected outside. This could happen any time, and I’d like to be able to maintain the current state of the light (was it on or off?).

To make it work would require maintaining a state variable for every effected device, and lots of messy logic. So yes, I know I can do it, but this seems like a useful feature at the system level. It would require the ability to designate which devices you want to save the state for, then a mechanism to return those devices to the original state.

Thanks for considering!