Ankündigung

Einklappen
Keine Ankündigung bisher.

Problems with after

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

    Problems with after

    Hello and sorry for writing in English. I am having problems with the after function. In this example, I want the light to turn on when I press on, and to turn off: during the day, immediately, but at night after 10 seconds. I wrote this
    Code:
    if (event("Luz Techo Hab Ppal Int-1/2/0") and ("Luz Techo Hab Ppal Int-1/2/0"==ON)) then \\
        write("Luz_Techo_HPrinc-1/2/13",ON) \\
    endif
    
    if (event("Luz Techo Hab Ppal Int-1/2/0") and (sun()==1b01) and ("Luz Techo Hab Ppal Int-1/2/0"==OFF)) then \\
        write ("Luz_Techo_HPrinc-1/2/13",OFF) \\
    endif
    
    if (event("Luz Techo Hab Ppal Int-1/2/0") and (sun()==0b01) and (after("Luz Techo Hab Ppal Int-1/2/0"==OFF,10000u64))) then \\
        write ("Luz_Techo_HPrinc-1/2/13",OFF) \\
    endif
    However, at night the light never turns off. Any idea what is wrong?

    Thank you,

    Daniel

    #2
    after and event will only generate an ON-impulse for one cycle, so they will never be ON synchronously.
    Just change your code to
    [highlight=epc]
    if sun()==0b01 and after(event("Luz Techo Hab Ppal Int-1/2/0") and "Luz Techo Hab Ppal Int-1/2/0"==OFF,10000u64) then \\
    write ("Luz_Techo_HPrinc-1/2/13",OFF) \\
    endif
    [/highlight]
    offizielles Supportforum für den Enertex® EibPC: https://knx-user-forum.de/eibpc/
    Enertex Produkte kaufen

    Kommentar


      #3
      Danke schön!

      Kommentar

      Lädt...
      X