I just installed Plugin 1408::Virtual ON/OFF Switches
When i look at the advanced settings there are 2 status vars.
In a scene i tried to update the status var and nothings happened.
I looked at the advanced settings to see what (didn’t) happen and instead of 1 of the status vars where changed, it created another status var.
So the device now has 3 status vars and isn’t switching.
Now my question is;
How could it be that the plugin creates 2 status vars on a clean install?
how could i force luup to use/update the status var, and prevent luup to create a third status var?
Besides this problem, it doesn’t solve the 2 status vars on creation of the plugin.[/quote]
That is not the correct service ID and it is why you gained a stray variable. It will not do any harm. If you want to lose it, you will have to create a new VirtualSwitch and then delete the old one.
I’ve done that with a plugin I wrote too. I did it because I wanted the device to not only have its own internal Status variable but I wanted it to also appear to control points as a binary light switch too, which has its own Status variable, in a different namespace (service ID). (Tip: Hover the mouse pointer over the variable name to see the namespace.)
It wouldn’t surprise me to learn that the plugin prefers that you avoid setting the Status variable yourself with luup.variable_set, and that you call an action on the plugin with luup.call_action. That way the plugin can ensure that its variables are always internally consistent.
VirtualSwitch is a very useful and popular plugin. If the author has added a second service ID, it was probably to improve support by remote Apps. I don’t see why it would cause you any problems.