What's your preferred way of managing location/mode status?


#1

I currently have 6 separate pistons that I use to manage whether or not I’m home/away; bedtime/asleep; morning and vacation modes.

Each piston triggers other pistons depending on what it controls, e.g. my away piston locks the door. Some of the pistons have multiple triggers to cover any scenario.

I’m curious how others control their location/mode statuses; one piston or many? Use them to flip virtual switches or control pistons directly?

I’d appreciate any thoughts on this!


#2

I use separate pistons to control actions/devices with my alarm modes. I DO NOT use pistons to disarm my system. I lock doors, adjust lights, announce visitors…etc. Writing short, task-specific pistons works for me.


#3

well the whole nine yards:)
In my house, each room has seperate piston(s)
Global variables determind each rooms status
ie : @mbedroom = 10 / @mbedroom = 7 / @mbedroom = 2
10 is for alarm status ON
7 is for lights controlled by motion sensors
2 = For reading, no motion sensors

I can change the variables
a) Alexa - voice command (Bedroom night mode etc)
b) Action tiles (Ipads on the walls or phone)
c) Timers in pistons
d) Other pistons getting activated (If i wake up and go to the office and say “good morning” that means I am up, so Bedroom can get out of night mode etc)
e) Zwave buttons, open close sensors around the house.


#4

I have a set of pistons whose sole purpose is to collect data into global variables (e.g. Detect If [Person] is Home). Essentially documenting the current state of my house/life.

Then other pistons react to one (or a combination) of those global variables.

So, when Person1IsHome and Person2IsHome both turn false, I set another global variable, IsAnyoneHome to false. Then another piston reacts to no one being home by changing the mode to Away. Then my alarm system piston kicks in based on Away, and then arms the alarm, etc…

This allows multiple pistons to handle things rather than have one giant piston doing all the work or having to duplicate logic in multiple pistons.

I also use Tasker on Android to call pistons via HTTP to feed webCoRE data it doesn’t know about natively.


#5

I don’t rely on pistons to secure the house. I have the Schlage lock auto-lock upon closure.
I have pistons that prevent the lock from locking if the door is open. That does not rely on location/mode status.

What I have is changes in mode dependent on time, and dependent on presence. If the lock is unlocked by a presence sensor arriving OR by a code being entered, the piston knows who unlocked the door and sets a mode accordingly. Right now I have a contractor who has a code to get in, and the house goes into ‘construction’ mode when he arrives. It allows access to downstairs and the basement, while alerting me if they access upstairs.


#6

I didn’t think about using global variables to determine presence, then running everything off of those. I just have a piston for each mode and the logic that determines the mode is set within them. I can certainly see the utility of global variables though!!

How are you doing presence detection? It’s just me in my house so my use case should be pretty straight forward. I also use Tasker to tell the system when I’m home.


#7

I couldn’t agree more. I always tell people not to depend on smart home technology with safety/security of your home. My alarm system is just for cats:))) if any door left open more than 30 seconds, alarm will go off.


#8

Do you have 1 piston for each mode? E.g. a piston for home mode and a piston for away mode? That’s currently how I have mine set up, but I kind of like the idea of having one piston that figures out modes, sets the variables, etc.

edit: a concern I have is having a piston with like 10 triggers in it. I know that @WCmore limits the number of triggers in his/her pistons.

I guess my question is can you use the changing of a variable as a trigger? Or does that need to be a virtual switch?


#9

Yes you can use changing variable as a trigger.

IF @examplevariable CHANGES TO XX
Then 
Do this do that

#10

Thanks, @ike2018!

Is it bad practice to have a piston like this:


#11

I believe this piston will have TONS of problems due to multiple triggers in a singe IF block.
correction : You use them with OR so it’s better…
I will take a better look at it.

ps: you can upload your pictures here.


#12

My “normal” set of pistons has this logic all broken out per mode. So the Away Piston ends up with only 4 or 5 triggers, the home with 4 or 5. This piston clearly has a ton of triggers.


#13

I implemented my own routines instead of using SmartThings’. So I have a “Trigger Goodbye” piston that calls the “Goodbye” piston when certain conditions are met. The latter is what actually does the work of changing the mode to Away.

This allows me to manually call Goodbye via other ways. It also lets me distinguish if Goodbye happened automatically or manually.


#14

You can also force it to subscribe to a variable changing by picking Always Subscribe. In certain cases, webCore doesn’t offer a trigger you want and you have to use a regular comparison and force it to subscribe.

This is not one of those cases, but I just wanted to show the option…


#15

So your ‘Trigger Goodbye’ piston has some conditions that, when met, will trigger the ST Goodbye routine? The ST Goodbye routine sets your mode = Away? Then your other pistons run based on the mode = away?


#16

I looked at it and I believe you don’t need to GROUP your ORs
I mean this way would work but I always try to keep the pistons as simple as possible…
I would split them into two groups of seperate IFs
But the part worried me is:
As soon as line 48 turns the switch ON,
it will trigger line 37 and the whole thing will execute again.


#17

You got it. But again, my Goodbye routine is just another piston. I don’t use the SmartThings routines.


#18

I slimmed down some of the triggers so there aren’t so many.

But as far as that Home_Switch device - you’re right, I need to fix that. Good catch!