Turn off unless manually turned on


(Keith) #1

I have a motion sensor that i would like to turn off a light after about 5 minutes of no motion but only if the light was not turned on manually. The only way i can think of is if the light was on for 6 minutes do nothing, but if it was on for less then turn it off. Is that the best way?


(Ron Talley) #2

CoRE can do this. webCoRE can not as yet.

Install CoRE and use a trigger to expose the interaction feature:

Example: If switch Changes to On (interaction physical or programatically)…

I use this feature in combination with boolean variables to define a true of false state.

Interaction does not work with all switches or dimmers.


(Don) #3

I’m not good with core. But could you cancel the off timer on a change in state of the switch?

I think it’s on the bottom of the options.

I know I have read where others have done something lime that using core.


(Keith) #4

I have something i thought would have worked but doesnt.

Core Piston #1 - Basic
If time is between 7pm and 7 am
and hall light switch is off
and hall motion is active
then
using hall light turn on

Core Piston #2 - Basic
If Core Piston #1 was executed
and
hall motion was not active for less than 1 minute
then
using hall light turn off

This looks like it should work, but if i turn on the light manually core piston #2 will still turn it off. It seems to ignore the first if statement (if core piston #1 was executed)

Thoughts?


(Keith) #5

I got it, core piston #2 first if statement was changed to Piston “Core Piston #1” instead of Core Piston “Core Piston #1


(Keith) #6

Any thoughts on how i can get the light not to turn of if i physically turned off the light within the last 5 minutes? I currently have 3 pistons

Hall On - turns on the light when motion was detected and the light was off
Hall Off - turns off the light when “Hall On” was executed and no motion in 3 minutes
Hall Manual off - doesnt do anything at the moment.

I tried modifying “Hall On” to only execute when piston “Hall Manual off” didnt execute but it doesnt have a time frame window. I tried setting a variable in “Hall Manual off” but couldnt get it to work. Is there another way or is a variable the best (i’ll keep messing around)

Thanks


(Ron Talley) #7

As stated earlier, use CoRE and a Trigger to expose the “Interaction” function (Physical and Programatically). Use variables to define (interaction)

You can define a variable (Type Boolean) call it {offmanual}, however you can name it whatever you want without the { }…

Basic Piston in Expert Mode (This is the Piston build for your original question above) Enable Expert Mode in CoRE settings.

Simple version with no variables

If Motion is Inactive
And
Light Stays Away From On (Interaction Physical) for at least 1 Minute
Then Using Light
Wait 5 Minutes
Turn Off
Cancel on Piston State Change

Here is a more complex version with way more flexibility using variables

If Light “Changes” to On (Interaction) Physically
When True
Using Location
Set Variable {onmanual} type boolean=True

Or

If Light “Changes” to On (Interaction) Programatically
When True
Using Location
Set Variable {onmanual} type boolean=False

Or

Add Group
Add Conditions
If Motion is inactive
And
If Variable {onmanual}=False
When True
Using Light
Wait 5 Minutes
Turn Off
Cancel on Piston State Change


(Keith) #8

thanks i’ll give that a shot


(Ron Talley) #9

I had to use this DTH for my dimmers for them to report manual operations.

The below webCoRE Piston is a starting point for you. You may need to adjust the parameters but it should work for your scenario.


(Keith) #10

I’m struggling to get this to work. I’ve simplified it to just and try to get something to happen. Here is what i’ve got

If Light “Changes” to On (Interaction) Physically
When True
Using Location
Set Variable {onmanual} type boolean=True

Or

Add Group
Add Conditions
If Motion is active
Turn On

Nothing happens, i’m not really sure what this is, i cant find it in any option “Cancel on Piston State Change”. Not sure if that matters


(Keith) #11

I believe i got it working. Not sure what i did the first time, but i deleted everything and did it again. Thanks all