HomeGenie Forum
Automation Program Plugins and Wizard Scripting => Help => Topic started by: pim555 on December 04, 2015, 03:04:21 PM
-
Hi,
I am using attached code for a virtual switch which was posted on this forum before. It works fine but I dont know how to instantiate multiple switches using this code?
Once I have created a first module where I can select a virtual module from the modules list, the second time I try to create a module, the virtual module is not there anymore.
If I just add the same program again, it seems to mess up so that is also not the approach I believe.
Any help is appreciated.
Cheers
Pim
-
Hi Pim,
In Program.AddVirtualModules you can define the number of 'devices'
Program.Setup(()=>
{
Program.AddVirtualModules(moduleDomain, "Generic", "homegenie/generic/switch", 1, 1);
});
Change the last digit to the number of virtual devices you would like to create, for example 5:
Program.AddVirtualModules(moduleDomain, "Generic", "homegenie/generic/switch", 1, 5);
-
Thanks