Virtual SPDT Switch?

So, here's an interesting and discrete problem I'm trying solve. I want to create a virtual momentary single-pole, dual-throw switch based on two physical on/off switches. IOW, I'd like to create a virtual (On)-OFF-(On) switch from two physical on/off switches. But I can't quite figure out a way forward.

Here's the detail:

  • we have a couple chandeliers in our foyer. The ceiling is ~ 25 feet high so the light fixtures come with motors to raise and lower the chandelier for cleaning the fixture, replacing bulbs etc.
  • the original builders of the home put a cheap dual throw key switch that my wife hates
  • I'm still married, meaning, WAF is key around here
  • recently, I replaced the key switch with a Zooz ZEN17 relay. I guess technically it's a dual relay. One relay for "raise" and the other for "lower". It works perfectly/
  • except, from a UI/UX standpoint, I'd much rather have a SPDT switch rather than two separate on/off switches, so I think my goal is to create a virtual SPDT switch. If I had one, I could easily drive the physical relays using rule machine or the like

Any suggestions on how to crack this? I suppose the easy thing to do is use a button device, but I'm wondering if I can somehow create what would be a double throw momentary toggle on a dashboard?

And btw, for those folks who are safety minded, the motor assembly comes with override stops at the top and the bottom, so if the ZEN17 or HE goes bonkers, all is good. No one will get crushed by a falling chandelier.

How about a stateless switch?

1 Like

See also [RELEASE] Virtual Switch Universal Device Type (uDTH) - good for Alexa, IFTTT, HSM, and other integrations

for a virtual switch driver that always generates ON or OFF regardless of actual state, and has an auto-OFF feature.

1 Like

So you are saying, you never really have to turn it "off", as it stops on its own. So you could just flip to "lower" directly from "raise", if it was just left on "raise" after a raise? Or do you actually need to turn it "off" at some point, for some reason?

If not, you are still in a binary condition, and you can just use one switch and automations. When virtual switch turns on, turn off "raise" and turn on "lower", when virtual switch turns off, turn off "lower" and turn on "raise".

Still, off is just where you want to end up, and by definition the physical "raise" and "lower" switches just need to be off for the off state. So add that to each rule, with a delay for a bit more than the time it actually takes to raise or lower, to then turn off both relay switches after the delay expires, after either a raise or lower.

I'm probably being dense here, but I'm not seeing how either of these approaches would enable a dual throw UI, e.g., a "Lower-OFF-Raise" toggle switch. Kinda like the virtual analogue to something like this:
image

This is a good point, but the reason I wanted "off" to be a choice is because:
(1) sometimes you do want to stop lowering it before it's all way at the bottom (e.g., a tall person cleaning the fixture versus a short person);
(2) with something like this where there's real physical danger, I'm a belt-and-suspenders kinda guy. I like being able to stop it and also have a safety stop built in jic, yknow?

I had this same thought to discontinue the raise or lower after X seconds. But I'd still want the user to be able to select Off (i.e., Stop) before then, if desired.

That's why I've conceptualized this as dual-throw, up-off-down. But maybe there's just no way.

EDIT: Was also poking around the Home Assistant community. They call this a "3 position switch". I suppose that's real what I'm looking for. If there's no way to do this in HE, I'll probably default to a button device with 3-buttons.

Still obsessing about this question -- Why not use a virtual shade control? I believe that will give me raise, lower, and stop. And I can easily write the rule(s) to produce the up-relay and down-relay on/off events based on shade controls. Wouldn't ya think?

Let me see if I have this right...

You have two smart relays. Each one moves the motor in a different direction.

You want to be able to stop the motor independently of the limit switches.


One way I would consider doing it is with a smart switch in the wall. Personally I would use an Inovelli fan switch because most of my switches are Inovelli's. I'm not familiar with the Zooz wall switches.

I would set the Inovelli to smart light mode so that it is alway power on and pushing the buttons locally doesn't do anything to the power.

Then setup a rule for the top paddle that turns off the down relay and turns on the up relay. Same thing for the bottom paddle so that it turns off the up relay and on the down relay. This should allow full control of the up and down.

The Inovelli switches also have a configuration button. Setup a rule for the configuration button that turns off both relays. This should allow you to stop it at any point.

Yep, you got it. Except I don't really care about having a physical switch on the wall (in fact would prefer not to) because we lower/raise the light fixtures so rarely (like 4-5 times per year). So I was thinking about dashboard-as-interface. We already have tablets around the house. But I'm struggling with creating a virtual device in HE that is a "double throw center off" momentary switch, AKA 3-position toggle/switch.

I think I've narrowed it down to:

  • 3-button virtual button device
  • virtual shade device

...either of which would drive the appropriate on/off events in the physical relays in the wall.

But I'm still wide open to ideas -- don't feel like I've cracked this by any stretch.

Same idea. The logic is in the rules.

Button 1: turn on up, turn off down
Button 2: turn off up, turn on down
Button 3: turn off up and down.

A shade device won't really help you. There is no feedback as to the position of the chandelier. For example, it won't know when it is half way down.

Edit to add: I would send the off commands first. You don't want to have both relays energized at the same time. I might even add a small (100ms?) delay between them.

Yeah this (the 3 buttons) makes sense to me. Could also combine your comments with @navat604's by having a stateless switch for raise and lower, plus a single button device for Stop. Which is conceptually similar to a 3-button device.

In a way, this is the virtual equivalent of using a Inovelli Fan/Light Controller or the Zooz ZEN30 in the wall without loads.

Point taken on the shade device not having positional awareness. Which is why having built-in delays is warranted.

Just seems like HE should have a virtual n-way switch device, both stated and stateless. But maybe I'm missing something. Doesn't seem like there's lots of people in the community begging for the driver, so...

Have you thought about a virtual dimmer? It has a switch for on/off, and the dimmer slider can do raise and lower.

0% = off (also turns the switch off)
1% - 50% = lower
51%-100% = raise

So the dimmer is off.
You move the slider between 1-50%, and an automation turns on lower, based on the switch turning on, and the current value of the dimmer being <= 50.
Move the slider to 51-100%, automation turn on raise, based on the switch turning on and the current value of the dimmer being > 50.

You could turn off the switch at any point to stop the raise/lower by pressing the tile.

When off, the dimmer will retain its dim level. If you turn off half way down, you would just have to turn on again to finish lowering, as it would still be in "lower" mode based on the retained dim level.

I don't really like how dashboard button tiles have no physical indicator on a dashboard that they were pressed. A virtual dimmer would also clearly show what state the raise/lower is in.

That's an intriguing idea, thanks. Going to give it a try, along with the hybrid switch/button described above.

This community is awesome -- thanks all for the inspiration!