Jump to content

How to program a motion sensor


TomNow2

Recommended Posts

Hi all,

I was reading the archived thread on using a motion sensor to turn on lights.  Here's what I'd like to do:  When someone walks into the bathroom I'd like the light to turn on.  Everything is working pretty good except if I turn off the light walking out of the bathroom, the light turns back on (light switch is like in the bathroom by the vanity and not by the door).  I have the motion sensor timeout set to 2 mins.  I was thinking putting wait commands somewhere might help but it really didn't.  Any thoughts? Thanks!

I have 2 programs now:

----------------------------------

Basement Light - On - [ID 0017][Parent 000A]

If
        'Basement / Basement Bathroom' Status is Off
    And 'Basement / BasementBathroom.1 Motion' is switched On
 
Then
        Set 'Basement / Basement Bathroom' On 99%
 
Else
   - No Actions - (To add one, press 'Action')
 

----------------------------------

Basement Light - Off - [ID 0018][Parent 000A]

If
        'Basement / Basement Bathroom' Status is 99%
    And 'Basement / BasementBathroom.1 Motion' Status is Off
 
Then
        Set 'Basement / Basement Bathroom' Off
 
Else
   - No Actions - (To add one, press 'Action')
-----------------------------------

Link to comment

My recommendation is to think through your requirements before programming.  Programming is a lot easier when you know what you are trying to accomplish.

It sounds as if you have a single motion detector and a single light switch, correct?

- what do you want to happen when motion is detected?

-what do you want to happen when you manually toggle the switch on?  Off?

-do you want thelights to turn on and off automaticaly?  When and under what conditions do you want the lights to turn off?

Link to comment
3 minutes ago, oberkc said:

My recommendation is to think through your requirements before programming.  Programming is a lot easier when you know what you are trying to accomplish.

It sounds as if you have a single motion detector and a single light switch, correct?

- what do you want to happen when motion is detected?

-what do you want to happen when you manually toggle the switch on?  Off?

-do you want thelights to turn on and off automaticaly?  When and under what conditions do you want the lights to turn off?

Thanks oberkc.  You are correct, I have 1 motion sensor and 1 light switch.  The overall goal I want to accomplish is that the bathroom light turns on when someone walks in.  The reason I want this is because the switch is inside the bathroom by the vanity, so guests usually get confused.  I'm using the 99% to differentiate between when I click the switch, or when it's triggered by the motion detector.

-what do you want to happen when you manually toggle the switch on?  Off?  === If I click it manually, I want it to stay on indefinitely unless is manually turn it off.  If I turn it off manually, I don't want the motion to turn it back on right away.  It's like I need a 5 second wait time so I turn it off and gives me time to get outside the bathroom

-do you want thelights to turn on and off automaticaly?  When and under what conditions do you want the lights to turn off?  === I'd like them to turn on when someone walks into the bathroom.  Then, if they walk out and forget to turn the lights off, i'd like the lights to turn off since no one is in the bathroom.  However, if a person manually turns the lights on, then it's their responsibility to turn the light off (I have another program turning all lights off in the basement at a certain time if another sensor doesn't see motion).

 

Hope that makes sense?  I'm basically trying to get my insteon switch and bathroom lights to work like one of those cheap motion sensing switches :)

Link to comment

I would have the switch disable the motion sensor when manually turned on. When you manually turn off the light, include a wait before re-enabling the motion sensor. I prefer separate programs but it can be done in 1. This allows time to get out of the bathroom before the lights turn on

If switch A is switched on 

And switch A is not switched off

Then disable motion program

Or else wait 30 seconds enable motion program

The downside of programming the way you are is people needing to remember different caveats just to lose the bathroom. This can cause a bigger headaches then it's worth. 

Link to comment
29 minutes ago, lilyoyo1 said:

I would have the switch disable the motion sensor when manually turned on. When you manually turn off the light, include a wait before re-enabling the motion sensor. I prefer separate programs but it can be done in 1. This allows time to get out of the bathroom before the lights turn on

If switch A is switched on 

And switch A is not switched off

Then disable motion program

Or else wait 30 seconds enable motion program

The downside of programming the way you are is people needing to remember different caveats just to lose the bathroom. This can cause a bigger headaches then it's worth. 

This is actually doing what I want to do.  Just tried it and works perfectly, thank you!

Link to comment

First, given your requirements, I don't believe that there can be a scene relationship between the motion sensor and switch.  Make sure that there is none.

I think lilyoyo1 has found good method.  Use the manual toggle of the switch (on) to disable the motion program.  Use the manual toggle of the switch (off) to re-enable the program (after five-second wait).

if

control switch is turned on

and control switch is not turned off

then

disable motion sensor program

else

wait 5 seconds

enable motion sensor program

 

Then, use a program to control response to motion sensor

if

control motion sensor is switched ON

then

turn on bathroom light

wait some nominal period of time

turn off bathroom light

 

(note...this motion program will retrigger every time motion is sensed.  So long that the retrigger is within the wait period, it will restart the wait clock.  Also note, it may be useful for you end-of-day cleanup program to re-enable the motion program, should someone leave the light on overnight.)

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...