SmartThings Community

Actions based upon who is present?


Right now I have lights turned on with motion. However, is there any way to selectively have that happen for each presence sensor? I would love it if when a particular presence sensor is there (for example a dog!), that lights don’t come on but will for my personal presence sensor.

(Brian) #2

Rule Machine +++++++

(Tony - SmartThings Unpublished Contributor ) #3

I incorporated selective presence into my Flexi Lighting system.

You can check out the code I used to accomplish it in the Flexi Trigger SmartApp: FLEXi Lighting - a flexible system for lighting scenes (Hues, dimmers, and switches)


Thanks for getting back to me on this.

However, I’m truly a novice on this – so what do I do now???

Can I trouble you to give me specific instructions on what I need to do?

Thank you SO much!

(Tony - SmartThings Unpublished Contributor ) #5

Log into IDE:

Copy desired code (start with the templates in the SmartApps page).

Modify preferences section of code to include user selection of presence device. Then add an if block around the the code in the main section that turns lights on. An example of this is in the Flexi Trigger SmartApp I mentioned.

Hope this helps.

(Brian) #6

If you are a novice you should start with smart lighting more and routines.

Move to rule Machine after that when you get comfortable.

Then start coding if you want to dive deep.


This should help. This FAQ ( this is a clickable link) explains how you use custom code in SmartThings:

After you’ve read that, people have suggested two different possible custom code solutions for you to consider.

Flexilighting is specific to lighting. The author has already given you the link to the code that you would copy.

Rule Machine is a comprehensive rules engine with many different options. You’ll find its code and discussion with its author in the following topic: