New Plugin: Switchboard -- Virtual Switches Re-imagined

Switchboard is my re-imagined cut at virtual switches. One of the problems with the old Virtual Switch plugin is that it creates devices with its own device type, rather than a Vera-native device type for a binary switch. As a result, its virtual switches aren’t recognized as equivalent in many places (notably the Android mobile app, where the switches are listed but not controllable). Switchboard addresses this issue, and others, including adding virtual tri-state switches and virtual dimmers. It offers a simple interface for monitoring and controlling all of its virtual switches, and uses modern plugin architecture to reduce memory and storage utilization.

Switchboard is available through the Vera App Marketplace and the AltAppStore. It works on Vera UI7 and openLuup.

REVISION HISTORY

2020-05-17: Version 1.7 allows the timer reset to set tri-state switches to any of the three possible states set setting TimerResetState (0=off, 1=on, 2=void) on the device; adds support for virtual scene controllers.
2020-03-21: Version 1.6 added virtual locks, relays, and water valves. When using the reset timer, tri-state switches can now be restored to off or null.
2019-08-25: Version 1.5 fixes a problem handling zero ramp rate for window coverings.
2019-07-28: Version 1.4 adds support for virtual window coverings, which Vera handles like a dimmer.
2019-05-19: Version 1.3 introduces a new UI for creating virtual devices, virtual dimmers, and enhanced behaviors for tri-state switches.
2019-02-16: Version 1.2, first general release via Vera App Marketplace and AltAppStore

2 Likes

