Jump to content

Fast, programmable motion response 2420M


Toddimus

Recommended Posts

Hi folks, I've never posted here but have been reading many of the great threads over the last year of so since I "geeked out" on home automation. :) I have a question and a potential feature request if what I want to do can't already be done. Here goes...

 

My requirements:

 

Wireless PIR sensor (2420M) should trigger one or two dimmers to turn on under some conditions (conditions are described below). When in "auto mode", the light(s) turn on upon motion sense and turn off after 30 seconds (off timer program). When "auto mode" is suppressed under certain conditions, the motion scene should not affect the local dimmer(s).

 

Schedule based "auto mode" conditions:

  • Morning, set dimmers to 40% upon motion
    Daytime, don't turn on lights at all upon motion (ideally, remove from the scene which is part of my FEATURE REQUEST)
    Evening/Early Night, set dimmers to 40% upon motion
    Late Night, set dimmers to 20% upon motion

 

Manual override conditions:

  • If dimmer switch is turned "ON", individual light turns on to preset level (i.e. locally applied level) and stay on for 2 minutes, suppressing auto mode while timer is active
    If dimmer switch is turned "FAST ON", individual light turns on to 100% and disables auto mode off timers
    If dimmer switch is turned "OFF", individual light turns off and suppresses auto motion response for 2 minutes
    If dimmer switch is turned "FAST OFF", individual light turns off and disables auto motion response until auto mode is reset the next day (by another reset program)

 

I know that this can be done using programs to trigger dimmers to turn on given other programmable conditions, and I have been able to do this with functioning groups of trigger/schedule/action programs. My problem is that I want the lights to respond ASAP upon the motion trigger event. If I use programs to determine what happens when a motion "ON" event is registered (subject to the conditions), I have to wait at least a second for the response to happen because the ISY is actually receiving/processing/sending the Insteon commands. For most of my demands, this is just fine... I can wait the second or so for the lights to turn on. In my hallway, which is very short in length, I can't bear the second's wait for the lights to turn on... I'm already out of the hallway before the lights turn on.

 

You might then say that I should link the motion sensor to the dimmer(s) so that they turn on immediately when the motion sensor sends the "ON" command. In effect, this would take the ISY out of the action loop and speed things up dramatically. My problem with this is that I don't always want the lights to turn on when motion is sensed. So you might also say that I should set the dusk/dawn threshold to an appropriate level. I have had mixed success with this so I have opted to not use the dusk/dawn (night only) mode of the motion sensor. I'd also like to know about motion during the day for occupancy programs so I always want to get "ON" commands from all of my sensors, so night only mode doesn't work here either.

 

So I've come up with a hybrid solution that mostly works...

 

I set it up such that a scene controls the dimmers (responders) when the motion sensor (controller) sends an "ON" signal. The motion controller is set to send only "ON" commands, always, day or night. I use a variable ($sHALLWAY_STATE) to determine which mode I am in:

 

  • -1 = Auto mode disabled, dimmers off
    0 = Auto mode suppressed for 2 minutes, dimmers off
    1 = Schedule based auto mode, Morning/Evening/Early Night => dimmers to 40% upon motion
    2 = Schedule based auto mode, Late Night => dimmers to 20% upon motion
    3= TBD auto mode --- Reserved for future use (like away-from-home security)
    4 = Manual override when local dimmer button is pressed "ON" => turn on to locally applied level (70%) and suppress motion response until 2 minute timer expires (or lights are locally turned off)
    5 = Manual override when local dimmer button is pressed "FAST ON" => turn on to 100% and disable motion sense response until reset or turned off locally

 

I have basically achieved what I want by using the action: "In scene - 'Hall after motion response' set 'Dimmer - Hallway' XX% (on level)" in a few programs that are executed depending upon the change of the state variable "$sHALLWAY_STATE". I change the XX% depending upon the schedule and/or manual override mode as described in the numbered list above.

 

Like I said, this basically fulfills my requirements because it's fast and the lights turn on to whatever level I want. The problem I have is that my suppression of the motion sensor activation of the scene doesn't always work correctly because I am constantly adjusting the on level of the scene to achieve most of my requirements. Two example problems:

 

