Author Topic: UI7 additional virtual switch  (Read 5525 times)

Offline Damian R

  • Jr. Member
  • **
  • Posts: 67
  • Karma: +1/-0
UI7 additional virtual switch
« on: September 13, 2014, 08:50:35 pm »
Hey guys, I've search the forum and google, and I know I've seen the post somewhere before, I just can't seem to locate it anymore.. But how the hell do I add another virtual switch instance in UI7.. I'm already using 1 and I see no place to create a new virtual switch device.

Offline Damian R

  • Jr. Member
  • **
  • Posts: 67
  • Karma: +1/-0
Re: UI7 additional virtual switch
« Reply #1 on: September 13, 2014, 09:05:34 pm »
Scratch that.. I figured it out..

For anyone else having the same problem:

Apps -> Develop apps -> Create device
  • Device type: urn:schemas-upnp-org:device:VSwitch:1
  • Description: whatever you wanna call it
  • Upnp Device Filename: D_VSwitch.xml
  • Upnp Implementation Filename: I_VSwitch.xml

Set a room if you want to and then click Create device. Now go to your devices tab, and click on the device just created.

  • Set device_json: D_VSwitch.json

Now the part that took me forever to realize. You MUST reload the Lua engine for this to work properly.

Apps -> Develop apps -> Edit Startup Lua -> and just click GO. Wait for the engine to reload, and then go back to your device list and force reload the page.

Hope this helps someone

Offline Rayvino

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: UI7 additional virtual switch
« Reply #2 on: September 20, 2014, 04:53:13 pm »
Thanks for the tip but when I get to your last step and click Go under Edit Startup Lua, it gives me a message to fill in required field.  It's looking for something in Edit Startup Lua code box?  The switch appears in device list but doesn't work?

Also how do you know when the Lua engine has reloaded?

Offline Damian R

  • Jr. Member
  • **
  • Posts: 67
  • Karma: +1/-0
Re: UI7 additional virtual switch
« Reply #3 on: September 22, 2014, 05:29:13 pm »
Thanks for the tip but when I get to your last step and click Go under Edit Startup Lua, it gives me a message to fill in required field.  It's looking for something in Edit Startup Lua code box?  The switch appears in device list but doesn't work?

Also how do you know when the Lua engine has reloaded?

There are a few ways to reload lua, one is the step I use, or editing a scene with lua (almost anyplace lua is used) or by using an http request, which I forget the exact url at the moment... I actually have an ssh session open to tail the logs, but if you scroll all the way to the top, there will be a blue bar that says like 'Reloading lua engine.. Please wait..', 'Configuring your Z-Wave devices' and whatnot. Once the blue bar disappears the engine has been reloaded.

And of course if all else fails, just power cycle your vera.

Offline mszewcz

  • Sr. Newbie
  • *
  • Posts: 43
  • Karma: +1/-0
Re: UI7 additional virtual switch
« Reply #4 on: September 22, 2014, 06:08:06 pm »
To reload lua just go to Apps > Develop apps > Test luup code (Lua), enter following code:
Code: [Select]
luup.reload()and hit Go (this works only in UI6 & UI7).

You can also do it by using an http request. The url is:
Code: [Select]
http://ip_address:3480/data_request?id=reloadJust replace the ip_address with your Vera's one.
VeraLite @ UI7 | 7xFGD-211, 2xFGMS-001, 1xFGK-105, 1xDSC24

Offline legend99

  • Full Member
  • ***
  • Posts: 157
  • Karma: +1/-1
Re: UI7 additional virtual switch
« Reply #5 on: December 05, 2014, 03:40:05 pm »
Thanks for the tip, but that makes no sense why you would have to go through all that to add a 2nd switch.

Scratch that.. I figured it out..

For anyone else having the same problem:

Apps -> Develop apps -> Create device
  • Device type: urn:schemas-upnp-org:device:VSwitch:1
  • Description: whatever you wanna call it
  • Upnp Device Filename: D_VSwitch.xml
  • Upnp Implementation Filename: I_VSwitch.xml

Set a room if you want to and then click Create device. Now go to your devices tab, and click on the device just created.

  • Set device_json: D_VSwitch.json

Now the part that took me forever to realize. You MUST reload the Lua engine for this to work properly.

Apps -> Develop apps -> Edit Startup Lua -> and just click GO. Wait for the engine to reload, and then go back to your device list and force reload the page.

Hope this helps someone

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 9720
  • Karma: +737/-136
    • RTS Services Plugins
Re: UI7 additional virtual switch
« Reply #6 on: December 06, 2014, 09:55:57 am »
@legend99
This work around is ONLY needed if you loaded the Multi-Switch (or any other Plugin) during an earlier release of UI7 where it did not have the "Add Another Device" button.

If you loaded a plugin earlier than when MCV made the fix, Not only did it not have the button, but it failed to add the button on later versions of UI7 where they (MCV) fixed the problem.

Another solution is to uninstall the plugin ... then re-installl it ... then you will be able to create multiple instances with a single click.

Offline Clems

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: UI7 additional virtual switch
« Reply #7 on: October 05, 2017, 06:02:42 am »
This way is ok on UI7, but I cant use the switch in Vera Mobile app.

Is there any way to use this switch in mobile app ?


Thank you !

Offline michaelhinchey

  • Full Member
  • ***
  • Posts: 143
  • Karma: +2/-1
Re: UI7 additional virtual switch
« Reply #8 on: October 14, 2017, 12:16:06 pm »
What is the reasons for the virtual switch?  Just for testing?

Offline Clems

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: UI7 additional virtual switch
« Reply #9 on: October 14, 2017, 12:34:37 pm »
What is the reasons for the virtual switch?  Just for testing?
It is to add button to launch scene

Offline Forzaalfa

  • Sr. Newbie
  • *
  • Posts: 38
  • Karma: +0/-0
Re: UI7 additional virtual switch
« Reply #10 on: November 03, 2017, 03:12:24 am »
They can also be handy for preventing scene collision (running conflicting scenes at the same time).