Author
Topic: How to have a motion detector turn on a light for a few minutes, then off (Read 7478 times)

I'm trying to do something fairly simple, which is to use my X10 motion detectors outside to turn on a light nearby for a few minutes each time there is movement, then turn the light off. I wasn't able to find out specific hints about this in the wiki or forums, which probably only means that I didn't search properly :-)

I have my motion detector configured according to very handy infos from the wiki, and it's properly firing movement alarms. Next I created an event to turn on my light each time there is movement at this particular detector, which works fine as well.

The problem now is: how do I turn the light off? I did set the movement alarm's duration via the web admin to a few seconds (for test), but nothing happens after the alarm is over. I created an event to turn the light off on "security breach reset" but that doesnt work either (and even if it did, that's probably the wrong way since I want to have several of these motion detectors all around the house and don't an alarm reset to turn off all the lights in the house).

So can anyone hint at the proper way to either turn on a light for a set amount of time, or turn off the light a certain time after the movement event?

The motion detectors I use can also turn the lights on and off after a delay (which is what I was doing successfully until now), however the idea is to have LMCE handle this so that LMCE is aware of movement and I can make the lights conditional upon house mode an various other things.I do know that X10 has its limits, but this should nevertheless be a very easy exercice for LME. any ideas anyone?

I'll give this a try when I get a few moments free (i'm at work right now, and have almost been living here for a while now), but if I remember correctly, the motion detector device template is a security interface type only, and therefore it won't work for the purpose you want it to.

The good news that you can make a new device template that uses either Lighting or Specialized interfaces - this will ensure that lighting_plugin receives the event from the motion detector, after which you can deal with it as you want.

Aside from that, once you capture the event, just send an On command to the light you want to, followed by a DCERouter delay command, followed by an Off command to the same light.

thanks for jumping in. I am actually getting the light to turn on, no problem, using the Motion Detector template and "Respond to Events" for Motion. My only problem was to turn it back off after a delay. With the DCE Delay command that you recommend followed by "off" it should do it. Will try it out tomorrow. Thanks a lot! Little by little, my system is getting to where it needs to be...

The DCERouter Delay command - the time command parameter is in minutes

Regarding the motion detected event - I thought that I had tried this in the past, and it would only work in certain security modes, but it has been so long that I honestly don't remember.. If you could, once you do your setup - can you test it out while in all different house security modes (Secure, Away, Entertaining, etc)...? For some reason I think the last time I tried this, it would not work in certain modes.. Then again, I may have been trying to respond to a security event... Either way, good luck - I look forward to seeing how this works out for you.

it seems to work fine for me. You;re right that by default the motion sensors won't fire events in all house modes. To change this, I went in the web admin under Security / Active Sensors and there you can decide for each motion sensor, in which house modes you want it to fire events. This is very handy, for example if you have outside sensors that you want to turn on lights all the time (like me) but also inside sensors that should only fire events when you're not home.

If you ever try this again and it doesn't work let me know, I'll be glad to try and help.

In an ideal world, not only should a motion sensor turn on a light and turn it back off again after a set amount of time, it should queue it's status so that if it keeps getting tripped, it will reset the off timer. I have been hoping to set this exact type of scenario up, but for a long hallway inside with a motion sensor at either end (it's so long, I might use three...) If I were to use the X10 Eagle Eye, I would only have to set them all to the same code and linuxmce would think that they are one unit.

This brings up a side matter... has anyone gotten linuxmce to respond to X10 signals yet? I've only even been able to transmit them.

You guys mind adding this one to the wiki with better instructions / screenshots ?(custom device template, respond to events.... DCERouter Delay command...)

Once hari is finished helping me add support for these HSM100's (z-wave) sensors I'll be trying to do the same thing, and I'm sure others find this info useful as well.... Motion, turn light on, turn light off after a x minute delay.... maybe even advanced config /caveat's with house security modes, or time of day (or luminosity since the hsm100's report light level when support has been added).

I just gave this a try again with the same results as before.. We must be doing something differently. Since you have gotten this working as expected, lets see if I can reproduce it..

1) In Respond to Events, are you responding to the "Movement is Detected" event or the "Sensor is Tripped" event?2) In Security->Active Sensors, are you selecting "Movement" or "Announcement" from the drop-downs?

If you could, please post your steps including the type of details listed above. It would be excellent for a wiki entry.

I had a couple of hours to mess around today before coming to work for the night... I tried Announcement mode out today(under Security->Active Sensors). When anything would trip one of my X10 Eagle Eye motion detectors, a text popup would appear on the orbiters saying that movement was detected on the stairway.. Pretty cool.

I'm off for a week starting tomorrow, so I'm going to be messing with this over the week. I also want to see what it takes to receive x10 commands. One could use a wireless X10 remote for example then to pause or play a movie, or anything else you could come up with.