Say I'm set to the LATE NIGHT auto mode (=2) and therefore the 'Hall after motion response' on level is set to 20%. I walk into the hall and the lights turn on to 20% as the motion is sensed. I then turn "ON" the local dimmer switch because I want more light. If I stuck with this, the lights turn on to the locally applied level (70%) but immediately turn down to 20% if I move a muscle because the motion scene takes over. I have dealt with this by creating state (=4), which again uses the "In scene - 'Hall after motion response' set 'Dimmer - Hallway' 70% (on level)", where 70% is equal to the locally applied on level. Ok, works pretty well, but if I turn the lights locally "ON" (not "FAST ON") again it goes to 100% for some reason. I can live with this but it is undesireable.

 

Now say it's daytime, and I want the lights to only turn on when the local dimmer is turned on, but I still want to get motion "ON" events from the sensor. That puts me in the state (=0), where auto mode is suppressed and I will go to mode 4 or 5 if the local dimmer is turned "ON" or "FAST ON" respectively. This is my biggest problem... given my programming/scene setup, I then set the motion response "In scene - 'Hall after motion response' set 'Dimmer - Hallway' 0% (on level)" to prevent the motion sensor from turning on the lights upon motion during the day. In most circumstances this is fine, but what happens when you actually want to turn the lights on? The dimmer is inextricably tied to the motion sensor because of the 'Hall after motion response' scene, so the lights actually turn off when motion is sensed. See the problem? I want to be able to programatically remove the dimmers from the scene under certain circumstances. I haven't been able to find a solution for this. This leads me to my feature request...

 

Give us a way to programatically add/remove devices from a scene.

 

I realize that this would cause a bunch of Insteon traffic, so it probably shouldn't be used all the time, but it would be very, very useful. It is further complicated by the fact that the motion sensors are battery powered and wireless so they can't easily be "spoken to" and therefore we can't easily make/break links. This leads me to the next feature request...

 

Modify how the "Include battery powered devices when automatically writing changes to your devices" works. I know that the battery powered devices need to be put into linking mode before this feature is really useful, or you could try to trigger a motion so that the device wakes up and "listens" for commands, which is kinda tricky. The modified behavior would be that the ISY would wait until it gets a signal from a motion sensor and THEN start sending the new link updating information, after the battery powered device has awakened. This would basically be equivalent to what we try to do manually by triggering a motion event and quickly pressing the "OK" button on the "Write updates to device". It doesn't always work when I try to do it manually. It would be cool if the ISY could wait until it "knows" that the battery powered device is "awake" and then start sending the commands.

 

If you're still here reading this, thanks for listening. It took me a while to get this all to work and it's been fun getting here. I'd just love to get it perfect and that's why I'm asking for help and/or new features.

 

Cheers,

Todd

Link to comment

Hello Todd,

 

Sorry, I followed your post pretty well but am a bit confused. Is your MS linked to the responders and you are using the "Adjust Scene" action in your time based programs as well as using programs to turn the lights on to preset levels? Or are you just using programs triggered by your MS to trigger your lights to preset levels and the MS is not linked to anything but the ISY?

 

Thanks,

Tim

Link to comment

Tim,

 

I realize my post was a bit rambling on and on. :) To put it short and sweet...

 

Yes the MS is linked to the responders and I am using the "Adjust Scene" action to modify the on level based on schedules. What I'd really like to be able to do is to "Unlink" the responders during the day so they don't turn the lights on automagically. I'd also like to be able to override the motion response link at any time if the local dimmer buttons are pressed.

 

My first post was intended to show my train of thought and how I got where I am, which is almost there. :)

 

Cheers,

Todd

Link to comment

Hi Todd,

 

Thanks for clarifying. I had wanted the same thing at one point but it is not possible currently to. Michel I am sure could explain the reasons why.

 

You are probably aware but just in case, you can use the Adjust Scene in a program to set the responders to 0 Level so that when the motion trips the lights do not turn on. That is what I did/still do with some devices. At dusk the lights will turn on to 60% with motion, at dawn they turn on to 0% with motion

 

Tim

