New Plugin: Switchboard -- Virtual Switches Re-imagined

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.

To do the math you need to figure out the dB range you want.
For example if you want -60 to -25.
That is 35 steps.
So the math for 99% would be
(99*.35 - (99*.35 mod 1)) - 60 = -24
In that equations 99 is the percent value from the dimmer.
.35 is the number of steps you want divided by 100 aka 35/100
subtracting (99*.35 mod 1) coverts the decimal to an integer changing 34.65 to 34 (basically just cuts off the decimal values and ensures you always have a whole number)
Then subtracting 60 is the lower end of the range and coverts it to dB

depending on what you are using to do the math you may need the “mod” function or use “%” to do the mod function. I haven’t tried doing it in Rector yet, but have done it in LUA.

Hope that helps.

Thanks I discovered that both the yamaha plugins I have used in the past. (currently using HTTP plugin) don’t seem to respond to discrete volume commands. Just the step up/down commands work so without that I may have hit a dead end. The GET value for volume dB levels works though.

Then just calculate how many step downs or up you need to make when the dimmer value changes, and send that many through.

Yeah, that did cross my mind but have no idea how code this. I have written some very basic lua using examples from the community but that is about it. I can alway use party volume but that would include zone 3 which I hardly use.

Who maintains that plugin? Maybe the missing action can be addressed. Seems like a nice-to-have.

a-lurker for the http plugin. The thing is it seems like the actions are there and Reactor picks up the current value in conditions i.e -70 but applying an action and value in activities yields no change. Tried running man too as well as native Vera scene. The thought was was to have condition on main zone volume value changed, any value to any value along with a condition on binary switch to turn on/off . Have an expression for main zone volume value and apply to Zone 2 volume in activities. I thought problem had been addressed in the plugins thread and installed latest from Github but it did not help. It turn it I actually lost one of the additions I added myself years ago to Set HDMI output on/off. Needed to restore Vera to earlier date from backup to retrieve edited plugin. Then restore back to current. Will check the plugin thread and see if support is still available. The plugin is quite old.

Shallowearth, any way to round value to nearest .5? i.e. 34.65 to 34.5

Hi.

Can someone help me with my difficulty:

I’m using the last tri-state version of the switch to control a rolling shutter with a toggle scene button.

Manually the switch works great: on → open the shutter | void → stops the shutter on the current position | Off → close the shutter.

When using the toggle state “ToggleState” rather in HaDevice1 or VSwitch1 (on the scene advanced editor code) it only toggle between on and off, without going throw void.

I was trying to configure only one button that could control the shutter… Pressing it once the shutter stats to open, pressing it again the shutter stops and pressing one more time the shutter stats to close and so on. (trying to find a solution for this at almost a year now…).

I also think that, for this to work, it will need to be a “four-state switch” so that the toggle could work like this: on → void1 → off → void2 → on → void1 → off → void 2… and so on so on… I think that with a normal cicle it will always skip a void state rather in on → off toggle or off → on (one of them).

Thanks you for your time in advanced.

The tri-state switch should work for you

Don’t use advanced editor.

Set up 3 scenes this way

Add a device triggered scene.

Select tri-switch as device

click Staus changes radio button

Scene1 Whenever tri-switch is turned on.
Scene2 Whenever tri-switch becomes void
Scene3 Whenever tri-switch is turned off.

Have you considered using Reactor vs a a native Vera scene?

I’ve modified the stable branch version of Switchboard on Github so that the ToggleState action now rolls through the states: on → void → off → void → on → etc. I don’t believe this change will disrupt anyone, but if it does, let me know and I’ll make the legacy behavior configurable. I think this behavior is a useful improvement.

Instructions for installing from the Github stable branch can be found in post 63 of this topic.

Patrick, is there any insight on the formatting issue I am seeing on my switches that I posted a while back?

Sorry, I’m just back from three weeks traveling out of just over four, most of it with sketchy Internet and no access to code, and I’m having a devil of a time reconciling all of my threads and making sure I’ve gotten back to everyone (I also have truckloads of email on these subjects to boot). So, please, refresh my memory… if you posted here, can you link me back to that post?