I currently only use modes for one thing: Home & Away. But I really just treat modes as another hub variable, and could easily just switch them to variables and have the same functionality. Then that raised the question of what the purpose of Modes was if they were just like variables.
My take on it is modes as a variable is simply a status or a trigger while the mode itself determines other things (like specifically what lights are on and what rules are ignored while in that mode) I would think building in a specific variable to a rule that looked at the mode for each rule about a device you made would get very cumbersome.... Again, just the way I look at it...
It's just a string variable. That's it. You can put anything into it you want and then because of it's first'ness it's available in most Automation tools to be tested.
Now the MOST obvious usage is what ModeManager does. It allows you to set time based conditions. Day, night and then Away. But again, those are just words. There is nothing to stop someone from setting mode to be "Baseball" "Football" and "Hockey" and then test for those in Automations.
As Hubitat's grown, so too have variables. Variables probably can do everything mode does and more but, mode is still using up the name that makes the most sense. You can't have your own variable named mode
To add to the above, the biggest advantage I see for modes is that many apps have some built-in way to use them. For example, most lighting apps can set dimmers or bulbs differently depending on mode, or just not even then them on in certain modes. Rule Machine also has some "by mode" actions, though given that it's Rule Machine, they mostly just save you some clicking over making a bunch of conditionals on your own (you can still do it either way). There are also apps like Mode Manager that make setting modes automatically easier than doing it all yourself--but ultimately, yes, it's effectively just a globally string variable, once the only thing like it on the platform.
Not all apps let you use variables, and not all apps that do let you use them let you use them in exactly the same way. If you mostly have rules or custom apps, you can pretty much do whatever you want. If you have apps that specifically look for mode...then not so much. But nearly every app has some option to use modes somehow, even if it's just the default feature provided by the platform for simple apps to just not run at all in certain modes.
Thanks. I'll have to think about this some more. I guess I don't have any current uses where modes HAVE to be used, but maybe I haven't gotten there yet. All of my stuff is rules, so I just have the home/away mode acting just like any other variable in my arsenal.
Probably some of the most common uses of Modes is "Evening" and "Night" where the brightness/dimmer is set to different values based on Mode. Where "Night" means you simply want 'path lighting' (very dim) vs read-a-book light levels. (assuming anyone does that any more.)
I have multiple modes. They combine presence and sunrise/sunset. The nice thing is you don't have to define them in every rule, you just select a mode to act upon.
For example one of my modes is "Sleep" which is active when we are home and between 10PM and 6AM. So for most lights that are on a motion sensor, they do not turn on in Sleep mode. And for nightlights and certain bulbs, they only turn on at a very dim level in Sleep mode.
Modes also determine dimmer levels throughout the day. Things are brighter during the day when we are home, medium intensity after sunset, and motion lights often don't come on at all when away.
That in particular is a Motion Lighting app. I actually don't use that very much anymore as I migrated to the newer Room Lighting app, but this instance was the easiest to screenshot. The concept is the same in most or all apps though, even in some/many community based apps.
You don't need to use this with Motion Lighting, you can do other things with Modes. For instance, you can check for doors unlocked or set thermostats if mode is away. There are other examples, but there are probably some things you could use Modes for if you think about wanting to tie many things to a certain presence or time of day (or both).
Geo location as trigger (you leave home and the are)
Trigger sets mode to away
Away mode encompasses things like Lower/raise thermostat to whatever set point
Ensure all doors are locked in case you forgot to lock them
All interior lights off
Tv off (if you left it on)
If between sunset and sunrise then exterior flood/decorative lights on...
Return home triggers new geo event and sets mode from away to home. Front porch and interior foyer lights on before you even hit the steps.
Door unlocks
Ac/heat reaches set points
Kitchen motion sensor now active in case you go in but lights will remain off until you actually go in there because you may be half knackered and pass out on your foyer
I personally don't use modes anymore. I used to for day/night/away but I would inevitably run into an instance where the mode didn't change properly and now all of a sudden all my automations are not working right. The biggest culprit was the mode getting stuck as "away" and not changing back to the proper mode based on time.
So now, any rule I only want to run when present/away or day/night, I just set that as a condition in the rule. If a single rule misfires, it at least doesn't affect any other rules (most likely anyway).
Thanks. Yeah, I understand (and have some of those actions set up already) but I don't see how that would be any different if you have Home/Away as a variable instead of a mode. I don't have some of those devices, so maybe I don't understand how modes are different. Are modes easier to set up than rules/variables?
I solved the mode issues mentioned by using rules which just set to the desired mode based on conditions.
For example I use Alexa to throw a switch "TimsPhoneHome" to on or off if my phone is in or out of a preset geofence. Then based on that switch I have rules that set mode to Away or Not. If not I use time of day to determine which mode is right, morning, day, evening or night. All of my automations work off of the mode then.
The only hiccup I have is if Alexa (the big slacker) occasionally doesn't notice me home fast enough! In that case I use the HubitatMenu android app to force the mode to the right setting from my driveway, but Alexa usually gets it right.
That stuff is only for presence, modes are mostly managed by the mode manager just fine based on weekday, time of day etc