Announcement

Collapse
No announcement yet.

motion sensor on secu16

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    motion sensor on secu16

    I have a motion sensor conected to the secu 16
    When motion is detected the input goes off for a short while(99).
    It triggers a timer(104) and a variable(105) and switches the kitchen light on.
    When new movement is detected within 300 sec, the timer is reset to 1(107)
    When more than 300 sec are gone without movement, the light turns off(111)
    But sometimes the light will go on without any reason after about 4 or 5 sec.
    I don't know what I am doing wrong.
    I made an extra safety with (115), that will switch the light off a second time after 30 seconds.
    Sometimes the light goes just off,
    sometimes the light goes off , on and off again.
    sometimes the light goes off on off on off.
    And when you activate the sensor the light stays off, but the timer is counting.
    Can anybody help me?
    thanks,
    Peter
    *********************************************
    0099 - IF Module #6 -SECU16 _4 Secu16 Unit 6 Input 4 keuken Turns OFF // movement kitchen
    0100 - AND Ocelot keuken timer V10 is = 0 // first time
    0101 - AND Ocelot dag/nacht-0-1-2-3 V05 is > 0 //
    0102 - THEN Transmit X10, K - 5 //
    0103 - THEN Transmit X10, K - ON (19) //
    0104 - THEN Timer-#10-keuken = 1 //
    0105 - THEN Ocelot keuken timer V10 = 1 // light on
    0106 - //
    0107 - IF Module #6 -SECU16 _4 Secu16 Unit 6 Input 4 keuken Turns OFF // stay on with motion
    0108 - AND Ocelot keuken timer V10 is NOT = 0 //
    0109 - THEN Timer-#10-keuken = 1 //
    0110 - //
    0111 - IF Timer-#10-keuken is > 300 // after 5 min. off
    0112 - THEN Transmit X10, K - 5 //
    0113 - THEN Transmit X10, K - OFF (20) //
    0114 - THEN Ocelot keuken timer V10 = 0 // can go on again
    0115 - IF Timer-#10-keuken is > 330 // after 30 sec again off
    0116 - THEN Transmit X10, K - 5 //
    0117 - THEN Transmit X10, K - OFF (20) //
    0118 - THEN Timer-#10-keuken = 0 //
    0119 - THEN Ocelot keuken timer V10 = 0 //
    0120 - //
    0121 - IF Timer-#10-keuken is > 3 //
    0122 - THEN Load Data to: Ocelot keuken timer V10 //
    0123 - //
    0124 - End Program // ********************************************************
    Peter

    http://ohh.pcgsm.nl

    #2
    Peter,
    For help with Cmax programs I would suggest also posting on Appdig's support board- Appdig Support. The folks there can definitly help sort out the programming.

    Anyway, I can see two places where you're likely having problems. One is at line 111. For this condition you should be using "becomes >" rather than "is >". The reason is that since the timer is still running, the condition will be true and the code section will execute on every pass through the program after 300 seconds until the timer is reset at 330 sec. This will quickly overwhelm the x10 transmit queue and may make the ocelot appear to "lockup" for a period of time. It also may have unpredictable results since once the queue fills up the existing entries get overwritten by the new entries. The "becomes >" will execute on the one pass where the condition becomes true.

    The second spot I see is the use of the varaible v10. It looks like you're using this to track whether you've turned the light on or not. At 114, after 300 seconds, you reset it to 0, which would enable the light to turn on again but on lines 121 and 122, you set v10 equal to the timer value, which, if effect, disables turning the light on (but would let the timer be reset). If you're using this to see the timer value in HS then you need to use another variable. Otherwise, I don't see that lines 121 and 122 are doing anything for you.

    Try these changes and see if it helps any.
    jim

    Comment

    Working...
    X