Modes vs virtual switches?

So being new to Hubitat, I am a little confused about modes. Specifically, what is the benefit of using modes over virtual switches? Let's assume I have 2 modes - Day, Night. I could also create a virtual switch called "Daytime" (on is day, off is night). It seems to me that a virtual switch can do anything a mode can do, but a switch is simpler and has other benefits over a mode. I'm probably missing some fundamental benefit of modes. Please enlighten me.

Here is what they can both do:

  • Both can be changed automatically (time of day, presence, etc).
  • Both can be used in conditional statements.
  • Both can trigger events on change.

Benefit of virtual switch over mode:

  • More logical and less work to set up. You create one switch for a boolean (true/false), i.e. switch called away - (on = away, off = home). Done. With modes you make a mode for each "true", (day/night, home/away, etc). Then you optionally can assign those to virtual switch values (which makes modes redundant).
  • Can be seen and controlled directly by Google Home, Alexa, Homekit, etc. You can achieve this with modes, but ironically you have to create a virtual switch and then have that switch trigger a mode (which imho defeats the purpose and is just a redundant layer of complexity).

So again, I might be missing some basic concept here. The above is how I see it based on my very brief research. Let me know your thoughts.

Mode is more than a binary state (on or off). There is one guy on the forum who has something like 12 different modes he sets his house to. Managing that through Virtual switches would be impossible.

Not true. Having one switch for day/night and one switch for home/away means that your rules have to check 2 conditions rather than 1. 2 is more complex than 1.

You shouldn't need to control mode as it should be automated. This is home AUTOMATION after all. I never have to change modes manually.

1 Like

That would probably be me. Just call me Mr. Modes :wink: (and yup, controlling modes through virtual switches would be a pain).

In addition to what @Ryan780 stated, by going the virtual switch route, you lose the ability to use features like set level per mode for lights, activate scenes by mode, and setting switches and buttons per mode.

1 Like

Very true! And don't forget set color by mode and set color temp by mode as well. And the logic for all of those are built directly into Rule Machine. You don't have to create any conditional actions. I only have 4 modes and to reproduce just one of my rules that triggers set scene and set dimmers by mode would be at least 4 times as complex as it is today if I was trying to accomplish that by virtual switches. And I only have 4 modes. Can you imagine how complicated it would be if you had 6? I don't even want to try and wrap my head around that one.

Oh...and Thermostat Scheduler has modes built into it....and HSM.

1 Like

I don't have to imagine as I'm actually at 13 modes right now (with probably 4 more to be added next week at the wife's request). Trying to do my dimmers and scenes using virtual switches and setting up IF logic in RM would be a NIGHTMARE. My Whole House - Home Modes - Lights RM rule would be huge.

You guys sound like you know your stuff, but I still don't understand. :slight_smile:

  • Let's say I have "I'm asleep" virtual switch (not sure how an automated rule would know whether I'm sleeping unless I go to bed at exactly the same time every night).
  • I tell GH "I'm going to bed".
  • GH turns the virtual switch on.
  • Rule Machine reacts by turning some lights off, setting color, etc (this can be a scene).
  • Other rules such as motion sensors check whether that switch is on (don't turn on lights if I'm sleeping even if dog walks by).

Let's do a simpler one:

  • Sun rises over the horizon.
  • Rule machine flips the "Daytime" switch to on.
  • A rule for "daytime change" activates and makes things happen (these can activated scenes).
  • Other rules can check the switch status for their own conditions.

Can the above be made simpler using modes?

I don't understand this statement. Are you saying you could check both away AND day/night status with a single condition?

Very much so. But it also sounds like you really only use 3 modes. Awake, asleep and away. As your system starts to get more complicated, there are other things that you might want to do. For example, my bathroom lights. When in Day Mode, the motion sensor turns them on to 100%. But when in Night Mode, it turns them on to 50%. When i'm in Asleep mode, it only turns them on to 1%. Managing when to do that with virtual switches would be very, very complicated and involved.

Away and Day/Night are not two status. The Mode is equal to status. It is just one status. So, the "status" would be "Day" or "Night" or "Away". Those are 3 modes that you would have and you can have the mode be a condition in RM. So, rather than checking the status of 2 switches, you just have to check the mode.

1 Like

I see what you're saying now. So it seems that perhaps this is just a difference between different use cases. I have a big family with lots of variance in schedules and different needs. So I need to check multiple conditions for any action. For instance, if I'm asleep, that doesn't mean my kids are asleep (they want their lights and motion sensors on but I want mine off). Or if I'm away, that doesn't mean that my wife is away. Plus, my family is used to using GH for a lot of things (sleep, movie night, etc). So there's a lot of variability and I'm trying to integrate all of them into RM rules. It seems that perhaps I can't get away from having to check multiple conditions based on all these factors AND be able to control those conditions via GH, rather than simply setting a mode to away, daytime, etc. I think switches might make more sense for me. Thanks for the explanation.

I think one of the cool things about the HE system is that there's usually more than one way to accomplish tasks. There's rarely a fixed method you have to get your head around to do things. Use whichever method makes the most sense for you. You can also change things as you go and experiment with different methods. The software is also evolving all the time.

For example, since Motion Lighting added contact switches recently, I was able to replace a couple of RM rules with ML ones. ML has slightly less overhead and so lights respond quicker in my experience.

I use Blue Iris for surveillance and find it easier to just have it switch recording/triggering states by using modes in HE (with the BI Control app). Yes, I could use switches for that I suppose, but this way just makes more sense to me.

1 Like

Agreed, I'm blown away by the fact that not only can I accomplish everything I want, but there are multiple ways to do it!!!! And all of them are easy.

LOL, I put mine in RM and it takes literally less than half a second. With multiple conditions. I'll have to try this "even faster" ML.

Yup:

So, in my case, I have different things happen at different times of day. Why would anyone buy smart lights just to have them go on and off during day or night? With modes, you can set scenes based upon mode. Even with different schedules and lighting requirements, modes can be useful for a baseline for lighting and switches. For instance, my wife gets up for work at 6:00 AM every day. I typically sleep until 6:45 or so and my son sleeps until 7:30. So, for us, having a baseline of lights in the morning helps. My wife can still adjust the lights if she needs to with GH/Alexa voice commands or button remotes, but the baseline lighting covers 90% of our use cases.

Maybe I'm mistaken, but doesn't GH recognize HE modes? At least there's options for modes in the GH app in HE.

I found the response time in RM to be a little more variable. I have my garage lights to turn on if I open any of 3 doors but also activate and keep on with motion. With RM, they would sometimes turn instantly from the contacts while other times it took as much as a 1-2 seconds. Not sure why. So far (I've only been running the new ML a day or two) they've always been instant with ML.

Well crap. I just tried it and it does indeed!! That changes things. :blush::blush::blush:

Yes. I still see value in modes because they can control other things. Like the example I gave you with my bathroom lights. You can try and work sunrise/sunset as conditions into every rule but it's a lot easier to have each individual automation built off of modes and then have a separate rule to control when the modes change. And with more people in the house, I see more value in modes, not less. Maybe you want one mode for when the kids are out and you're asleep, so that the alarm doesn't arm to night but instead to "home" (so it doesn't alarm instantly when they get home). Maybe you want a "kids home alone" mode. You can definitely go overboard on modes and make it overly complicated but anything you want to have controlled in the same way when the house is in a particular state, you could probably build a mode for that.