Hallo zuammen!
Brauche mal wieder Eure Hilfe. Bin schon länger dran mein Garagentorstatus auf einem Taster abzubilden und komme nicht weiter. Habe einen Taster auf dem ich mehrere farbige LED als Staus LED verwenden kann und möchte dort folgendes abbilden:
Tor fährt auf – LED grün blinkend
Tor fährt ab – LED rot blinkend
Tor oben – LED grün konstant
Tor unten – alle LED AUS
Tor in einer Mittelstellung – LED gelb konstant
Dazu habe ich mir folgenden Code im Anhang überlegt. Problem – irgendwie funktioniert nichts wirklich. Eigentlich leuchtet nur die LED grün, wenn das Tor oben ist. Was mir beim Debug aufgefallen ist: Von meinen drei Status Flag Variablen Tor_fahrt, Tor_fahrt_AUF und Tor_fahrt_AB geht die Tor_fahrt Variable nie auf "EIN"?!?!
Als Anmerkung: Dir Torsteuerung läuft, es geht hier nur um die „Visualisierung“. Das Tor wird mit einer Taste auf- und mit einer zweiten Taste runter-gefahren. Jeweils ein Schaltaktorausgang mit Treppenhausimpuls für eine Sekunde. Wird dann ein zweites Mal ein EIN-Impuls gesendet stopt das Tor. Egal ob vom „Taster-AUF“ oder „Taster-AB“. Es gibt noch eine GA "Garagentor Ausgang fährt-4/0/7" welche, wenn das Tor fährt im Sekunden Rhythmus zwischen EIN und AUS wechselt. Diesen Impuls will/wollte ich für das Blinken beim hochfahren (grün) bzw. beim runterfahren (rot) verwenden.
[highlight=epc]
// [Garagentor-Status]
if systemstart() then { \\
read ("Garagentor Ausgang unten-4/0/6"); \\
if ("Garagentor Ausgang unten-4/0/6") then { \\
write ("Garagentor LED grün-4/0/26",AUS); \\
write ("Garagentor LED rot-4/0/27",AUS); \\
write ("Garagentor LED gelb-4/0/28",AUS); \\
} endif; \\
read ("Garagentor Ausgang oben-4/0/5"); \\
if ("Garagentor Ausgang oben-4/0/5") then write ("Garagentor LED grün-4/0/26",EIN) endif; \\
} endif
Tor_fahrt_AUF=AUS
Tor_fahrt_AB=AUS
Tor_fahrt=AUS
if event ("Garagentor hoch-4/0/1") and ("Garagentor hoch-4/0/1") and Tor_fahrt then {
Tor_fahrt_AUF=AUS;
Tor_fahrt_AB=AUS;
Tor_fahrt=AUS;
} endif
if event ("Garagentor ab-4/0/2") and ("Garagentor ab-4/0/2") and Tor_fahrt then {
Tor_fahrt_AUF=AUS;
Tor_fahrt_AB=AUS;
Tor_fahrt=AUS;
} endif
if event ("Garagentor hoch-4/0/1") and ("Garagentor hoch-4/0/1") and !Tor_fahrt then {
Tor_fahrt=EIN;
Tor_fahrt_AUF=EIN;
} endif
if event ("Garagentor ab-4/0/2") and ("Garagentor ab-4/0/2") and !Tor_fahrt then {
Tor_fahrt=EIN;
Tor_fahrt_AB=EIN;
} endif
// Tor fährt AUF - Status LED grün/blinkend
if Tor_fahrt and Tor_fahrt_AUF and ("Garagentor Ausgang fährt-4/0/7") then write ("Garagentor LED grün-4/0/26",EIN) endif
if Tor_fahrt and Tor_fahrt_AUF and !("Garagentor Ausgang fährt-4/0/7") then write ("Garagentor LED grün-4/0/26",AUS) endif
// Tor fährt AB - Status LED rot/blinkend
if Tor_fahrt and Tor_fahrt_AB and ("Garagentor Ausgang fährt-4/0/7") then write ("Garagentor LED rot-4/0/27",EIN) endif
if Tor_fahrt and Tor_fahrt_AB and !("Garagentor Ausgang fährt-4/0/7") then write ("Garagentor LED rot-4/0/27",AUS) endif
// Tor OBEN - Status LED grün
if ("Garagentor Ausgang oben-4/0/5") then {
Tor_fahrt_AUF=AUS;
Tor_fahrt_AB=AUS;
Tor_fahrt=AUS;
write ("Garagentor LED grün-4/0/26",EIN);
} endif
// Tor UNTEN - Status LED alle AUS
if ("Garagentor Ausgang unten-4/0/6") then {
Tor_fahrt_AUF=AUS;
Tor_fahrt_AB=AUS;
Tor_fahrt=AUS;
write ("Garagentor LED grün-4/0/26",AUS);
write ("Garagentor LED rot-4/0/27",AUS);
write ("Garagentor LED gelb-4/0/28",AUS);
} endif
// Tor HALB - Status LED gelb
if !Tor_fahrt and !Tor_fahrt_AUF and !Tor_fahrt_AB and !("Garagentor Ausgang oben-4/0/5") and !("Garagentor Ausgang unten-4/0/6") then write ("Garagentor LED gelb-4/0/28",EIN) endif
// [Garagentor-Status] end
[/highlight]
Danke schonmal und viele Grüsse
Jochen
Brauche mal wieder Eure Hilfe. Bin schon länger dran mein Garagentorstatus auf einem Taster abzubilden und komme nicht weiter. Habe einen Taster auf dem ich mehrere farbige LED als Staus LED verwenden kann und möchte dort folgendes abbilden:
Tor fährt auf – LED grün blinkend
Tor fährt ab – LED rot blinkend
Tor oben – LED grün konstant
Tor unten – alle LED AUS
Tor in einer Mittelstellung – LED gelb konstant
Dazu habe ich mir folgenden Code im Anhang überlegt. Problem – irgendwie funktioniert nichts wirklich. Eigentlich leuchtet nur die LED grün, wenn das Tor oben ist. Was mir beim Debug aufgefallen ist: Von meinen drei Status Flag Variablen Tor_fahrt, Tor_fahrt_AUF und Tor_fahrt_AB geht die Tor_fahrt Variable nie auf "EIN"?!?!
Als Anmerkung: Dir Torsteuerung läuft, es geht hier nur um die „Visualisierung“. Das Tor wird mit einer Taste auf- und mit einer zweiten Taste runter-gefahren. Jeweils ein Schaltaktorausgang mit Treppenhausimpuls für eine Sekunde. Wird dann ein zweites Mal ein EIN-Impuls gesendet stopt das Tor. Egal ob vom „Taster-AUF“ oder „Taster-AB“. Es gibt noch eine GA "Garagentor Ausgang fährt-4/0/7" welche, wenn das Tor fährt im Sekunden Rhythmus zwischen EIN und AUS wechselt. Diesen Impuls will/wollte ich für das Blinken beim hochfahren (grün) bzw. beim runterfahren (rot) verwenden.
[highlight=epc]
// [Garagentor-Status]
if systemstart() then { \\
read ("Garagentor Ausgang unten-4/0/6"); \\
if ("Garagentor Ausgang unten-4/0/6") then { \\
write ("Garagentor LED grün-4/0/26",AUS); \\
write ("Garagentor LED rot-4/0/27",AUS); \\
write ("Garagentor LED gelb-4/0/28",AUS); \\
} endif; \\
read ("Garagentor Ausgang oben-4/0/5"); \\
if ("Garagentor Ausgang oben-4/0/5") then write ("Garagentor LED grün-4/0/26",EIN) endif; \\
} endif
Tor_fahrt_AUF=AUS
Tor_fahrt_AB=AUS
Tor_fahrt=AUS
if event ("Garagentor hoch-4/0/1") and ("Garagentor hoch-4/0/1") and Tor_fahrt then {
Tor_fahrt_AUF=AUS;
Tor_fahrt_AB=AUS;
Tor_fahrt=AUS;
} endif
if event ("Garagentor ab-4/0/2") and ("Garagentor ab-4/0/2") and Tor_fahrt then {
Tor_fahrt_AUF=AUS;
Tor_fahrt_AB=AUS;
Tor_fahrt=AUS;
} endif
if event ("Garagentor hoch-4/0/1") and ("Garagentor hoch-4/0/1") and !Tor_fahrt then {
Tor_fahrt=EIN;
Tor_fahrt_AUF=EIN;
} endif
if event ("Garagentor ab-4/0/2") and ("Garagentor ab-4/0/2") and !Tor_fahrt then {
Tor_fahrt=EIN;
Tor_fahrt_AB=EIN;
} endif
// Tor fährt AUF - Status LED grün/blinkend
if Tor_fahrt and Tor_fahrt_AUF and ("Garagentor Ausgang fährt-4/0/7") then write ("Garagentor LED grün-4/0/26",EIN) endif
if Tor_fahrt and Tor_fahrt_AUF and !("Garagentor Ausgang fährt-4/0/7") then write ("Garagentor LED grün-4/0/26",AUS) endif
// Tor fährt AB - Status LED rot/blinkend
if Tor_fahrt and Tor_fahrt_AB and ("Garagentor Ausgang fährt-4/0/7") then write ("Garagentor LED rot-4/0/27",EIN) endif
if Tor_fahrt and Tor_fahrt_AB and !("Garagentor Ausgang fährt-4/0/7") then write ("Garagentor LED rot-4/0/27",AUS) endif
// Tor OBEN - Status LED grün
if ("Garagentor Ausgang oben-4/0/5") then {
Tor_fahrt_AUF=AUS;
Tor_fahrt_AB=AUS;
Tor_fahrt=AUS;
write ("Garagentor LED grün-4/0/26",EIN);
} endif
// Tor UNTEN - Status LED alle AUS
if ("Garagentor Ausgang unten-4/0/6") then {
Tor_fahrt_AUF=AUS;
Tor_fahrt_AB=AUS;
Tor_fahrt=AUS;
write ("Garagentor LED grün-4/0/26",AUS);
write ("Garagentor LED rot-4/0/27",AUS);
write ("Garagentor LED gelb-4/0/28",AUS);
} endif
// Tor HALB - Status LED gelb
if !Tor_fahrt and !Tor_fahrt_AUF and !Tor_fahrt_AB and !("Garagentor Ausgang oben-4/0/5") and !("Garagentor Ausgang unten-4/0/6") then write ("Garagentor LED gelb-4/0/28",EIN) endif
// [Garagentor-Status] end
[/highlight]
Danke schonmal und viele Grüsse
Jochen
Kommentar