Best practices for using Away Mode

Mike, I know there are several ways to set things up, and that’s part of what I love about ST, but I think we’re not quite talking about the same thing here. You’re talking routines and triggers, I’m talking modes (which are like filters for routines).

Imagine that I have 5 pistons that I want only to run if it’s dark outside. Without modes, I would need to program each piston to run only between [30 min before sunset] and [30 minutes after sunrise]. Also keep in mind that this range might appear multiple times within a piston. Let’s imagine this range appears 2 times in each of the 5 pistons, so it would appear a total of 10 times.

Now let’s say I change my mind about what constitutes “dark”, and want it to be 15 minutes before sunset and 15 minutes after sunrise. I would have to go to 10 different places and change the number (really 20 places because it appears twice each time).

Instead, I could have a single piston that sets night mode based on sunset and sunrise offsets. That’s literally all it does. Then, my other 5 pistons only need to reference night mode. If I want to change the parameters that define night mode, it’s in 1 place and I don’t need to go searching all my pistons for the 10 places it appears.

Am I over-thinking this? Maybe. I’m an engineer, that’s what I do. Having the same information appear several places is a recipe for inconsistency and is setting yourself up for “why the heck did my automation behave like that – that’s not what its supposed to do”.

2 Likes

I’m a Developer in another industry as well. We all tend to overthink things.

So let me throw this out to you for a minute in a different way.

Just an example based on your requirements:

You have 16 total Modes that I’m calling 4 x 4 based on the examples you began in your first post.

So now that you have added these 16 Modes. Your Pistons initial IF qualifications are going to include time of day and days of the week to set the specific Mode automatically.

Now you mention adding variables in WebCoRE. What are you going to base these variables values off of if not a State of a Virtual Switch? Where is the variables value coming from?

So let’s say it’s Saturday and it’s after dark. How do you know if you are going to set the Mode to “HomeNightWeekendGuests” versus “HomeNightWeekendNoGuests”. If you don’t have Virtual Switches defined as a device, how is WebCoRE ever going to know the difference between Guests and No Guests on its own and what THEN or ELSE statements to fire of off?

Thats why I am suggesting that you slim this down to Modes consisting of Home day / Home night / AwayDay / AwayNight. Then create virtual switches for Guests / No Guests / Weekday / Weekend. This way based on these switches being invoked as On or Off it dictates what Pistons fire or what steps in a Piston fires. You can Automate these switches with a Piston based on day of the week and a default value for Guests or No Guests and things automatically run, but then you also have the ability to open the device in Things and say oh wait, we have guests coming, let me switch to Guests and the appropriate Piston or step in a Piston fires and sets up the appropriate Mode and the device Automations that are to occur. Maybe that will help in looking at it from a different angle.

Personally, I find having a bunch of modes has been an Automation Nightmare!

Three Modes for me. Home, Away and Night.

I find it way more intuitive to create Virtual Switches(VS) to act as “Modes”

Modes affect everything while VS can be assigned to specific Pistons or Rules.

Each room in my home works independently than the others.

Each room has a Master Room VS and a Master Automation VS.

Don’t need a guest Mode when I can easily have a VS called Guest Automation and rules can easily be edited to say in the Master Restriction section of the Piston, “If Guest Automation is Off or On”.

This kind of logic is built into every Piston.

Alexa, turn off Day Room Automation

Now everything that has “And Day Room Automation is On” will no longer trigger.

I put all of my Automation Switches in its own Room for easy access.

Saying all that, having only 3 Modes makes things really simple to keep track of…

3 Likes

That’s exactly what I do. I have one piston that does nothing but change modes throughout the day. It does not care about presence, it does not care about guests, it does not care about holidays. I do have it alter things a bit on the weekend though…but otherwise it just hums along. However, I have it make calls to external pistons which do the things I want done when it’s dark, or when it’s morning. So when the time of day (or sun in the sky) changes, my mode changing piston runs, and then it runs the piston for that mode.

1 Like

We are all conveying the same message in a different way with a slightly different approach :grinning:

