more G-Labs products

Author Topic: Detecting movement with motion sensor  (Read 1780 times)

November 26, 2014, 11:11:55 PM
Read 1780 times

Bobpick

  • *
  • Information
  • Newbie
  • Posts: 22
My motion sensors are firing several times when someone walks by, leading to some excessive email notifications.

Is there a way in the trigger code to tell it to only trigger once in a minute?

November 27, 2014, 09:09:37 PM
Reply #1

nolio

  • *****
  • Information
  • Global Moderator
  • Posts: 544
Hi,
For me, there is different way :
  • Do a
Code: [Select]
Pause(60)
    in the trigger[/li]
  • Change the parameter of your device to report only every minute
  • Do a time comparison in the program code (you can take a look at the smartlight code in light scene

I think the last one is the better way ...
Bye

November 27, 2014, 11:28:36 PM
Reply #2

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
In the Advanced Smart Lights code, I check for a variable time delay before firing events.  I highly recommend this approach.  It might be easier for you to add a pause(60), but it's not going to let your code run anything else in the mean time (if that matters).

November 28, 2014, 01:18:05 AM
Reply #3

Bobpick

  • *
  • Information
  • Newbie
  • Posts: 22
Even a 15 second pause would work.

November 28, 2014, 10:08:00 PM
Reply #4

RoChess

  • ***
  • Information
  • Full Member
  • Posts: 61
Even easier might be to adjust the motion sensor itself. Z-Wave motion sensors for example are configurable how long the duration of the toggled status is. This is normally designed to allow batteries to last longer, but in this way you can make that work for you by using a time span that you only want to result in a single status update.

December 01, 2014, 05:41:51 PM
Reply #5

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Depends on the motion sensor if that's possible.  X10 MS series (e.g., MS16A) will send an ON command every time motion is seen which could be on the order of ~5 seconds.  It keeps sending the ON command ever time and there is no way to control this.  You can tell it how long to wait to send the OFF command, which is only sent once.