Display value of a global variable

I have a bunch of luup code (attached to various scenes) that uses several global variables to control its behavior. E.g. there could be a global boolean gVar_do_something that turns on/off certain logic in luup code.

Now, I can write a scene whose sole purpose would be to set gVar_do_something to “true” and another scene to set it to “false”. This way I can control gVar_do_something from UI.

But I can’t think of an easy way to get current value of the gVar_do_something from UI. What I could think of so far:

  1. Go into Devices->Luup plugins->Test luup code and execute luup.log() – not exactly a UI solution
  2. Write a plugin that would emulate an OnOff switch that would simply flip gVar_do_something’s value. Then create a device using this plugin.

2 sounds like a bunch of work. Is there a simpler solution I’m missing?

If not, perhaps, someone already implemented a similar plugin and willing to share the code?

Thank you

I never like using global variables since they get lost should Vera reboot.

I suggest using “Virtual Devices” instead. The virtual device status can then be seen from the control panel.

Ah, “virtual” is the keyword. Searched and found exactly what I needed:

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

Thank you