- ioBroker Community Home
- Deutsch
- Skripten / Logik
- Blockly
- Codetastatur Funktion - wie?
Codetastatur Funktion - wie?
-
Hallo,
Ich komme einfach nicht auf eine schlaue Lösung.
Ich habe einen 8-fach Taster welcher pro Taste ein Objekt im ioBroker darstellt.
Ich möchte nun einen 4-stelligen Code damit simulieren.Bsp.:
Taster hat die Objekte 1 - 8
Eine Funktion soll nach Eingabe von 2425 getriggert werden.Hat jemand eine Idee ?
-
Hallo,
Ich komme einfach nicht auf eine schlaue Lösung.
Ich habe einen 8-fach Taster welcher pro Taste ein Objekt im ioBroker darstellt.
Ich möchte nun einen 4-stelligen Code damit simulieren.Bsp.:
Taster hat die Objekte 1 - 8
Eine Funktion soll nach Eingabe von 2425 getriggert werden.Hat jemand eine Idee ?
Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs -
@paul53 Danke für deinen Vorschlag.
Das sieht wirklich gut aus.Ich dachte allerdings, dass man pro Blockly Script nur einen Trigger verwenden darf.
Ist dem nicht so ?@marlan99 sagte in Codetastatur Funktion - wie?:
Ich dachte allerdings, dass man pro Blockly Script nur einen Trigger verwenden darf.
nein, das ist nicht so!
man darf nur nich innerhalb eines Triggerbausteins einen weiteren Triggerbaustein setzen
kein Support per PN! - Fragen im Forum stellen -
Benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat.
Das Forum freut sich über eine Spende. Benutzt dazu den Spendenbutton oben rechts. Danke!
der Installationsfixer: curl -fsL https://iobroker.net/fix.sh | bash - -
@paul53 hat wunderbar geklappt. Du hast mir viel Zeit und Nerven erspart.
Anbei meine (ganz leicht) angepasste Variante, die ich nun in Betrieb habe:

