How to make a variable persistent

Hi everyone,

I hope some of you luup specialists can help. I defined a bool variable the gets set with certain events. I don’t want that variable change upon reboots, because a reboot doesn’t change the state of that state I want to store.
How could I make this variable stick? Since Vera reboot from time to time with no foreseeable reason this is a must for me. I suppose I have to write it somewhere into the file-system, but how?

Anyone?
Thanks in advance

umtauscher

you could write a file, the usual Lua file access does work. But i think it would be much easier to set a variable on a device. Just pick a variable name and call [tt]luup.variable_set()[/tt]

Yes, file access does work - but see http://forum.micasaverde.com/index.php?topic=2024.0

BTW, is there a way to remove a variable set by luup.variable_set()?

There have been several threads on creating virtual devices, which is what I use (and it works flawlessly). Do a search on “virtual device” and you can see for yourself.

Several good threads to start:

http://forum.micasaverde.com/index.php?topic=2138.0
http://forum.micasaverde.com/index.php?topic=2355.0

Thanks, I will try.