Link to comment
A 0% On Level turns the device(s) Off when motion is sensed. Does not allow the device(s) to be turned On manually and stay On as each motion turns them Off again.

 

If that is okay the suggestion to use 0% On is a great idea.

Lee, good point. I had forgotten that when the motion sent the Off it would turn the lights back off...but in my situation I wanted that anyway. But I thought the OP stated the motions send only ON commands so his timer programs will turn off the responders anyway.

Link to comment

Tim,

 

That's what I'm doing as well. Problem is that you might want the lights to turn on during the day when you press the local dimmer on button. That's works great until you move, then the scene sets the light to off because they are set to go to 0% on when motion is sensed.

 

I've tried to get around this with my state variable of 4 and 5 from the post above, but it doesn't work quite right. In state 4, (triggered by locally pressing the dimmer button to ON) I send an update to the motion response scene such that the on level of the scene matches the locally applied on level of the dimmer (70%). State 5 does the same except that it sets the motion response on level to 100% when the local dimmer button is turned FAST ON. By making the motion response level match the locally applied level, I have in effect, suppressed the motion response.

 

I'm so close to getting it to work the way I want, but my method of suppressing the response to the trigger isn't quite there. The thought is that if I'm in either state 4 or 5, I have the motion response scene match exactly what the local light switch would do anyways. Problem is that it's a bit buggy in the way it works. Being able to remove the dimmers from the scene as responders during the day would likely fix most of my problem.

Link to comment

Todd,

 

Ah yes, the more you explain the more it jars my memories of a couple of years ago going thru similar issues with the motion sensors. I tried similar avenues, variables weren’t available back then, with some success, but spotty.

 

I unfortunately don’t have any answers for you. Hopefully UDI can help you out. Sorry I couldn’t.

 

Tim

Link to comment

Tim,

 

You are right, I have the MS set to send only ON commands. Because of this, and the way I have worked around the problem of the link persisting, when I am in state 0 or -1, I have the scene set to 0% on level when the scene is turned ON by the MS. This effectively turns the lights OFF when an ON message is sent by the MS because ON = 0% in the scene. So say you are trying to read a label on a bottle in the hallway during the day and you want a bit more light, you turn the lights on manually. If you move, the lights turn back off because the MS activated the 0% ON scene.

 

Like I said, this almost works but the problem lies in the fact that my programs which try to override the 0% ON level by setting the MS scene responders to 70%/100% upon a button press are sometimes too slow to change the scene attributes before a motion is sensed and I end up with the lights going out right after I just turned them on manually at the dimmer switch.

 

I know it's convoluted, but that's how we have to work around Insteon's limitations. I realize it isn't really a limitation of the ISY, but adding the option to programmatically remove/add a device from/to a scene would overcome my problem.

Link to comment

Hi Todd,

 

Thanks so very much for the feedback.

 

First of all - and as you noted - the fact that the motion sensor has to be in programming mode (or listen mode) before we make any changes is quite daunting. As a matter of fact, we did try this a few times and the success rate was not that high. Furthermore, it seems that HouseLinc has the same type of issues with this approach. The best case is that we can program the motion sensor. The worst case is that we cannot and now your system is left in a zombie state till we retry again. And, then, we have to define number of retries before failing and finally the interval between retries. All and all, if the solution was as easy (or supportable) as changing the scene level (which you already do), then it would have already been implemented.

 

I am so very sorry to disappoint but I am afraid that this solution will cause more damage than good especially since:

1. It has to run a few times a day

2. It's RF

3. The RF device has to be in listen mode

 

 

With kind regards,

Michel

Link to comment

Thanks Michel, I was afraid you were going to say that. I had to try anyways.

 

Like I said, I almost have things working the way I want and I think I can deal with the self-induced "bug" I created for operation during the day. For nearly all of my other programs, I can deal with the processing delay of the ISY, it's just the hallway that makes it frustrating because I want immediate scene response.

 

Thanks to you and UDI for making this cool tool to use for my home automation!

 

Cheers,

Todd

Link to comment

The delay is 1-2 seconds when I just use programs to set the lights on (i.e. without links between the MS and dimmers). The hallway is 10 feet long so you can get most of the way down it before the light turns on when programs are used to turn the dimmer on (again, without links between the MS and dimmer).

 