<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="fZpa$[L$,GDGdQ|yeR}h">code</variable> <variable type="timeout" id="Tastereingabe_timeout">Tastereingabe_timeout</variable> </variables> <block type="variables_set" id="3a0Dkgszm_ei=Sx~hg3S" x="-87" y="13"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="VALUE"> <block type="text" id="z4CP0MeVg3P1N6RM]]V4"> <field name="TEXT"></field> </block> </value> <next> <block type="comment" id="7O@::zc.QOzDb.EM^x)F"> <field name="COMMENT">Taste 2</field> <next> <block type="on_ext" id="e_SVlyA$JM:_qbjs6/S]"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="Ro1y{wh]CaS@c!5csPYB"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_2</field> </shadow> </value> <statement name="STATEMENT"> <block type="timeouts_cleartimeout" id="sxj0;T@aM6tz)R)zx7zS"> <field name="NAME">Tastereingabe_timeout</field> <next> <block type="text_append" id="8,8wgI;K9C@[A//LEn$Z"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="TEXT"> <shadow type="text" id=",vGD|V%f8-9M7+~+?cc~"> <field name="TEXT">2</field> </shadow> </value> <next> <block type="controls_if" id="TD7(LJ^tyWU_O3nsYK%C"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_operation" id="5)E!p,r6BJw=afG(drh3" inline="false"> <field name="OP">OR</field> <value name="A"> <block type="logic_compare" id="/ugR{-[j!i0xo}o:4;`N"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="h:0-15/ZS0oM89Vh#|.^"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> </block> </value> <value name="B"> <block type="text" id="}:,q%9(=I^[^l_4$ogI@"> <field name="TEXT">2</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="BnvT50gw6_A*IyR)6:8}"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="sx,r8=WUlH*5-^@nB7RY"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> </block> </value> <value name="B"> <block type="text" id="F_]VRHvti|[cqU-r4EmW"> <field name="TEXT">252</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="procedures_callnoreturn" id="Wep1wy.,ymKP2qFvX/#v"> <mutation name="Tastereingabe_timeout"></mutation> </block> </statement> <statement name="ELSE"> <block type="procedures_callnoreturn" id="IW?=5)U0fIMeR^Y~51Tg"> <mutation name="Fehleingabe"></mutation> </block> </statement> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="l9DC94X0[hxR{j!EGkFS"> <field name="COMMENT">Taste 5</field> <next> <block type="on_ext" id="}}X]|J_BflsP0BCCjm]J"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="-KRnc}gJ;n,y*VKkp{@-"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_5</field> </shadow> </value> <statement name="STATEMENT"> <block type="timeouts_cleartimeout" id="6DF*@+uBG.`[XiNM4WL="> <field name="NAME">Tastereingabe_timeout</field> <next> <block type="text_append" id="FI,xjI48N)D6F`{BrxFV"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="TEXT"> <shadow type="text" id="qs$3upW0DyUJC45crYmz"> <field name="TEXT">5</field> </shadow> </value> <next> <block type="controls_if" id="[,gR$uPh~`r38!eX^!sj"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="#y((C?XZ@,8Cs~?3@{%m"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="!]A(7I/UQ#nd/Mx]=^lq"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> </block> </value> <value name="B"> <block type="text" id="WYk6#}f^Tyt=SAmC3L[;"> <field name="TEXT">25</field> </block> </value> </block> </value> <statement name="DO0"> <block type="procedures_callnoreturn" id="NjF*YmX10XgPCJzo=}}/"> <mutation name="Tastereingabe_timeout"></mutation> </block> </statement> <statement name="ELSE"> <block type="procedures_callnoreturn" id=")/QVM]Gbx51-{I#5F+`t"> <mutation name="Fehleingabe"></mutation> </block> </statement> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> <block type="comment" id="VtSZbvdzi`elc9DFb1M." x="387" y="37"> <field name="COMMENT">Taste 4</field> <next> <block type="on_ext" id="o0ha-.@$gG7p|%ss^=g$"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="++Pt`{=lQj)F$hNc.c{/"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_4</field> </shadow> </value> <statement name="STATEMENT"> <block type="timeouts_cleartimeout" id="ZMOM[u=1T|KGNfX4z`Eo"> <field name="NAME">Tastereingabe_timeout</field> <next> <block type="text_append" id="K9S=z;a;Mj)E[=$J?OOi"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="TEXT"> <shadow type="text" id="YWS@-._:b8)x]Dc5a/b="> <field name="TEXT">4</field> </shadow> </value> <next> <block type="controls_if" id="3fBNa^e~_cHU0lvn(Efe"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="7m:X17)Ljj?M;,d_A1(Y"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="WaZ|NzJ_{iJhw][,wcFz"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> </block> </value> <value name="B"> <block type="text" id="PLtLe)jjO{*[LHPl3SyF"> <field name="TEXT">2524</field> </block> </value> </block> </value> <statement name="DO0"> <block type="variables_set" id="nx?DW^L;~hK.U0d{;P$,"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="VALUE"> <block type="text" id="A~+icxMxsrz*n]fD:{yb"> <field name="TEXT"></field> </block> </value> <next> <block type="comment" id="-L**-:A:kf`L6rl#km~I"> <field name="COMMENT">Aktion ausführen</field> </block> </next> </block> </statement> <statement name="ELSE"> <block type="procedures_callnoreturn" id="!TcDgx10UBrre)=Dat.f"> <mutation name="Fehleingabe"></mutation> </block> </statement> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="=:mK7xT(1rUIL90E(b}k"> <field name="COMMENT">restliche Tasten</field> <next> <block type="on_ext" id="B9mlf,oP@siAaMZjYkkh"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="5"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="0hV-)zEcc*{_;~A+yEG."> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_1</field> </shadow> </value> <value name="OID1"> <shadow type="field_oid" id="d$yD7YGg!(D~yiSV#h1q"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_3</field> </shadow> </value> <value name="OID2"> <shadow type="field_oid" id="!HA[6lK%F5i9bY~$!u??"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_6</field> </shadow> </value> <value name="OID3"> <shadow type="field_oid" id="K4KeOT_oU7~)#zV:h`a`"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_7</field> </shadow> </value> <value name="OID4"> <shadow type="field_oid" id="78f%YaS:j$PIJD`*.57G"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_8</field> </shadow> </value> <statement name="STATEMENT"> <block type="procedures_callnoreturn" id="d$uKPFk`{:7jV5h?.1_p"> <mutation name="Fehleingabe"></mutation> </block> </statement> </block> </next> </block> </next> </block> </next> </block> <block type="procedures_defnoreturn" id="xAeTBD2!1A+j!+fuYz(9" x="862" y="62"> <field name="NAME">Tastereingabe_timeout</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="timeouts_settimeout" id="D9Yi*ug;`LTB3XfOehNa"> <field name="NAME">Tastereingabe_timeout</field> <field name="DELAY">4</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="variables_set" id="VW`p)Y$%{b0l`y[TozoK"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="VALUE"> <block type="text" id="ITIl{RYEe%J8.;|;Y0x~"> <field name="TEXT"></field> </block> </value> </block> </statement> </block> </statement> </block> <block type="procedures_defnoreturn" id="Iun:%/J;!F5JNBiL;)!C" x="863" y="188"> <field name="NAME">Fehleingabe</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="variables_set" id="X4NtwWsOKw1XD]@5jOeI"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="VALUE"> <block type="text" id="H(C8R/]+!7.{;_Z9RG5m"> <field name="TEXT"></field> </block> </value> <next> <block type="comment" id="-2{mUf8_$]J,sh+H_eD1"> <field name="COMMENT">evtl. Alarm auslösen</field> </block> </next> </block> </statement> </block> </xml> -
@paul53 hat wunderbar geklappt. Du hast mir viel Zeit und Nerven erspart.
Anbei meine (ganz leicht) angepasste Variante, die ich nun in Betrieb habe:

<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="fZpa$[L$,GDGdQ|yeR}h">code</variable> <variable type="timeout" id="Tastereingabe_timeout">Tastereingabe_timeout</variable> </variables> <block type="variables_set" id="3a0Dkgszm_ei=Sx~hg3S" x="-87" y="13"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="VALUE"> <block type="text" id="z4CP0MeVg3P1N6RM]]V4"> <field name="TEXT"></field> </block> </value> <next> <block type="comment" id="7O@::zc.QOzDb.EM^x)F"> <field name="COMMENT">Taste 2</field> <next> <block type="on_ext" id="e_SVlyA$JM:_qbjs6/S]"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="Ro1y{wh]CaS@c!5csPYB"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_2</field> </shadow> </value> <statement name="STATEMENT"> <block type="timeouts_cleartimeout" id="sxj0;T@aM6tz)R)zx7zS"> <field name="NAME">Tastereingabe_timeout</field> <next> <block type="text_append" id="8,8wgI;K9C@[A//LEn$Z"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="TEXT"> <shadow type="text" id=",vGD|V%f8-9M7+~+?cc~"> <field name="TEXT">2</field> </shadow> </value> <next> <block type="controls_if" id="TD7(LJ^tyWU_O3nsYK%C"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_operation" id="5)E!p,r6BJw=afG(drh3" inline="false"> <field name="OP">OR</field> <value name="A"> <block type="logic_compare" id="/ugR{-[j!i0xo}o:4;`N"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="h:0-15/ZS0oM89Vh#|.^"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> </block> </value> <value name="B"> <block type="text" id="}:,q%9(=I^[^l_4$ogI@"> <field name="TEXT">2</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="BnvT50gw6_A*IyR)6:8}"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="sx,r8=WUlH*5-^@nB7RY"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> </block> </value> <value name="B"> <block type="text" id="F_]VRHvti|[cqU-r4EmW"> <field name="TEXT">252</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="procedures_callnoreturn" id="Wep1wy.,ymKP2qFvX/#v"> <mutation name="Tastereingabe_timeout"></mutation> </block> </statement> <statement name="ELSE"> <block type="procedures_callnoreturn" id="IW?=5)U0fIMeR^Y~51Tg"> <mutation name="Fehleingabe"></mutation> </block> </statement> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="l9DC94X0[hxR{j!EGkFS"> <field name="COMMENT">Taste 5</field> <next> <block type="on_ext" id="}}X]|J_BflsP0BCCjm]J"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="-KRnc}gJ;n,y*VKkp{@-"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_5</field> </shadow> </value> <statement name="STATEMENT"> <block type="timeouts_cleartimeout" id="6DF*@+uBG.`[XiNM4WL="> <field name="NAME">Tastereingabe_timeout</field> <next> <block type="text_append" id="FI,xjI48N)D6F`{BrxFV"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="TEXT"> <shadow type="text" id="qs$3upW0DyUJC45crYmz"> <field name="TEXT">5</field> </shadow> </value> <next> <block type="controls_if" id="[,gR$uPh~`r38!eX^!sj"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="#y((C?XZ@,8Cs~?3@{%m"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="!]A(7I/UQ#nd/Mx]=^lq"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> </block> </value> <value name="B"> <block type="text" id="WYk6#}f^Tyt=SAmC3L[;"> <field name="TEXT">25</field> </block> </value> </block> </value> <statement name="DO0"> <block type="procedures_callnoreturn" id="NjF*YmX10XgPCJzo=}}/"> <mutation name="Tastereingabe_timeout"></mutation> </block> </statement> <statement name="ELSE"> <block type="procedures_callnoreturn" id=")/QVM]Gbx51-{I#5F+`t"> <mutation name="Fehleingabe"></mutation> </block> </statement> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> <block type="comment" id="VtSZbvdzi`elc9DFb1M." x="387" y="37"> <field name="COMMENT">Taste 4</field> <next> <block type="on_ext" id="o0ha-.@$gG7p|%ss^=g$"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="++Pt`{=lQj)F$hNc.c{/"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_4</field> </shadow> </value> <statement name="STATEMENT"> <block type="timeouts_cleartimeout" id="ZMOM[u=1T|KGNfX4z`Eo"> <field name="NAME">Tastereingabe_timeout</field> <next> <block type="text_append" id="K9S=z;a;Mj)E[=$J?OOi"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="TEXT"> <shadow type="text" id="YWS@-._:b8)x]Dc5a/b="> <field name="TEXT">4</field> </shadow> </value> <next> <block type="controls_if" id="3fBNa^e~_cHU0lvn(Efe"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="7m:X17)Ljj?M;,d_A1(Y"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="WaZ|NzJ_{iJhw][,wcFz"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> </block> </value> <value name="B"> <block type="text" id="PLtLe)jjO{*[LHPl3SyF"> <field name="TEXT">2524</field> </block> </value> </block> </value> <statement name="DO0"> <block type="variables_set" id="nx?DW^L;~hK.U0d{;P$,"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="VALUE"> <block type="text" id="A~+icxMxsrz*n]fD:{yb"> <field name="TEXT"></field> </block> </value> <next> <block type="comment" id="-L**-:A:kf`L6rl#km~I"> <field name="COMMENT">Aktion ausführen</field> </block> </next> </block> </statement> <statement name="ELSE"> <block type="procedures_callnoreturn" id="!TcDgx10UBrre)=Dat.f"> <mutation name="Fehleingabe"></mutation> </block> </statement> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="=:mK7xT(1rUIL90E(b}k"> <field name="COMMENT">restliche Tasten</field> <next> <block type="on_ext" id="B9mlf,oP@siAaMZjYkkh"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="5"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="0hV-)zEcc*{_;~A+yEG."> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_1</field> </shadow> </value> <value name="OID1"> <shadow type="field_oid" id="d$yD7YGg!(D~yiSV#h1q"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_3</field> </shadow> </value> <value name="OID2"> <shadow type="field_oid" id="!HA[6lK%F5i9bY~$!u??"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_6</field> </shadow> </value> <value name="OID3"> <shadow type="field_oid" id="K4KeOT_oU7~)#zV:h`a`"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_7</field> </shadow> </value> <value name="OID4"> <shadow type="field_oid" id="78f%YaS:j$PIJD`*.57G"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_8</field> </shadow> </value> <statement name="STATEMENT"> <block type="procedures_callnoreturn" id="d$uKPFk`{:7jV5h?.1_p"> <mutation name="Fehleingabe"></mutation> </block> </statement> </block> </next> </block> </next> </block> </next> </block> <block type="procedures_defnoreturn" id="xAeTBD2!1A+j!+fuYz(9" x="862" y="62"> <field name="NAME">Tastereingabe_timeout</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="timeouts_settimeout" id="D9Yi*ug;`LTB3XfOehNa"> <field name="NAME">Tastereingabe_timeout</field> <field name="DELAY">4</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="variables_set" id="VW`p)Y$%{b0l`y[TozoK"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="VALUE"> <block type="text" id="ITIl{RYEe%J8.;|;Y0x~"> <field name="TEXT"></field> </block> </value> </block> </statement> </block> </statement> </block> <block type="procedures_defnoreturn" id="Iun:%/J;!F5JNBiL;)!C" x="863" y="188"> <field name="NAME">Fehleingabe</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="variables_set" id="X4NtwWsOKw1XD]@5jOeI"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="VALUE"> <block type="text" id="H(C8R/]+!7.{;_Z9RG5m"> <field name="TEXT"></field> </block> </value> <next> <block type="comment" id="-2{mUf8_$]J,sh+H_eD1"> <field name="COMMENT">evtl. Alarm auslösen</field> </block> </next> </block> </statement> </block> </xml>Ich habe die Codeabfrage nun auf Basis von @paul53 nochmal etwas überarbeitet.
Nun wird der "code" erst geprüft, wenn die code länge (Anzahl der Eingabe) komplett ist. Im Beispiel 4
Wird mitten in der Eingabe abgebrochen, dann wird die Eingabe ebenfalls nach 4 Sekunden resettet.Hier der Screenshot:

und im Spoiler der code für den blockly Import:
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="fZpa$[L$,GDGdQ|yeR}h">code</variable>
<variable type="timeout" id="Tastereingabe_timeout">Tastereingabe_timeout</variable>
</variables>
<block type="variables_set" id="3a0Dkgszm_ei=Sx~hg3S" x="-62" y="-113">
<field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field>
<value name="VALUE">
<block type="text" id="z4CP0MeVg3P1N6RM]]V4">
<field name="TEXT"></field>
</block>
</value>
<next>
<block type="comment" id="7O@::zc.QOzDb.EM^x)F">
<field name="COMMENT">Taste 1</field>
<next>
<block type="on_ext" id="e_SVlyA$JM:qbjs6/S]">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
<field name="CONDITION">true</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="Ro1y{wh]CaS@c!5csPYB">
<field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_1</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="timeouts_cleartimeout" id="sxj0;T@aM6tz)R)zx7zS">
<field name="NAME">Tastereingabe_timeout</field>
<next>
<block type="text_append" id="8,8wgI;K9C@[A//LEn$Z">
<field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field>
<value name="TEXT">
<shadow type="text" id=",vGD|V%f8-9M7+~+?cc~">
<field name="TEXT">1</field>
</shadow>
</value>
<next>
<block type="procedures_callnoreturn" id="nxVw1FeSxQtw#LBHEwn"> <mutation name="Tastereingabe_timeout"></mutation> <next> <block type="procedures_callnoreturn" id="u.S/S::}A*:k){@/g2@+"> <mutation name="Code auswerten"></mutation> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="l9DC94X0[hxR{j!EGkFS"> <field name="COMMENT">Taste 2</field> <next> <block type="on_ext" id="}}X]|J_BflsP0BCCjm]J"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="-KRnc}gJ;n,y*VKkp{@-"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_2</field> </shadow> </value> <statement name="STATEMENT"> <block type="timeouts_cleartimeout" id="6DF*@+uBG.[XiNM4WL=">
<field name="NAME">Tastereingabe_timeout</field>
<next>
<block type="text_append" id="FI,xjI48N)D6F{BrxFV"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="TEXT"> <shadow type="text" id="qs$3upW0DyUJC45crYmz"> <field name="TEXT">2</field> </shadow> </value> <next> <block type="procedures_callnoreturn" id="NjF*YmX10XgPCJzo=}}/"> <mutation name="Tastereingabe_timeout"></mutation> <next> <block type="procedures_callnoreturn" id="yOc$rEeFQzB-eV#ZwkhB"> <mutation name="Code auswerten"></mutation> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="VtSZbvdzielc9DFb1M.">
<field name="COMMENT">Taste 3</field>
<next>
<block type="on_ext" id="o0ha-.@$gG7p|%ss^=g$">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
<field name="CONDITION">true</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="++Pt{=lQj)F$hNc.c{/"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_3</field> </shadow> </value> <statement name="STATEMENT"> <block type="timeouts_cleartimeout" id="ZMOM[u=1T|KGNfX4zEo">
<field name="NAME">Tastereingabe_timeout</field>
<next>
<block type="text_append" id="K9S=z;a;Mj)E[=$J?OOi">
<field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field>
<value name="TEXT">
<shadow type="text" id="YWS@-.:b8)x]Dc5a/b=">
<field name="TEXT">3</field>
</shadow>
</value>
<next>
<block type="procedures_callnoreturn" id="R$os0/q|@Fl.Fuj*H/N"> <mutation name="Tastereingabe_timeout"></mutation> <next> <block type="procedures_callnoreturn" id=")!s~?t7A=-W6VEOE|u3X"> <mutation name="Code auswerten"></mutation> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="=:mK7xT(1rUIL90E(b}k"> <field name="COMMENT">Taste 4</field> <next> <block type="on_ext" id="B9mlf,oP@siAaMZjYkkh"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="0hV-)zEcc*{_;~A+yEG."> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_4</field> </shadow> </value> <statement name="STATEMENT"> <block type="timeouts_cleartimeout" id="k?eZt1-CM8cr$|MzZTT_"> <field name="NAME">Tastereingabe_timeout</field> <next> <block type="text_append" id="!_aes.)@oFwt*sNJQ+J;"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="TEXT"> <shadow type="text" id="w~boH]BBxMvzJ=CL#i|T"> <field name="TEXT">4</field> </shadow> </value> <next> <block type="procedures_callnoreturn" id="eIDCn]h@[^Oo[I/#koFK"> <mutation name="Tastereingabe_timeout"></mutation> <next> <block type="procedures_callnoreturn" id="QWR%I%{D^QJqq)SoPhW">
<mutation name="Code auswerten"></mutation>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
<block type="comment" id="iUR;PQ%ukEXLZ)~Vs|mU" x="387" y="-88">
<field name="COMMENT">Taste 5</field>
<next>
<block type="on_ext" id="v4CPn*]rX:l(1WOz$M)"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="jrMkQ)J)T$duo+AhXH^r"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_5</field> </shadow> </value> <statement name="STATEMENT"> <block type="timeouts_cleartimeout" id="ORe@J%jm)1vW{WU!ORSt"> <field name="NAME">Tastereingabe_timeout</field> <next> <block type="text_append" id="_Cu!c-.z5%~+0$e#W;w9"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="TEXT"> <shadow type="text" id="5AOTIv5wR{QGrUYH#iUo"> <field name="TEXT">5</field> </shadow> </value> <next> <block type="procedures_callnoreturn" id="p)oAtA#Edxn@%r1X%Z}m"> <mutation name="Tastereingabe_timeout"></mutation> <next> <block type="procedures_callnoreturn" id="6(e%,_0Bk-t7oW($^_(Y"> <mutation name="Code auswerten"></mutation> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="us~4LB9*z{yKcw$bR^+k"> <field name="COMMENT">Taste 6</field> <next> <block type="on_ext" id="ONK]THi}k=;+.zMj*2yv"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="wVR|}!dYvn;J=vrnz$]D"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_6</field> </shadow> </value> <statement name="STATEMENT"> <block type="timeouts_cleartimeout" id="i!0OtfNn2/eF+a,=%H+-"> <field name="NAME">Tastereingabe_timeout</field> <next> <block type="text_append" id="y][eaI{Ed^zJOT/(WHR">
<field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field>
<value name="TEXT">
<shadow type="text" id="}4Q:ZDf?)HWDDa-SH16S">
<field name="TEXT">6</field>
</shadow>
</value>
<next>
<block type="procedures_callnoreturn" id="pcy8Z?u=QmB%/eNAIj*)">
<mutation name="Tastereingabe_timeout"></mutation>
<next>
<block type="procedures_callnoreturn" id="5ucyI_U5yRb-=SlQS?kh">
<mutation name="Code auswerten"></mutation>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="comment" id="v09@0|,fyLQ/hLF%Ek00">
<field name="COMMENT">Taste 7</field>
<next>
<block type="on_ext" id="o4f[jUi9?R=gbgnW0,7a">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
<field name="CONDITION">true</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="4oiiX3osXrGNu/Ta-!LW">
<field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_7</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="timeouts_cleartimeout" id="Qi.~iGV=|iWM|ps]W5p">
<field name="NAME">Tastereingabe_timeout</field>
<next>
<block type="text_append" id="jZ^xoJOQ5ohPcfd2U@S">
<field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field>
<value name="TEXT">
<shadow type="text" id="D1MpxdhmLP/^[h+=n/ck">
<field name="TEXT">7</field>
</shadow>
</value>
<next>
<block type="procedures_callnoreturn" id="M/+aCAe#/$Kxw+b|B._"> <mutation name="Tastereingabe_timeout"></mutation> <next> <block type="procedures_callnoreturn" id="q1=Tv^%{R+$K|j_I^[(">
<mutation name="Code auswerten"></mutation>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="comment" id="uO~fBOCx;~Iu3Mddm?"> <field name="COMMENT">Taste 8</field> <next> <block type="on_ext" id="zSoXfN(wJ.mO*Hl^pYs1"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="Jc;Uz|=8tAQ.xRTR_:vd"> <field name="oid">knx.0.Sensoren.UG.Codeschloss_Taste_8</field> </shadow> </value> <statement name="STATEMENT"> <block type="timeouts_cleartimeout" id="5hRDVfv1(A4s;Vqoo}z">
<field name="NAME">Tastereingabe_timeout</field>
<next>
<block type="text_append" id="((Ee-p)|o?GIFG?]IOw-">
<field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field>
<value name="TEXT">
<shadow type="text" id="rc)?o;2k^GnQUx?X4rR%">
<field name="TEXT">8</field>
</shadow>
</value>
<next>
<block type="procedures_callnoreturn" id="H!ABSsrYTDTN}dvi#$T,">
<mutation name="Tastereingabe_timeout"></mutation>
<next>
<block type="procedures_callnoreturn" id="tGg$q~HW~FXuzT%,p%0d">
<mutation name="Code auswerten"></mutation>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
<block type="procedures_defnoreturn" id="xAeTBD2!1A+j!+fuYz(9" x="862" y="-87">
<field name="NAME">Tastereingabe_timeout</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK">
<block type="timeouts_settimeout" id="D9Yiug;LTB3XfOehNa"> <field name="NAME">Tastereingabe_timeout</field> <field name="DELAY">4</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="variables_set" id="VWp)Y$%{b0ly[TozoK"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> <value name="VALUE"> <block type="text" id="ITIl{RYEe%J8.;|;Y0x~"> <field name="TEXT"></field> </block> </value> </block> </statement> </block> </statement> </block> <block type="procedures_defnoreturn" id="]w2o%mA..K[lO=}1@.qd" x="863" y="63"> <field name="NAME">Code auswerten</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="controls_if" id="v%$cmyMVU4Ffbf!C-|w5"> <value name="IF0"> <block type="logic_compare" id="w;03AtcZV*)mw^O@Ss)H"> <field name="OP">EQ</field> <value name="A"> <block type="text_length" id="7VlneYG9f6wptV/7Napt"> <value name="VALUE"> <shadow type="text" id="zrkQ:=(XB_nN:%R/8^Cu"> <field name="TEXT">abc</field> </shadow> <block type="variables_get" id="oNV2M$9RucpDjYLTFnN,"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> </block> </value> </block> </value> <value name="B"> <block type="math_number" id="~4qhmjxFIV{41lq?wYn4"> <field name="NUM">4</field> </block> </value> </block> </value> <statement name="DO0"> <block type="controls_if" id="#xu}-a=7A8gE5S[,sO72"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="S?E;SH}!C=IOsso=UFsJ"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="rp2B@m1(D:dC}=n_V!/?"> <field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field> </block> </value> <value name="B"> <block type="text" id="Pe+)+rXrUuVwms?6xTzu"> <field name="TEXT">2425</field> </block> </value> </block> </value> <statement name="DO0"> <block type="comment" id="-L**-:A:kfL6rl#km~I">
<field name="COMMENT">Code OK: Aktion ausführen</field>
</block>
</statement>
<statement name="ELSE">
<block type="comment" id="C=317it,8oB}45)@IvJX">
<field name="COMMENT">Code falsch: Aktion ausführen</field>
</block>
</statement>
<next>
<block type="variables_set" id="ZdJFauga~RJfcLSzV4qo">
<field name="VAR" id="fZpa$[L$,GDGdQ|yeR}h">code</field>
<value name="VALUE">
<block type="text" id=".Hy53;$0$v*C(U8}VNeA">
<field name="TEXT"></field>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden
