New user struggling with automating switch with presense


#1

Hi all, very new user trying to do a basic task which I'm really struggling to get right in the app. I was t to set a ST socket to run in two modes:
1. After sunset when either myself or my wife is no longer in presence range, turn on the switch

2 after sunset, when both myself and my wife ARE in presence range, activate the switch using ST motion sensor only.

This seems simple yet I can't figure out how to make it work.....any advice appreciated. I have home and away modes configured but away is set only when both of us are no longer in presence range. And home is set when at least one of us is home.


#2

Welcome!

You actually won't need mode to do this, but you will need two separate smartlighting automations.

One will turn on the light when you are both away.

The other will turn on the light based on the motion sensor after sunset.

1a) select the light you want to have turn on

1b) have it turned on based on arrival/departure and select "when everyone leaves"

1c) select "more options" and then you can restrict it by time, including a time based on sunset

The second lighting automation is similar.

2A) select the light to come on

2b) this time select it based on motion

2c) select the motion sensor

2D) again choose "more options" and you will be able to put a time restriction on it.

If you haven't previously used smartlighting, here are the instructions for that:

After you have set up an automation for the first time, if you want to go back to it and make any changes, open the mobile app, tap on "automations" at the bottom of the screen, then choose "SmartApps" at the top of the next screen , and you will see it there. :sunglasses:


#3

But doesn't this only turn the light on when BOTH presence sensors are out of the home. I'd like it to work when EITHER of the presence sensors are out of the house. One if I go out, but my wife is still in, I would like the switch to come on. If we are both out I'd also like it to come on. From what I can tell it only has the option for when we both leave?


#4

It's like I need a third option 'when somebody leaves'


(Chris) #5

Smart Lighting is great for simple automations. If you're looking for more advanced control over your conditions, check out CoRE...it's a really robust rules engine that gives you significantly more flexibility, albeit with a bit if a learning curve. It'll do what you're looking for.


#6

Sorry, my bad. I misread your first post.

Yes, definitely you can do it, but here's where you need to make a choice.

There is a very sophisticated community created rules engine, core, that can do all of this and much more. It allows for stacked conditionals like "if a and B but not C while D". The only thing is it is really complicated to set up and you may need community assistance to figure out individual rules. But if it's something that you're interested in, you can absolutely do the most with SmartThings by using core.

A simpler approach is to use an alternative presence detection method for this particular situation. If you have either an iOS or an android phone, I would recommend just using IFTTT. It has its own presence channel. And of course smartthings has a channel.

So you just set up two IFTTT recipes. One detects when you have left, and uses the SmartThings channel to turn on the light.

The other detects when your wife has left, and does the same thing.

( you will each need your own free IFTTT account, but they can both link to the same SmartThings channel)

It's simple to set up and should work fine for this use case.

https://ifttt.com/channels

Alternatively, you could get started with core. It will solve not only this use case, but give you the tools to do many more complex rules. I will post the links for it in a minute.


#7

To use CORE, you will need two threads.

The first thread is the peer assistance thread. This is where the core experts hang out. People there will be happy to help you with any core questions. (Core calls an individual rule a "piston")

And here is the author's thread where you will get the code for core.

Again, core is very powerful, but also very complex. Feel free to ask for any help you need, including just explanations of how CORE works. But ask those questions in the peer assistance thread. :sunglasses:


#8

And if you haven't used IFTTT before, the following is a good tutorial:

http://www.pocket-lint.com/news/130082-ifttt-explained-how-does-it-work-and-what-are-the-new-do-apps


#9

Really helpful information, Thanks destructure00 and JDRoberts, I'm happy to invest a little time and effort into CoRE. I'm technically minded, so happy to read threads if its going to give me the flexibility i'm looking for....little astounded that this isn't an option in the basic set of rules though. I'll have a flick through the CoRE material you provided and see if I can figure it out, if not, i'll try using IFTTT. I've no doubt you will see me popping up on the CoRE Forums.