If I use links between the MS (controller) and the dimmer (responder), there's hardly any delay at all when the MS registers motion. The delay I'm dealing with now is that when I locally turn on the dimmer, it takes a finite amount of time (again 1-2 seconds) for my program to set the new ON level which effectively suppresses the MS ON command for the scene. If an MS ON signal is sent before the new settings take hold, the dimmer abruptly goes to the "old" ON level. Make sense?

 

I want to use the control ON from the motion sensor to turn on two dimmer switches only under certain conditions. Right now, I just have one dimmer (sconce light) as a responder to the scene. I'd like to add a second dimmer when I get things ironed out. That of course would add more states to scenario if the second dimmer switch is turned on locally. I'll get the single dimmer working as best as possible before I go into the second dimmer as a responder.

 

Does that answer your questions?

 

Thanks again,

Todd

Link to comment

Hi Todd,

 

Kind of!

 

So, you have two dimmer switches and, currently (using programs), are you turning them on/off discreetly or are they in a scene and you just send a scene command? There are major performance implications if you use the former including at least 500 m.s. delay between each command.

 

Also, can you tell me:

1. What is your ISY's firmware version?

2. How many programs/devices do you have?

 

With kind regards,

Michel

Link to comment

Michel,

 

I am actually just running one dimmer right now in the scenario. I'd like to add a second, but that's for later.

 

The MS (controller) and the dimmer (responder) are in a scene, so they are linked and respond very quickly. I do not use a program to turn the scene on, the MS activates the scene when motion is sensed.

 

The slow part is when I try to adjust the dimmer on level in the scene when the dimmer button is pressed locally. This is how I suppress the linked scene response. Sometimes it takes too long to adjust the scene's on level using programs and in the interim, the motion sensor sends another ON command which changes the dimmer's light level to the "old" value.

 

I'm using 3.1.16 firmware

I have about 20 devices and 50 programs.

 

Thanks

Link to comment

Thanks Lee.

 

That's exactly why I'd like to be able to remove/add the device from the scene programmatically. If I could take it out of the scene, I wouldn't have the problems during the day when I'm trying to suppress the motion response scene by adjusting the on level of the scene.

Link to comment

Since that is not going to happen have you tried using a Program triggered by the Motion On to turn the responder on rather than a direct link. I use that in my Master Bath and find the Program response to be quite quick. Not as quick as a direct link for sure but not bad. Something in the .5 to 1 second range.

Link to comment

Lee,

 

As I mentioned in the above posts, I have tried using programs triggered by the Motion ON to turn on the responder. It works fast enough for all of my other applications, but not for the hallway. I can see why it works for your bathroom, like it does in my other rooms, because when you are going into the bathroom, you typically come in and stop. For my short hallway, you are already through it before the lights turn on when I use a program to turn on the dimmer.

Link to comment

Hello Toddimus,

 

Thank you. I really need to figure out which is the issue:

1. Slow when adjusting scene on level OR

2. Slow when you use programs to activate the hallway switch OR

3. Both

 

As LeeG mentioned, #2 should be pretty quick. I want to figure out if that's not the case in your situation and what might be contributing to it.

 

With kind regards,

Michel

Link to comment

Michel,

 

3. Both, but I understand that they both take time.

 

My previous estimates of 1-2 seconds may be longer than it actually takes but the point is that they're slower than I'd like them to be. It's the scene adjust delay that causes most of my "bugs". The bug occurs when I have manually pressed the hallway dimmer switch. Since it is a locally applied command, the hallway dimmer immediately goes to the preset FAST OFF, OFF, ON, or FAST ON level, which is what I want it to do. The appropriate program for state -1, 0, 4, or 5 is then activated which sends the scene adjust value to the scene and dimmer. If the hall motion sensor sends an "ON" command before the adjust scene commands are finished doing their business, I get into an unknown condition. The light sometimes turns off or to the previously set on level which is not what I want it to do.

 

I know it's too slow (from previous experiments) when I use programs (not links to the motion sensor) to activate the hallway switch. That's where I started in this whole journey in the first place. It's become esoteric now, but since I've gone this far, why not go the full monty. My whole hallway motion scheme is described below in the most explicit way I can think of.

 