Agree, we are saying mostly the same thing with different methods of getting there. The point is, my home is always in multiple states simultaneously, and we are all finding a way to deal with that. The ST built-in “mode” is simply a global variable, it just happens to be the only mode type of variable (other than SHM) visible to the ST app.

WB70, To be clear, modes that look like “HomeNightWeekendGuests” and “HomeNightWeekendNoGuests” are what I’m trying to avoid. I am proposing setting up separate variables in webCoRE that are named things like @LocationMode, @DayMode, @WeekendMode, @GuestMode, etc.

So in the question you posed, (Saturday, after dark, & assuming I’m at home) I would end up with:
@DayMode = Dark
@LocationMode = Home
@GuestMode = undefined until something sets it, like a virtual switch, perhaps.
@WeekendMode = Weekend

In the case of GuestMode, a virtual switch is a very good idea. You could argue that the virtual switch itself can work like a “mode”, making the @GuestMode variable redundant and unnecessary… But that only works because in this case, it’s binary, either on or off. Guests or no guests. That’s probably all I would ever need, but hypothetically, what if you wanted to differentiate between types of guests (no guests, generic guests, in-laws, and college-friends)? A single on/off virtual switch won’t work for that. You would need 3 virtual switches (a Master Guests Switch, an In-Laws Switch, and a College Friends Switch) and also write a piston to link them together such that when the In-Laws or College Friends switch turns on, then the Guests Master switch also turns on, and when the Master switch is turned off, all the others turn off.

Since virtual switches are visible in the ST app and variables are not, perhaps a virtual switch approach is best.

Holy Mother of Pearl!! If I need all of that just to have guest, than I have totally messed up my “non-intrusive” Home Automation approach!

I did A LOT of research before purchasing devices. My main goal was to have a system that operated both manually and programatically. I think I have achieved that mostly!

All of my Switches look and operate like regular rocker switches.
Most things have a manual on button or switch.
Most people wouldn’t know the house had over 200 “Smart” Devices because most things run in the background.

For the techie people, I have FireTablets in every room and an Echo Device in every room.

After a couple of years fooling with this stuff, I have a very high WAF and I have learned the true concept of KISS (Keep It Stupid Simple).

Now, if someone saw my webCoRE dashboard and my network closet, they would think that I was either a spy or involved in something that I shouldn’t be!

Sidenote: The best device I have in my home is a dumb occupancy/vacancy motion sensor in my Master Bedroom Closet…That thing has NEVER failed!

1 Like

Ditto… This is exactly what I’m building towards and what I have in mind with every new purchase. There’s a ton of tech here,but I want it to still work without getting in the way.

The Alexa devices can also be used to alter the state of a virtual switch whereas they cannot manipulate global variables. Although you may want to be wary of what you name the switches if you go that way…because if the wrong person hears you say something like “Alexa, turn on Guest” you could have some explaining to do. :slight_smile:

2 Likes

:rofl::rofl::rofl::rofl: Good one!

1 Like

I completely agree, that was just a hypothetical example of where a simple switch wouldn’t cut it. I personally would never get that complex with a guest mode.

You and I also have the same goal – I want to be able to operate my home as if it were “dumb” as well as “smart” with normal-ish looking switches. I’m not quite there yet, as I was focusing on how to effectively set up a mode architecture for automation tasks that I might need, before buying more devices.

True, but you could have Alexa run a routine. Then you could set up a piston that detects when a routine is run, and set the variable accordingly.

I’ve started down the “variable” path. If I find that all the mode types I need are binary, then maybe I will change them to virtual switches.

Nope, I’ve pretty much moved all of my old Routines into webCoRE. Very happy that I’ve done that too.

I believe he meant creating a Routine in Alexa (not in ST) that turns on/off a virtual switch and in turn having a variable in webCoRE for the value of the switch.

That sounds…redundant. I just use the virtual switches themselves to determine what to do next.

1 Like

That’s not redundant at all. a Routine in Alexa allows you to say a phrase (that’s the Routine name in Alexa) which allows the ST virtual device to turn on or off and then at that point SmartThings / WebCoRE (Piston) fires off the State Change of the Virtual device. Nothing redundant about it. Giving voice control from Alexa to perform the function instead of manually changing the virtual switch in ST.

