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:
- Go into Devices->Luup plugins->Test luup code and execute luup.log() – not exactly a UI solution
- 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