New Plugin: Switchboard -- Virtual Switches Re-imagined

I use the VSCs in two ways. First, I use it as a consolidated interface for unrelated modes. For example, I have “Guest Mode” for when a guest is present in the house (changing the interior night lighting pattern), and “Party Mode” for when we’re rockin’ the house (various lights aren’t forced off at particular times, and doors aren’t automatically locked), etc. Rather than having separate virtual switches, I have them on a single UI element (the VSC in multi-state mode). I use one (in single-state mode) in my home theater setup to express its state: walk-in, ready/previews, roll/playing, end.

And yes, if I’m just keeping a local state that doesn’t need a UI, I’ll use variables in Reactor. I actually originally considered the VSCs as UI elements for Reactor itself, but thought they would be more useful as a standalone device.

I’m not a user of the Vera Mobile apps. I do most of my work in the Vera web interface, and my family uses a JS-based dashboard I created around the house (and of course, voice assistants). So the limitation that VSCs can’t be seen in the mobile apps are of no consequence to me. I recognize that heavy users of the mobile apps will likely not be able to use VSCs without a UI (the bane of the mobile apps for time immemorial), but that alone doesn’t make them “un-useful,” so there they are.

2 Likes

Assuming you have a “Scene Controller” virtual switch (call it “Libra’s Phone”) set up with verbose labels (let’s call them “Silent”, “Normal” and "Driving), is there a straightforward way to command Alexa to activate the spoken label?

Use case - in case it’s not obvious - is that I’m trying to creatively replace several IFTTT applets using something inside Vera, and my current line of thinking goes like this:

Alexa command ► Virtual Switch ► selected Label active ► Reactor detects change ► sends text message to phone ► Tasker intercepts ► switch phone to corresponding Profile

This would have the added advantage that I could include the Virtual Switch in other Scenes that react, say, to Location or what-not. But my main objective during this testing phase is to verbally select among the Labels (in Single mode, so they act like radio buttons, per docs), and to do so through my Vera.

Possible? Suggested syntax? (I will no longer tell Alexa to “Trigger Libra’s Phone to Silent”, since “Trigger” presumes IFTTT. Would I instead say, “Set Libra’s Phone to Silent” for example?)

POSSIBLE SHOWSTOPPER: Not seeing any of my Switchboard “Scene Controller”-mode switches amongst the devices listed under Vera > Your Controllers & Devices, where I normally assign a friendly name for use with Alexa. Perhaps @rigpapa intended this non-visible behavior by design? I only see VS’s set to “Binary” mode in that list.

Unfortunately, Vera does not export scene controllers to Alexa.

1 Like

Ah, understood, and I probably should have known that. I may have to settle for individual binary switches, then, and recreate the net effect of each IFTTT applet that way.

Yep, virtual switch will work. If you want to customize the phrase, just use a routine. Otherwise, you’ll have to say “turn phone vibration on/off”, where phone vibration is the switch name.

1 Like

I’m trying to get the tristate switch to select Void instead of Off after the timer runs. I clicked the variables tab and there isn’t a TimerResetState var to modify. Am I missing something? I’m using the latest version on Openluup

Go to the Plugins page, find Switchboard, type stable into the version field, and hit the update button/icon. That will update you to the stable branch release, which has the updated initialization to make sure the variable is there. Restart openLuup after updating if it doesn’t do it itself.

1 Like

Perfect, worked great. Thanks for all of the awesome work!

Curios… what does this variable do: AlwaysUpdateStatus
Haven’t seen anything in the docs about it.

1 Like

Let’s try here, as I couldn’t find a section for the switchboard plugin.

At the moment I use a virtual switch from switchboard. With Reactor I use to to run LUA code to turn my fireplace on and off with RFXcom. That works nice.

With the remote I can do a little more. it only has a on and off button. So pressing On, turns it on, but pressing it again, it turns on heating 1000W and press it again it heats with 2000W and press it again, it goes to the first state, only the flames.

How could I do this with Vera, switchboard and/or reactor?

Maybe with 2 switches? 1 only for ON/OFF and the other one for heating 1 or 2.

You could use the Switchboard Virtual Scene Controller… it’s built for multiple state problems like this. Caveat: because it is a custom device, it will not be controllable in the mobile apps, web access only.

image

If you want to control from Mobil you could use a virtual dimmer. And then just use a little bit of math to force the dimmer to settle on 33, 66, and 100 to represent the 4 states.

Or you could use 3 switches, one that controls the flame, one that adds 1000w and a second that adds to 2000w, then just add some logic to keep the states correct. Or use two switches and use them like binary code for the 4states but that probably the worst for a human to understand at a glance.

1 Like

Thanks @rigpapa But I need it in Imperihome too. Going to play with it…

Thanks for the hints @shallowearth.

Hi Rigpappa,
I have just started using this plugin and added a new tri switch but i can not see this virtual switch in reactor to perform actions against it. I have restarted vera and double checked but reactor can not see the newly added tri state switch made by switchboard plugin. Am i perhaps missing something?
Edit: The tri switch is visible in reactor actions only for the primary condition and is not assignable for actions/activity for any sub conditions groups.
Edit2: I can now see the tri switch in secondary reactor condition groups, just took an hour or so to show for some reason

Hi there,

I’m new to virtual switches, so i have a question. If i create a virtual switch, how can i define it’s action?

I’ve created a custom integration to control a device i own. I’m currently controlling this device from a VirtualPanel, which doesn’t appear in the Mobile UI.

In the VirtualPanel layout, i have several buttons, which call for actions on the device, like:

Action: Call an Action on a Device
Device: Bathtub 1
Service Id: urn:micasaverde-com:serviceId:Sinapse1
Action: TurnOnPanel

How can i make a virtualswitch do this exact same action?

Virtual Switches don’t have any smarts in and of the themselves. The simplest way to use them is to create a Scene that is triggered on “On” and a Scene that is triggered on “Off” to do the actions you want to occur on On or Off.

You can also use Virtual Switches as conditions or triggers for Reactor or PLEG.

1 Like

For the first time (maybe because I’ve exceeded the practical limit on number of VSes (15) created with Switchboard?), one of my virtual dimmers refuses to reset, despite having a non-zero ImpulseTime (=1) set. I’ve also tried it with 3 secs., and doesn’t matter whether the VS gets turned “On” manually (in the Vera web UI) or gets set to a dim level (in Alexa routines); it remains “On”.

@rigpapa is that something the plug-in logs? or any other recommended troubleshooting steps?

NOTE: All other 14 VSes (all “Binary” type) reset properly.

I’m surprised it ever worked. There’s no provision at all for timing on dimmers, at least, not when they are turned on by setting the dimming level. If you turn them on as a switch using SetTarget, that should work all day. I guess nobody noticed all this time, myself included. And that may be really hard to do anyway, because we get “help” from Luup:

08	04/14/21 18:22:42.609	JobHandler_LuaUPnP::HandleActionRequest device: 105 service: urn:upnp-org:serviceId:SwitchPower1 action: SetTarget <0x6c1ea520>
08	04/14/21 18:22:42.610	JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=105 <0x6c1ea520>
08	04/14/21 18:22:42.610	JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:SwitchPower1 <0x6c1ea520>
08	04/14/21 18:22:42.610	JobHandler_LuaUPnP::HandleActionRequest argument action=SetTarget <0x6c1ea520>
08	04/14/21 18:22:42.610	JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=1 <0x6c1ea520>
08	04/14/21 18:22:42.610	JobHandler_LuaUPnP::HandleActionRequest argument rand=0.7434496257794598 <0x6c1ea520>
02	04/14/21 18:22:42.611	JobHandler_LuaUPnP::ConfirmGlobalActionRules replaced binary on with dim 25 <0x6c1ea520>

Notice the last line – it replaces the binary on command with a dimming command.

Now fixed in the stable branch version on Github. To install:

  1. Go to: GitHub - toggledbits/Switchboard-Vera at stable
  2. Click the green “Code” button and choose “Download ZIP”
  3. Unzip the downloaded file.
  4. In the Vera UI, open the uploader at Apps > Develop apps > Luup files
  5. Drag the unzipped files (not the folder) to the “Upload” button.
  6. When the upload finishes, your Vera will reload Luup.
  7. Hard refresh your browser.

Did the dance, but Switchboard is throwing (in the Vera UI):

ERROR! The Switchboard plugin core version and UI version do not agree. This may cause errors or corrupt your Switchboard configuration. Please hard-reload your browser and try again (how?). If you have installed hotfix patches, you may not have successfully installed all required files. Expected 21104 got 20137.

Second, third hard refresh still no joy.

UPDATE: Waited (much) longer, looked again, and that error is gone. Yay! :slight_smile:
THANK YOU AGAIN!

Hi, Is anyone else having problems using Switchboard Virtual Switches with the Homewave IOS App?
Recently I can only turn a VS off by using the VERA Web GUI or VERA App but not using Homewave.
In HomeWave the switch goes off but refreshing the iPhone screen reveals it is still on!
I’m using Version 1.8
This is probably a question for Homewave but I mention here as things worked until very recently?