New Plugin: Switchboard -- Virtual Switches Re-imagined

Wow… I am loving the new Switchboard Switches!
Just replaced all my old VSwitches. Love that that look like regular switches.
Also got to create a tri-state switch, which works great! Love that you added an icon for the Void state. Looks nice.

One question, what is the different between PulseTime and PulseTimeReset? (for regular binary switch)
What do they do with the TriState switches?

Would you consider adding Dimmers to this next? This is a much needed feature in Vera… would allow you to group multiple dimmer switches or z-wave bulbs together (though you probably need Reactor or something soffisticated under neither to send the right commands at the various dim levels). Personally I would use this for my whole house speakers to set the volumn (have a bit of LUA code that can convert the dimmer % to the volumn command that I send to an Itach to control the volumn currently) but couldn’t quite get the bad virtual dimmer switches that Vera provides to work. I used PLEG to monitor the states of the dimmer, but the dimmer sample they gave was bad and would reset itself to 0 when going to 100% and other wierd stuff that I couldn’t debug.

Excellent! Glad you’re having a good experience with it.

ImpulseTime is the amount of time the switch can stay on before it automatically turns back off. If 0, auto-off is disabled (this is the default; time units are seconds). The ImpulseResetTime value is an implementation variable that tracks the time the switch should turn itself off. This is used if Luup reloads during the time delay–by storing the absolute time that the switch should turn back off, when Switchboard is restarted it will know exactly when to schedule the turn-off. It will be 0 unless a time delay is in progress.

Absolutely. Stay tuned…

Just out of curiosity, what would be a use case for a virtual dimmer?

Well, what I think @shallowearth is intending to do is have a single “dimmer” that represents volume for all stations in his whole-house audio system. Dimmers fire events when their brightness changes, and this in turn could trigger a scene, Reactor, PLEG, etc. to set the volume in each of his rooms to the same (or perhaps a trimmed/balanced) level. You can do the same thing with a group of lights–one (virtual) dimmer controls them all.

1 Like

In the professional lighting world, this is called a submaster or group master function. It will be extremely useful.

1 Like

OK. Install the Github stable branch version, if you dare…

  1. Go here: GitHub - toggledbits/Switchboard-Vera at stable
  2. Click the green “Clone or download” button and choose “Download ZIP”
  3. Save the ZIP file somewhere.
  4. Unzip the file.
  5. Upload the contents of the unzipped src subdirectory to your Vera using the uploader at Apps > Develop apps > Luup files. Do not upload the files in the openLuup subdirectory. Before uploading, turn off the “Restart Luup after upload” checkbox, until you get to the last file; turn it back on for the last file.
  6. Hard-refresh your browser.

@rigpapa whats new in that version? :slight_smile:

So currently, I am using just an on/off switch for each speaker set and then controlling the volumn with scenes because I couldn’t get a virtual dimmer that worked correctly (the Vera “sample virtual dimmer” has bugs like auto turning the switch off when you brighten to 100%… sheesh). But yes, I would use the Virtual Dimmer to create a trimmed out volumn control for my speakers, some of which need to be groups some of which need to be independent.

I also know there is demand for wanting to control multiple dimmer switches at one time, using a device instead of having to create scenes to do that.

That stable branch release:

  1. revises the UI so that both the control/configuration and creation of new virtual switches is done on a single control panel tab rather than two;
  2. this facilitates having a UI to create tri-state switches, rather than having to fuss around in the device’s attributes (which is error-prone) to convert a previously-created binary switch into a tri-state switch.
  3. adds a virtual dimmer as a device type, so the UI can now create three different switch types: binary, tri-state, and dimmer.
  4. item #1 sets the stage for introducing other switch types more easily.

I’ve already had a discussion with another Vera community user, @HSD99, who is an expert on theatrical lighting systems, about separately making a plugin to make a virtual dimmer behave as a submaster (HPT, LPT, inhibit, etc.), to control groups of lights from a single dimmer. He and I worked together previously on my Yeelight plugin adding filter color selection capability to that plugin (his suggestion/expertise), although I approached it agnostically so that it will do it for any installed RGB light, not just Yeelight. It seems possible/desirable that that feature, too, would work its way into the submaster plugin. But this level of functionality is separate and distinct from the role of Switchboard (but it may/should be Switchboard-compatible).

1 Like

Just tried out the dimmer. So far… looks awesome. It even keeps the previous dim level when turning On… which is perfect for controlling a speaker because I want it to come on at the previous level not 100%! Now just need to hook up the controlling logic and try it out.

1 Like

is this recognized as a device in alexa to trigger voice announcements?

Yes, all three types show up in Alexa correctly (binary, tri-state, and dimmer)

1 Like

Hi, for some reason it’s refusing to work on my Vera. The app installs but it tells me ‘ERROR: Device not ready’ when I try to add a device. I’ve created the device manually as well using the GitHub files but I get the same error.

Working now, after I restarted the box twice.

I would do the following:

  1. Delete the Switchboard master device(s).
  2. Reload Luup.
  3. Hard refresh your browser (CTRL-F5 for Chrome/Win, SHIFT-F5 for Firefox/Win, CMD+SHIFT+R on Mac)
  4. Uninstall the plugin.
  5. Repeat steps 2 & 3
  6. Reinstall the plugin.
  7. Wait for the install to complete, which may take several minutes.
  8. Repeat steps 2 & 3 again.
  9. Go into the Switchboard master device and add a virtual switch.
  10. Repeat step 3.

IMO, any time you add, delete or change the name or room assignment of any device, or install/update/uninstall any plugin, you should hard refresh your browser. This often solves many device issues that occur around these operations.

1 Like

Can I configure the switch to momentarily?
I want to use it to start Scenes. And I don’t want to write a Scenes to start one and turn it OFF

Yes, on the config tab of the master device there’s a little clock icon on the same row as each virtual switch. Click that and enter your reset time.

Switch all my virtual switches over to switch board. Had some use for the Tri-switchs as well. Works great but there is some truncation going on, see attached.

vs

I am currently testing out MQTT subscribing and publish commands with virtual switches. This functionality may exist somewhere else, but I wonder if the Switchboard Virtual Switch can behave as a binary MQTT switch. Essentially it would have 2 functions.

  1. State Update switch status - A specific topic subscription would define the state, for a switch type devices it would be based on a number response of 0 or 1 on a topic query. So if another device sets the remote device and the broker updates with new state, the virtual switch would reflect that automatically.

  2. MQTT publish with 2 settings that can be specified which correspond with specific MQTT commands to set on or off on a topic specified in the variables.

I have set up a Virtual switch with the MQTT plugin at the parent device. I can specify a single MQTT topic to subscribe to and have the switch update status, however have not seen a simple way of having the switch actually send a command when triggered as well.

I’m not really that familiar with MQTT and less so with the MQTT Client Plugin. I think you should post your question/objective in the MQTT Client Plugin topic, and see what those wizards come up with.

Is anyone using the virtual dimmer in combination with Reactor to control volume on multiple Yamaha AV Receiver zones? The issue I see is the Yamaha receivers commands are in dB levels instead of a sliding scale of 1-100. I use a remote app that works with the Yamaha that has slider settings i.e. min 0 max 100 so was thinking there must be some kind of conversion of logic to make it work.