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

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Hello,

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?

Thanks.

Jean

freymann

  • Douchebag
  • Guru
  • *
  • Posts: 380
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #1 on: November 05, 2008, 02:09:29 pm »
I was thinking of getting a couple of these:

 X10 EagleEye Motion Sensor (MS14A)

http://cgi.ebay.ca/MS14A-l-X10-Automation-Compact-EagleEye-Motion-Sensor_W0QQitemZ140271764882QQihZ004QQcategoryZ50585QQtcZphotoQQcmdZViewItem

 These units seem to take care of the on and off commands on their own without the need of programming anything in LMCE.

 I have a X10 2-Way Transceiver Module (RR501) that I believe will pass on the commands to the house.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #2 on: November 05, 2008, 03:43:36 pm »
Please keep in mind, that X-10 devices are not bi-directional, so LinuxMCE does not know anything of whether the device is on or off.

Guys, if you can, please go Z-Wave, you'll be a lot better off.

-Thom

freymann

  • Douchebag
  • Guru
  • *
  • Posts: 380
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #3 on: November 05, 2008, 03:54:52 pm »
Please keep in mind, that X-10 devices are not bi-directional, so LinuxMCE does not know anything of whether the device is on or off.

Guys, if you can, please go Z-Wave, you'll be a lot better off.

 Yes, that is true.

 Unfortunately, the price of Z-Wave makes playing with X10 more affordable. I think I have under $100 invested in my X10 equipment and it's doing a decent job, at least for now.

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #4 on: November 05, 2008, 05:13:10 pm »
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?

Jean

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #5 on: November 07, 2008, 05:40:37 pm »
No ideas anyone on how to turn on a light for a fixed amount of time?

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #6 on: November 07, 2008, 07:26:19 pm »
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.

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #7 on: November 09, 2008, 07:08:07 am »
Jon,

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...

Jean

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #8 on: November 09, 2008, 01:40:25 pm »
A couple points to mention:

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.

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #9 on: November 10, 2008, 07:03:02 am »
Jon,

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.

Jean

asplodzor

  • Regular Poster
  • **
  • Posts: 17
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #10 on: November 10, 2008, 07:49:13 am »
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.

superfro

  • Regular Poster
  • **
  • Posts: 24
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #11 on: November 10, 2008, 05:34:48 pm »
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).

Much appreciated.

 

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #12 on: November 10, 2008, 06:32:09 pm »
i now know all needed pieces for the HSM readout, but to add the needed bits in a clean way I need to rework the code a bit and add special device templates.

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #13 on: November 10, 2008, 07:06:43 pm »
Jeangot:

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.

thanks

Jon
« Last Edit: November 10, 2008, 07:11:17 pm by jondecker76 »

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: How to have a motion detector turn on a light for a few minutes, then off
« Reply #14 on: November 11, 2008, 12:29:00 am »
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.