Example:

Alexa, “Guests have arrived”
Ok (Guest virtual switch is turned on from Alexa to ST)

Piston fires based on:

  • Day of the week (weekday or weekend)
  • Time of day (Day or night / between Sunset and sunrise)
  • Guest device = On

Piston sets:

  • Mode to Home - Night
  • SHM to Disarmed
  • Front door unlocks
  • Music begins playing throughout the house

I only mentioned variables because of the way Brian was talking about initiating things in webCoRE thinking that he could set a variable based off a routine running versus physical state of a device which is where I was going yesterday that if he simply has virtual switches for some of the stuff he was mentioning about triggering off of to set a Mode or other values based in things like time of day, or day of the week, etc… :grinning:

Wasn’t trying to add more confusion. Was based on and just adding more to the voice side of the equation in addition to what Mike and Ron had already shown to Brian as to how they are already successfully accomplishing what he wants to do in a not so complex way.

1 Like

What I was ultimately saying yesterday to Brian was having a smaller amount of Modes defined:

  • Home - Day
  • Home - Night
  • Away - Day
  • Away - Night
  • Vacation
  • Pause (stops everything from running)

To set the appropriate Mode / SHM armed state, a Piston is defined based on Presence and Time of day (Sunset / Sunrise).

With Mode being set having two additional virtual switches added based on OPs requirements:

A virtual switch for:

Weekend (This is automatically set via Piston based on the day of the week - Off = Mon - Fri and On = Sat Sun)

Guests (Off means no Guests and On means Guests)

The value of Guests is Off by default, but to know that Guests have arrived, this device needs to be manually turned on via ST App, ActionTiles or from my example above, via Alexa.

Now that he has the Mode appropriately set based on Presence and Time, and the Weekend switch automatically set based on day of week and the additional switch to specify Guests, he can now define a Piston or Pistons based on Mode, Weekend and Guests to initiate and control the house based on these values being set automatically with the exception of guests which is end user controlled (however the latter could be automated if any guest had an Arrival sensor or they all had webCoRE Presence installed with their Location defined) <— For @anon36505037 :slight_smile:

This of course is just an example folks based on what @Brian_Renstrom wants to accomplish. Not to be taken verbatim. But what he was trying to state as variables, I see this being the simplified approach based on his use case, versus an astronomical set of Modes.

I’m coming around to the idea of using virtual switches thanks to everyone’s helpful insight. :slight_smile:

I actually meant that you could have Alexa (or in my case, Google Home) activate a smartthings routine, and then a piston detects when that routine is run, and the piston sets a variable. It’s just a roundabout way to access a variable with voice commands. Not as direct as saying “Alexa, turn on guest mode” where the virtual switch is named, literally “Guest Mode”.

I think what I will ultimately end up with is to treat the built-in mode as a Location mode (since that’s what webcore calls it) where the only 2 possible states are Home or Away. Then set up virtual switches for:

*Night Mode: On=Night / Off=Day
*Sleep Mode: On=Asleep / Off=Awake
*Guest Mode: On=Guests / Off=NoGuests
*Vacation Mode: On=Vacation / Off=Home

The only other thing that would greatly simplify my setup (and this is somewhat off topic) is direct activation of scenes in webCoRE without having to set up a routine to activate the scene.

Create separate Pistons to be defined as your actual Scenes and call those from your main Pistons. I personally won’t create a scene in ST as it lacks a lot of functions. My definition of a scene includes changing colors of bulbs (a moving scene versus a static scene if you will)

As for Weekend / Weekday, are you removing that from the overall equation?

The rest of your post, I wholeheartedly agree that this is a great approach and even eliminating the additional Modes to simplify this piece even more and opting for Virtual Switches.

1 Like

My only hesitation with creating a piston as a scene is that now I don’t have a way to access it easily from my phone. Is that where actiontiles would come in? Or is there an easier way to do it?

Yeah I think having a switch for weekend is not necessary for my case, but if I need it I’ll just create another switch. Was just an example that I’ve seen others do.