I'll sign off here and let the code do the talking from here... :)

 

Cheers,

Todd

 

I created a scene that I call "Hall After Motion".

 

"Dimmer - Hallway" is the responder

"Motion - Hall - Sensor" is the controller.

 

When I highlight the "Hall After Motion" scene entry in the MAIN device/scene tree, I see "Dimmer - Hallway" show up in the main panel on the right. -- This is the scene that I'm adjusting in my programs below.

 

When I highlight the "Motion - Hall - Sensor" device under the "Hall After Motion" scene in the tree, I also see "Dimmer - Hallway" show up in the panel in the right. -- This is the second adjust scene value I'm adjusting in the programs below.

 

I then created a state variable called "s_Hall" to keep track of the current state the hallway lighting system.

 

The rest of the post contains all of the programs that run this whole scheme. They aren't perfected, but they do work pretty well, most of the time. I'm trying to minimize the bugs...

 

THESE ARE THE SCHEDULE BASED PROGRAMS WHICH ARE MY "AUTO MODE" VARIABLE VALUES OF 0, 1, 2:

 

Hall_Auto_Sched_1

If
       From    Sunset  +  2 hours  and 30 minutes
       To      Sunrise +  2 hours  (next day)

Then
       In Scene 'Motion Responses / Hall After Motion' Set 'Dimmer - Hallway' 30% (On Level)
       In Scene 'Motion - Hall - Sensor' Set 'Dimmer - Hallway' 30% (On Level)
       Set 'Dimmer - Hallway' Off
       $s_HALL  = 1

Else
  - No Actions - (To add one, press 'Action')

Hall_Auto_Sched_2_0

 If
       From    Sunset  - 45 minutes
       To      Sunrise +  2 hours  (next day)

Then
       In Scene 'Motion Responses / Hall After Motion' Set 'Dimmer - Hallway' 50% (On Level)
       In Scene 'Motion - Hall - Sensor' Set 'Dimmer - Hallway' 50% (On Level)
       Set 'Dimmer - Hallway' Off
       $s_HALL  = 2

Else
       In Scene 'Motion Responses / Hall After Motion' Set 'Dimmer - Hallway' 0% (On Level)
       In Scene 'Motion - Hall - Sensor' Set 'Dimmer - Hallway' 0% (On Level)
       Set 'Dimmer - Hallway' Off
       $s_HALL  = 0

 

THIS IS THE TRIGGER THAT STARTS TIMERS WHEN IN "AUTO MODE":

 

Hall_Motion_TRIGGER

 If
       Control 'Motion - Hall - Sensor' is switched On
   And (
            $s_HALL is 1
         Or $s_HALL is 2
         Or $s_HALL is 3
       )
   And $s_HALL is not 0
   And $s_HALL is not 4
   And $s_HALL is not 5
   And $s_HALL is not -1

Then
       Wait  2 seconds
       Run Program 'Timer for Hallway_Short' (Then Path)

Else
  - No Actions - (To add one, press 'Action')

 

THESE TRIGGER THE STATES THAT SUPPRESS OR DISABLE THE SCENE LINK BEHAVIOR BY MATCHING SCENE ON LEVEL TO THE DESIRED LEVEL:

Hall_SW_FAST_OFF_neg1

 If
       Control 'Dimmer - Hallway' is switched Fast Off

Then
       In Scene 'Motion Responses / Hall After Motion' Set 'Dimmer - Hallway' 0% (On Level)
       In Scene 'Motion - Hall - Sensor' Set 'Dimmer - Hallway' 0% (On Level)
       $s_HALL  = -1
       Run Program 'Timer for Hallway_Long' (Else Path)
       Run Program 'Timer for Hallway_Short' (Else Path)

Else
  - No Actions - (To add one, press 'Action')

Hall_SW_FAST_ON_5

 If
       Control 'Dimmer - Hallway' is switched Fast On

