Ankündigung

Einklappen
Keine Ankündigung bisher.

Retriggering a timer

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Retriggering a timer

    Hello,

    I have a KNX motion detector inside our house near the front door. I use this to send a GA ("Movement entree-13/0/0") when somebody goes out of the house.
    This GA is then used to block the alarm from our outside motion detector (GA "bewegingdam-13/3/0") temporarily. I want this because when I am leaving the house myself, I don't want the outside motion detector to generate an alarm. This outside motion detector is a normal detector, but its alarm contact is connected to a binary KNX actuator. This binary switch can be blocked when I send it GA ("blokkeer damdetectie met 1-13/3/2"). I also use the blocking for when the outside motion detector activates for the first time. This is to avoid a large number of alarm signals being raised if somebody moves in front of the outside motion detector for a longer time. After the first trigger, I want to block other signals for 2 minutes.
    When somebody leaves the house, before he/she opens the door, they pass the internal motion detector and I want this to also cause a 2 minute blocking of the outside motion detector.
    Often, people pick up their coat near the door and then go back into the house (to get car keys, say goodbye to people in the house, etc.) and stay there for around 2 minutes before finally leaving the house. This means that the delay that I have programmed in is not enough.
    I would like to make the program 're-trigger' the 2 minute blocking time each time the front door motion detector is triggered.

    In the EIBPC manual I read about the delay function, which reportedly allows re-triggering of the timer.
    I have the following code, but it somehow does not work:

    Code:
    if (event("bewegingdam-13/3/0") and entreeblockbybm == OFF) then \\
    write ("blokkeer damdetectie met 1-13/3/2",ON); \\
    entreeblockbybm=ON \\
    endif
    
    if event("Movement entree-13/0/0") then \\
    write ("blokkeer damdetectie met 1-13/3/2",ON); \\
    entreeblockbybm=ON \\
    endif
    
    if delay( "blokkeer damdetectie met 1-13/3/2"==ON, 120000u64) then \\
    write ("blokkeer damdetectie met 1-13/3/2",OFF);    \\
    entreeblockbybm=OFF \\
    endif
    The first part of the code means that, if there is activation of the outside motion detector and there is no blocking activated, the blocking GA should be sent and result in blocking for 2 minutes (in the third part of the code). The variable entreeblockbybm is switched to 'ON'.
    The second part means that, if the internal motion detector in the house is triggered, the blocking GA should be sent and the variable entreeblockbybm is switched to 'ON'.
    The third part would de-activate the blockign after 2 minutes and set the variable 'entreeblockbybm' back to OFF.

    I thought this should work, but the re-triggering of the timer does not work. The blocking of the outside detector is always cancelled after 2 minutes, even if I move in front of the internal motion detector within 2 minutes.

    I hope somebody can tell me what is wrong with the above code.

    Thanks in advance,
    Regards,
    Perry
    Zuletzt geändert von Perry; 14.05.2015, 22:29.

    #2
    if your GA "blokkeer damdetectie met 1-13/3/2" does not change but is the always ON, the delay will not restart. To do so, your code should be:
    Code:
    if delay( "blokkeer damdetectie met 1-13/3/2" and event("blokkeer damdetectie met 1-13/3/2"), 120000u64) then \\
    write ("blokkeer damdetectie met 1-13/3/2",OFF); \\
    entreeblockbybm=OFF \\
    endif
    offizielles Supportforum für den Enertex® EibPC: https://knx-user-forum.de/eibpc/
    Enertex Produkte kaufen

    Kommentar


      #3
      Thank you very much, it works now.

      If I understand correctly: if a GA, that is used as a delay trigger, is sent multiple times with the "ON value", it will not re-trigger the delay, because there is not a change in the value of the GA. That is why the 'event-GA' must be added. Now, each time the GA is sent, it is checked and, if the value is "ON", it will be used to re-trigger the delay.
      Only after the delay is finally executed, the GA OFF command is sent.

      Kommentar


        #4
        You are absolutely right.
        offizielles Supportforum für den Enertex® EibPC: https://knx-user-forum.de/eibpc/
        Enertex Produkte kaufen

        Kommentar

        Lädt...
        X