Requesting virtual switch with more than 2 states

It would great if we could have a virtual switch with more than 2 states. My current use case for such a switch is for my washer and dryer. Using rule machine I'd like to be able to display on (which is informed by a power monitor and a humidity sensor), done but still loaded (again power monitor and humidity sensor), off (contact sensor on the washer and dryer doors).

Does such a virtual device exist? I don't see one. Does anybody else see uses for such a virtual device?

Sounds like a global / hub string variable is what are after. If you control the values that get set for the variable you can control the list of values that are possible. You are not likely (I expect) to get a multi-value switch, they are by their very nature a binary device, on or off. A string or number variable should give you what you need, with the right controls around it.

To add to this general comment, I use something similar to define whether my washing machine or dehumidifiers are operating.... actually, those are a switch, but... the same logic can apply.... I do also include a string hub variable to display on dashboards.

3 Likes

That's a shame because I understand absolutely zero about variables. After a year I feel less competent with HE than I did when I started. Maybe this can be accomplished within the dashboard. @jpage4500 what do you think?

Yeah sorry was quick to post.. forget I mentioned it! :smile:

1 Like

Before you all remove more posts... :slight_smile:

I think you can achieve this still with a switch. If I read your requirement right...

1 Like

Just use a rule to set a switch based on the state of the various elements you want included, so if A and B and C, set your switch to true, else false. Though most likely a little more complicated than that... but not much... Ultimately you are after a binary (on/off) indicator, just one that involves more than one input.

What about virtual fan controller it's still on and off but it does list the speed that the fan is set to.

1 Like

Also you could use any virtual device that takes values - like the omni device and then pick something like illuminance, humidity, power, temp etc.. or just go with like a virtual temperature sensor device..

You'd then test for specific values you wanted.

How would you like this "switch" to display on a dashboard or be used in a rule?

I still feel like it's on/off only, but depends on the use....

1 Like

Now that I think about it we already have this exact functionality built in with mode manager. I don't think I can have more than 1 mode manager but the developers could open it up to utilize that logic.

I feel like this could be used on our dashboards in so many ways.

A mode is essentially just a string... a variable if you will, just with a special meaning.... hint... hint...

2 Likes

Ohhhhh, that feels so above my pay grade.

1 Like

I would use a variable to display on the dashboard...

If you insist on using a device, a multi state sensor would fit better than a switch...something like a garage door sensor that has open, opening, closing, and closed states. The stock virtual driver automatically transitions from opening to open in a set time period but you could modify to set manually...

3 Likes

Anybody know of a write up so I can learn about variables?

If you want I setup a driver for storing a string... give me a sec.... And I'll try to find my rules for status text I use on dashboards...

1 Like

It's gotta be a "for dummies" version. I feel like the things I want to do require a programmers brain. I sware I'm the only poster on the forums that isn't a programmer.

1 Like

Is it possible to just copy and paste the mode system so it can be used over and over for different things? I feel like those of us that are dummies would find tons of uses for such a things...if it existed and people knew about it.

I just thought of another way to do this. A virtual notification device and set up notifications to roll into it. It won't have pretty icons but could display any info needed.

Here's my driver, though, to be honest I would use variables nowadays, this predated those being included in the HE platform....

The more appropriate version would be to setup a Hub Variable under Settings -> Hub Variables, clicking New Variable

Give the variable a name and then select a type, in this case ideally a String, and provide a starting value, e.g. Off.

Finally... Do what you want in a rule... Here's my dehumidifiers example, but probably bears no resemblance to what you're likely to need, but hopefully you get the idea...

2 Likes