A way to remember the previous state of a device?

When I have Vera turn something on it always defaults to the default. So it will turn a light on to 100% or when it turns a Russound zone on it goes to the zone default. Is there a way to have Vera remember the last value before it was turned off? I’ve looked at the Vcontainer but I can’t seem to find a way have the value stay after it’s turned off.

Just an idea,

Maybe you could use ‘luup.variable_watch’ to keep an eye on those certain variable values e.g loadlevel and then when ever it changes, you write the new value to an unused or new variable field on the device, however in your code, you would set it so that it does not write the values you don’t want, like off (0)

Then when you turn something on or start something up - it could look for it being swithed on and it then pull back and applies that Previous Value from that field.

There’s likely to be easier ways to code it, but I assumed if memory was used to store it, you would lose it on a restart - anyway I thought I’d share my idea :slight_smile: