Can you make a multi level/state virtual switch?

Trying to setup a device/control on my C8 that will replicate the 4 states of the switch in an old school 3-way lamp. I'm envisioning a switch that goes from [Off], [Low], [Med], [High]...

The switch in a 3-way lamp is actually 2 switches and they cycle through
[Off] = Switch 1 off, Switch 2 off
[Low] = Switch 1 on, Switch 2 off
[Med] = Switch 1 off, Switch 2 on
[High] = Switch 1 on, Switch 2 on

I need a control that will let me cycle through 4 states or select from the 4 states.
(This setup and logic will also allow you to control the 4 states of a standard ceiling fan.)

I've searched and played around some and I can't see how to do this with a virtual switch and I tried a virtual dimmer on the chance that I could set it to have levels from 0 to 3.

Ideas?

Virtual buttons allow you to choose the number of โ€œbuttonsโ€œ, and therefore the number of states, the control can have.

Here's an example rule that flashes a selected color for about 3 seconds on a Third Reality Multi-Function Night Light, using a 12-state virtual button (only 11 states are used as triggers in this example):

Here's an example of another approach: activation of a virtual switch repeatedly cycles through 4 states (in this case, to control 2 different light sources, but easily modified to set a fan speed). Note that the variable vLightState persists between invocations of the rule.

EDIT: note that the virtual switch in this example uses the "Virtual Switch uDTH Lite" driver with Preference "Force State Update" enabled.

Just use a combination of two virtual switches. It will give you the 4 states you need.

So, couldn't you just use a virtual fan device? That would let you set any of the states from a single dashboard tile.

Uhhh...
Because someone never noticed there was a virtual fan controller! :thinking:

Digging through that now!

It looks like a Virtual Fan Controller will work but the "Supported Fan Speeds" has a number of unwanted speed states: "low","medium-low","medium","medium-high","high","on","off".
Limiting the list to "low","medium","high","on","off". is what's needed.

Kinda surprised that I can't find deeper access to the device's definition.
What option is there to edit the list of speed states?

You can try this driver I wrote. It simulates a GE Fan Controller, so it also has a dim level as well.

It is set-up for a three speed fan.

I have this logic in a button controller to step through fan speeds, off, high, medium, low, off, ...

You could just swap in you two switch actions
Off turn off A & B, High turn on A & B, Medium turn on B turn off A, low turn on A turn off b....

image

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.