VirtualDevice/VirtualSwitch explanation

Hi!
What that I would to do is to set the virtual variable to 1 when a condition is met in a XAML and change something in another XAML when the virtual variable is 1. So, I would to connect two XAML.

I saw that is possible to create a Virtual Device and set virtual variables.
But how I can use it?
image

And, is it better to use a Virtual Device or create a plugin with a VirtualSwitch device?

It depends on what you need. If you want a virtual device object that behaves similar to an actual switch, you’ll want to use a Plugin. If all you need is a simple storage variable like you have will suffice. The “Virtual Device” is a legacy device inherited from the old Designer. The naming probably isn’t the best with the introduction of device objects in version 3 because it’s not a device object. It’s really just a variable container. Plugin is best because it offers the most flexibility & it’s more compatible with all of the latest Home Remote features.

Hi Bill!
Thanks for your reply.
All I need it can be a simple storage variable, but if you say that Plugins are the best I can use them.
There is a guide to understand what to do?
I tried to create a VirtualSwitch and it ask to me Capabilities and Attributes.
I read about them but if I write a Capability it doesn’t appear in Binding Menu as other devices do.

Do I have to do something particular? Maybe with the script in script folder?

If all you need is a simple storage variable you can use the variables as you are currently doing.