Motion triggers lights with time restraints

Here’s what I’m trying to accomplish.

If: Motion = Specific lights turn on.
Manually turning changing lights after automated on (for example, to watch TV) does not allow lights to turn back on via additional motion within ___ minutes.

If: No motion after ___ minutes = Lights off.

Can anyone help? I’m not familiar enough with coding SmartApps to know my way around this yet.

You could use Webcore and and if statement on the turning off part to only happen if the dim % is the same. Or you could add a way to tell if you’re watching TV. Harmony activity, power meter the tv is plugged into, unique Mode, unique virtual switch, etc.

seems like the “smart lighting” Smart app in the Smartthings app can handle these requests.

Have you already tried this built in app?

1 Like

It depends, the condition to notice if the lights were manually turned off is the only tough step. Do you have a Harmony or something similar that has a mode or routine or anything that controls the TV?

@prjct92eh2 has the right idea. Webcore is a smooth way to accomplish this. Here’s an example, there are many ways to skin this :cat2: in webcore, like having a routine trigger when switch is physically turned off, which sets a Smartthings mode, called say watching TV. I made a variable though, which is optional. Webcore looks daunting at first but it is well worth the 30 minute learning curve.

@Matt_Behnken, I have tried that app, but I haven’t been able to get it to do the timing piece that I need/want. I’m open to trying my hand at webcore, though I’m a total n00b so I’ll need to learn everything to pull it together. Any pointers for getting started? @prjct92eh2 too?

[deleted]

Additional feature that the developers of webCoRE created.

That should definitely get you started. There will be a quiz at the end :grinning:

there is a welcome video and step by step instructions too. If you haven’t done any kind of if/then/else before its well worth your time. Webcore opens a whole new world of possibilities!

I found installing and using webcore easier than installing NST manager (a smart app and device handler for members who want to integrate Nest Thermostats and Nest products), which thousands of members have completed.

Once it’s installed try to make some super simple ones to verify it’s working. The programming part is easier than installing it. It’s all drop down menus.

Thanks @Matt_Behnken! I’ve managed to get rolling and I’m fully installed, just trying to replicate your screen cap that you dropped in earlier today. I can fill in my lights and get past the first if statement, but after the first ‘then’, I’m trying to accomplish your "pause piston command. I’ll keep reading up to see what I’m doing wrong. Hoping the video sheds some light on everything too.

so that was really just a place holder, it would pause a different “piston” that manages the turn on the lights when there’s motion.

Instead of having a different piston (lil program) to turn on the lights when threre is motion, you could have a “mode” for watching tv. Out of the box the Smartthings comes with Home, Night, and Away I think. You can add more modes (like watching TV mode). Anyway, when you make automations in the regular Smartthings app you can choose to run those smart apps only during some modes. Sorry if im overcomplicating it :). But yeah you could just make a piston that says IF motion in living room, turn on living room lights, save it, and it would run. But remember to delete the old smart app “smart lighting” or whatever it was in ST app.

Oh, I’m tracking now. So first step would be to build that piston. Then we build this one, which adds the next level of complexity.

1 Like

I would probably add a mode since I like to do that and I like to use the built in smart apps first. For instance I have a “Company over” mode, which most of my voice notifications don’t run and the alarm doesn’t arm automatically etc.

so then if the switch is physically turned off, then change the mode to “watching tv”

here’s how to add modes, only takes a min or so: FAQ: How to Add a New Mode, or Manually Change from One Mode to Another

I’ve gotten the adding modes thing down. Was experimenting with “motion active” and “motion inactive” earlier to try and accomplish what I wanted.

nice, webcore is definitely for experimenting.

here’s a more concise one if you are comfortable with modes. You may need to look at your other automatons in the ST app and see if you want them to run in “watching tv” mode also.

You don’t need to build from scratch. You can import his by choosing the restore from backup code when adding a new piston.

1 Like