Then
       In Scene 'Motion Responses / Hall After Motion' Set 'Dimmer - Hallway' 100% (On Level)
       In Scene 'Motion - Hall - Sensor' Set 'Dimmer - Hallway' 100% (On Level)
       $s_HALL  = 5
       Run Program 'Timer for Hallway_Long' (Else Path)
       Run Program 'Timer for Hallway_Short' (Else Path)

Else
  - No Actions - (To add one, press 'Action')

Hall_SW_OFF_0

 If
       Control 'Dimmer - Hallway' is switched Off

Then
       In Scene 'Motion Responses / Hall After Motion' Set 'Dimmer - Hallway' 0% (On Level)
       In Scene 'Motion - Hall - Sensor' Set 'Dimmer - Hallway' 0% (On Level)
       $s_HALL  = 0
       Run Program 'Timer for Hallway_Long' (Else Path)
       Run Program 'Timer for Hallway_Short' (Else Path)
       Wait  30 seconds
       Run Program 'Hall_Auto_Sched_2_0' (If)
       Run Program 'Hall_Auto_Sched_1' (If)

Else
  - No Actions - (To add one, press 'Action')

Hall_SW_ON_4

 

 If
       Control 'Dimmer - Hallway' is switched On

Then
       In Scene 'Motion Responses / Hall After Motion' Set 'Dimmer - Hallway' 50% (On Level)
       In Scene 'Motion - Hall - Sensor' Set 'Dimmer - Hallway' 50% (On Level)
       $s_HALL  = 4
       Run Program 'Timer for Hallway_Long' (Then Path)
       Run Program 'Timer for Hallway_Short' (Else Path)

Else
  - No Actions - (To add one, press 'Action')

 

AND FINALLY, THE TIMERS THAT TURN OFF THE LIGHTS AFTER A TIME:

 

Timer for Hallway_Long

 If
  - No Conditions - (To add one, press 'Schedule' or 'Condition')

Then
       Run Program 'Timer for Hallway_Short' (Else Path)
       Wait  2 minutes 
       Set Scene 'Motion Responses / Hall Fade' Off
       Run Program 'Timer for Hallway_Long' (Else Path)
       Run Program 'Hall_Auto_Sched_2_0' (If)
       Run Program 'Hall_Auto_Sched_1' (If)

Else
  - No Actions - (To add one, press 'Action')

Timer for Hallway_Short

 If
  - No Conditions - (To add one, press 'Schedule' or 'Condition')

Then
       Run Program 'Timer for Hallway_Long' (Else Path)
       Wait  20 seconds
       Set Scene 'Motion Responses / Hall Fade' Off
       Run Program 'Timer for Hallway_Short' (Else Path)

Else
  - No Actions - (To add one, press 'Action')

 

If you were really paying attention, you might wonder where the state for 3 comes from. I'm holding that for another TBD auto mode that might be used for security or a later time at night, etc. There shouldn't be a way for the s_Hall variable to get to 3 yet, but even if it did, it would be reset at the next scheduled auto mode update.

 

If you made it this far, thanks for hearing me out!

Link to comment

Hi Todd,

 

Thanks so very much!

 

My only question is why do you have the following:

 In Scene 'Motion Responses / Hall After Motion' Set 'Dimmer - Hallway' 30% (On Level) 

 

If your intended goal is to have a different on level/ramp rate when the motion sensor is tripped, then all you need is:

In Scene 'Motion - Hall - Sensor' Set 'Dimmer - Hallway' 30% (On Level)

 

The only reason you would want to use the first one is if this scene is activated by an ISY client such as Admin Console or a mobile app. And, even so, you can always do this after everything is already programmed for the motion sensor (doesn't have to be done before).

 

I know this is not going to make it much faster but it removes at least one set of commands.

 

With kind regards,

Michel

Link to comment

Thanks Michel,

 

I had the extra adjust scene part in there as a "belt and suspenders" kind of entry. I had wondered whether I really needed it or not. It wasn't clear which one I needed so I used both. I'll take it out and I'm sure it will help a bit.

 

Hopefully all of this will help somebody else. I think we have gone over all of the pitfalls in my method and their consequences. It is noticeably faster to use a scene to react to motion and that's just what some folks may want.

 

Thanks to all who have contributed!

Link to comment

Archived

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


×
×
  • Create New...