Awesome, I will definitely check out.
One thing that would be great to add, is a tri-state switch (see this thread: http://forum.micasaverde.com/index.php/topic,47377.msg332388.html#msg332388 )
Like the pulse feature you added except it returns the switch to an unknown state which is really helpful for when you don’t know if the v-switch is actually in sync with reality, and want to retrigger the on or off commend.

flipping fantastic!!! Keep knocking these out! just replaced all my virtual switches with these.

One quick question, is there a way to uniquely identify these devices vs. a binary light? I have some startup code that defines some watches so i can kick off some actions (that i have not migrated to Reactor yet). When these switches were VirtualSwitches, i could use the device_type field to differentiate them, but on these they look and feel like standard Lights. i guess could use id_parent, but just wanted to check with you.

id 127 name "Virtual Switch 1" device_type "urn:schemas-upnp-org:device:BinaryLight:1" room "0" id_parent 126 embedded 0 disabled 0 device_file "D_BinaryLight1.xml" impl_file "" manufacturer "" model "" altid "1" ip "" mac "" time_created "1548769771" states [?] ControlURLs {?} device_json "D_BinaryLight1.json" category_num "3" subcategory_num "0" invisible "0" local_udn "uuid:4d494342-5342-5645-007f-000002167db2"

If you pull the latest (right-click this link, Save Link As…) L_Switchboard1.lua and upload it to your Vera, it will immediately brand the “manufacturer” attribute == “rigpapa” and the “model” attribute == “Switchboard Virtual Binary Switch”. Other switch types are coming, so if you’re concerned specifically about the virtual binary switches, test the model attribute.

I will make sure those strings remain stable.

Can we please see this made available in the AltAppStore?

I can, but it will be for Vera only at this time. Does that work for you?

[quote=“rigpapa, post:5, topic:200515”]If you pull the latest (right-click this link, Save Link As…) L_Switchboard1.lua and upload it to your Vera, it will immediately brand the “manufacturer” attribute == “rigpapa” and the “model” attribute == “Switchboard Virtual Binary Switch”. Other switch types are coming, so if you’re concerned specifically about the virtual binary switches, test the model attribute.

I will make sure those strings remain stable.[/quote]

Thank you!!!

Love your work! Thanks rigpapa!!!

I can, but it will be for Vera only at this time. Does that work for you?

Does that mean it will not work with openLuup and / or AltUI?

Also GitHub changed a few things with their own security so some of the older Veras now can’t engage with the Alt Store, so that’s a separate problem in itself.

All up, no big deal.

Hi,
I’ve been experimenting with a Aeotec Wallmote Quad and Multi-Channel Associations. I doubt it, but would it be possible to have a virtual switch that pretends it’s a Zwave switch or dimmer that could be associated to the device in order to somehow use the swiping features of the Wallmote on non-Zwave devices?
Thanks

[quote=“a-lurker, post:10, topic:200515”]

I can, but it will be for Vera only at this time. Does that work for you?

Does that mean it will not work with openLuup and / or AltUI?

Also GitHub changed a few things with their own security so some of the older Veras now can’t engage with the Alt Store, so that’s a separate problem in itself.

All up, no big deal.[/quote]

The code works fine. The problem is that openLuup does not have its own set of default device files like those that Vera ships with (specifically device file D_BinaryLight1.xml and static JSON D_BinaryLight1.json to create the UI). So while using Vera’s canned device and service files fixes many of the problems with virtual devices on Vera, it creates new problems on openLuup. The device file is easily derived from the UPnP standards (Vera’s are almost identical, and the differences are not meaningful). I need to recreate the static JSON file, and get the deployment squared away so it’s clear that those files should not be installed on Veras, but must be installed on openLuup.

[quote=“Quixote, post:11, topic:200515”]Hi,
I’ve been experimenting with a Aeotec Wallmote Quad and Multi-Channel Associations. I doubt it, but would it be possible to have a virtual switch that pretends it’s a Zwave switch or dimmer that could be associated to the device in order to somehow use the swiping features of the Wallmote on non-Zwave devices?
Thanks[/quote]

What state does the Wallmote change when you do things with it?

There are several settings you can apply, but the one I’m interested in is tapping a button to toggle a light on/off, and tap, hold and swipe up or down to brighten or dim the light. I can set any of the other 4 buttons to trigger scenes.
I think this may be impossible though since it seems the multi-channel association is looking for direct communication with a Zwave device.

[quote=“a-lurker, post:10, topic:200515”]

I can, but it will be for Vera only at this time. Does that work for you?

Does that mean it will not work with openLuup and / or AltUI?[/quote]

OK. I think I’ve got everything sorted. It’s in the AltAppStore. Additional files are installed for openLuup.

The current Github master release also has my effort at support for tri-state switches, but there’s no UI yet to create one. So, to create a tri-state switch, you do this:

[ol][li]Add a new virtual switch on the Switchboard control panel; it will be created as a binary switch;[/li]
[li]Go into the control panel for the new switch, Advanced tab to get to its attributes;[/li]
[li]Convert the switch by setting its “device_json” attribute to [tt]D_TriStateSwitch1.json[/tt] and its “model” attribute to [tt]Switchboard Virtual Tri-state Switch[/tt]. I recommend copy-paste, as the particular/peculiar capitalization is important.[/li]
[li]Reload Luup and hard-refresh your browser.[/li][/ol]

The new switch should then have a three-button UI, and clicking on the switch icon in the Switchboard control/status panel should roll it through off-on-void states. The values and actions are the same as those used for the old Virtual Switch plugin (specifically target/status “2” is the void/third state).

There is a bug in current ALTUI that affects the UI for the tri-state switch type, so void state is not accessible here on ALTUI. I’ve made amg0 aware and he’ll get to it when he’s able; it’s not critical.

Also note that both UI7 and ALTUI require page refreshes when you change visibility to get a display consistent with settings. It’s just a thing you need to do.

Edit: fix filename (2019-02-18)

Rigpapa,
Great work. I’ve used Virutal Switch for a couple of things, but I agree that’s a bit antiquated. Question; after I created a switch, I see the switch name, the on/off slider, and Text1 Text2. What’s the purpose of the two text elements and can they be hidden? I really only need the on/off slider.

[quote=“tamorgen, post:16, topic:200515”]Rigpapa,
Great work. I’ve used Virutal Switch for a couple of things, but I agree that’s a bit antiquated. Question; after I created a switch, I see the switch name, the on/off slider, and Text1 Text2. What’s the purpose of the two text elements and can they be hidden? I really only need the on/off slider.[/quote]

Never mind, I figured it out. I just needed to delete the text from the status menu.

Hi patrick, I didnt realise this needed openLuup to run and as a result It doesnt work and throws this error at statup

System error : Device: 197. Fail to load implementation file D_Switchboard1.xml

How do I remove it?

[quote=“dJOS, post:18, topic:200515”]Hi patrick, I didnt realise this needed openLuup to run and as a result It doesnt work and throws this error at statup

System error : Device: 197. Fail to load implementation file D_Switchboard1.xml

How do I remove it?[/quote]

nevermind, I found the answers via google. 8)

PS, it’d be great if this worked natively on Vera.

[quote=“dJOS, post:19, topic:200515”][quote=“dJOS, post:18, topic:200515”]Hi patrick, I didnt realise this needed openLuup to run and as a result It doesnt work and throws this error at statup

System error : Device: 197. Fail to load implementation file D_Switchboard1.xml

How do I remove it?[/quote]

nevermind, I found the answers via google. 8)

PS, it’d be great if this worked natively on Vera.[/quote]

This is working on my Vera without any issues… maybe try to re-install it?