Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. [Vorlage] Flexible Pin-Eingabe mit Blockly

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    [Vorlage] Flexible Pin-Eingabe mit Blockly

    This topic has been deleted. Only users with topic management privileges can see it.
    • rantanplan
      rantanplan last edited by rantanplan

      Hallo Zusammen

      Ich habe hier mal ein kleines Beispiel für eine Pin-Eingabe mit Blockly.
      Es können "beliebig" viele Pin's abgefragt und Aktionen ausgelöst werden.
      Einzig die Länge der eingetragenen Pin's muß gleich sein!
      In dem Beispiel wird nur mit 3 "Eingabetasten" gearbeitet (1 bis 3).
      Da bei 3 Zahlen, die Kombinationen nicht sehr zahlreich sind, wird die "maxCodeLaenge" auf 3 gesetzt.
      Wenn Ihr ein Eingabefeld von 0 bis 9 habt könnt Ihr die "maxCodeLaenge" auf 10 oder mehr setzen.
      Die Pin's können aus Zahlen, Buchstaben oder eine Kombination aus Beidem bestehen.
      Das hängt ganz von Eurer Eingabe ab.
      Für das Beispiel benutze ich 3 boolsche Variablen die ich über VIS steuer.
      Dazu habe ich in VIS drei hqwidgets - on/off angelegt.
      Diese Widgets haben eine Taster-Funktion. Das heist die schalten automatsch wieder zurück.
      Leider geht das Zurückschalten relativ langsam. Ich habe da nichts gefunden womit ich das beschleinigen kann.
      Und andere Widgets mit Taster-Funktion habe ich auch nicht gefunden.
      Vielleicht hat da jemand von Euch einen Tip.

      Nun ein paar Bildchen und zum Schluss die Importdatei.

      Das Eingabefeld in VIS.
      147_widgets.png

      Und nun die Progammteile. Dies ist alles in einem Script.
      147_pincode_main.png
      147_pincode_init.png
      147_pincode_getcode.png
      147_pincode_versuche.png

      Hier der Imort:

      <xml xmlns="http://www.w3.org/1999/xhtml">
        <block type="comment" id=".M/Q%KRmxbXWc2P9~_MO" x="-87" y="162">
          <field name="COMMENT">Einmalige Initialisierung bei Programmstart</field>
          <next>
            <block type="procedures_callnoreturn" id="tjP%K@i{#i,h1Dyax-gY">
              <mutation name="Initialisierung"></mutation>
              <next>
                <block type="comment" id="?bXfiCYH0h;wOsNVLQT1">
                  <field name="COMMENT">Hier beginnt das Triggern</field>
                  <next>
                    <block type="comment" id="Ox)}[Fr#C.VldaJS5L^k">
                      <field name="COMMENT">Beliebig erweiterbar</field>
                      <next>
                        <block type="on_ext" id="7r*}c).]GtkEH)FR.:s.">
                          <mutation items="3"></mutation>
                          <field name="CONDITION">true</field>
                          <field name="ACK_CONDITION"></field>
                          <value name="OID0">
                            <shadow type="field_oid" id="qW*M98D`Of90FmZ?BT;~">
                              <field name="oid">javascript.1.bolTest01</field>
                            </shadow>
                          </value>
                          <value name="OID1">
                            <shadow type="field_oid" id="db.g;R`[uTi-M|khCqfC">
                              <field name="oid">javascript.1.bolTest02</field>
                            </shadow>
                          </value>
                          <value name="OID2">
                            <shadow type="field_oid" id="xXI+u{uUm0V4mOYK!n]j">
                              <field name="oid">javascript.1.bolTest03</field>
                            </shadow>
                          </value>
                          <statement name="STATEMENT">
                            <block type="comment" id="Yg;,[I7Ex=?rcz#y?kj%">
                              <field name="COMMENT">Timer für zu lange Eingabepause stoppen</field>
                              <next>
                                <block type="timeouts_cleartimeout" id="#p8Sw}HSQK?cYiU:YHiK">
                                  <field name="NAME">timeout</field>
                                  <next>
                                    <block type="comment" id="?pNSp?WhqKPHT/B_pJo:">
                                      <field name="COMMENT">Nur ausführen wenn Eingabe nicht geblockt</field>
                                      <next>
                                        <block type="controls_if" id="`dn-O]h-kTj)k:Hx)Xkz">
                                          <value name="IF0">
                                            <block type="logic_compare" id="aahnsRO!(k,8K;ftiGcN">
                                              <field name="OP">NEQ</field>
                                              <value name="A">
                                                <block type="variables_get" id="~1[*:7k/oGI/ZT1ie-F5">
                                                  <field name="VAR">AnzahlVersuche</field>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="variables_get" id="9EtqToNOpvma_:nUc:I3">
                                                  <field name="VAR">maxVersuche</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <statement name="DO0">
                                            <block type="controls_if" id="53w`on3Q~KRaZW)3F6_[">
                                              <mutation elseif="2"></mutation>
                                              <value name="IF0">
                                                <block type="logic_compare" id="=Vuh)csdD]A:f+;xaY0c">
                                                  <field name="OP">EQ</field>
                                                  <value name="A">
                                                    <block type="get_value" id="73#_D/?hW=+je)pXEOH]">
                                                      <field name="ATTR">val</field>
                                                      <field name="OID">javascript.1.bolTest01</field>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <block type="logic_boolean" id="-nBqftYopC%u~4,0#S:J">
                                                      <field name="BOOL">TRUE</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <statement name="DO0">
                                                <block type="comment" id="iDWo7Ppf@/PIDOC3,nQg">
                                                  <field name="COMMENT">Die Eingabe an Funktion übergeben</field>
                                                  <next>
                                                    <block type="procedures_callnoreturn" id="9ND8^RRRst6J*Tr1aF:P" inline="true">
                                                      <mutation name="getCode">
                                                        <arg name="TastenWert"></arg>
                                                      </mutation>
                                                      <value name="ARG0">
                                                        <block type="text" id=";{hUh`J|FuWgRnG+V`x/">
                                                          <field name="TEXT">1</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </next>
                                                </block>
                                              </statement>
                                              <value name="IF1">
                                                <block type="logic_compare" id="7OCP}UF3YaQ|gs=RDF`y">
                                                  <field name="OP">EQ</field>
                                                  <value name="A">
                                                    <block type="get_value" id="NHZ%eeYxhwr?#M_(BhP/">
                                                      <field name="ATTR">val</field>
                                                      <field name="OID">javascript.1.bolTest02</field>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <block type="logic_boolean" id="*2NWW1B~r6Z2E}P%j2wg">
                                                      <field name="BOOL">TRUE</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <statement name="DO1">
                                                <block type="procedures_callnoreturn" id="TUEyn}|x(z36g?T63y*_" inline="true">
                                                  <mutation name="getCode">
                                                    <arg name="TastenWert"></arg>
                                                  </mutation>
                                                  <value name="ARG0">
                                                    <block type="text" id="]Rf`6@?xK*gplLyQ-bQP">
                                                      <field name="TEXT">2</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </statement>
                                              <value name="IF2">
                                                <block type="logic_compare" id="8oUmv2o%~@wjdNn_2bB}">
                                                  <field name="OP">EQ</field>
                                                  <value name="A">
                                                    <block type="get_value" id="D5^##Kxmy;b`o1B=Nj_?">
                                                      <field name="ATTR">val</field>
                                                      <field name="OID">javascript.1.bolTest03</field>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <block type="logic_boolean" id="=+FvloDpnlxoQhQt]biY">
                                                      <field name="BOOL">TRUE</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <statement name="DO2">
                                                <block type="procedures_callnoreturn" id="?}Q)OGY}05Ms(#R@Kycz" inline="true">
                                                  <mutation name="getCode">
                                                    <arg name="TastenWert"></arg>
                                                  </mutation>
                                                  <value name="ARG0">
                                                    <block type="text" id=";dy%FKdEuIq;eorrIp|h">
                                                      <field name="TEXT">3</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </statement>
                                            </block>
                                          </statement>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </statement>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </next>
        </block>
        <block type="procedures_defnoreturn" id="O)q*?M8Hfa5)/}O6ZsZ7" x="563" y="163">
          <field name="NAME">Initialisierung</field>
          <comment pinned="false" h="80" w="160">Bei Programmstart Werte vorgeben.</comment>
          <statement name="STACK">
            <block type="variables_set" id="?L69j3%sRmc}([5G2X60">
              <field name="VAR">AnzahlVersuche</field>
              <value name="VALUE">
                <block type="math_number" id="t]h/P`X7feEalP-;RDq_">
                  <field name="NUM">0</field>
                </block>
              </value>
              <next>
                <block type="variables_set" id="wMeGQPHU)@|vwaJP%iqr">
                  <field name="VAR">tempCode</field>
                  <value name="VALUE">
                    <block type="text" id="^J(t|s-ySqnJKRARc_:|">
                      <field name="TEXT"></field>
                    </block>
                  </value>
                  <next>
                    <block type="comment" id="_UZqDvMtW0LHk96L^T8z">
                      <field name="COMMENT">Maximale Fehlversuche festlegen</field>
                      <next>
                        <block type="variables_set" id="e663[k*hSCd%o_?sd(XA">
                          <field name="VAR">maxVersuche</field>
                          <value name="VALUE">
                            <block type="math_number" id="{OjuYXvX(;:=T.oag~a#">
                              <field name="NUM">3</field>
                            </block>
                          </value>
                          <next>
                            <block type="comment" id="K(:;y-gihBx_:{%kJ~Oo">
                              <field name="COMMENT">Länge der Codes festlegen</field>
                              <next>
                                <block type="variables_set" id="BGt@+4h!d)Kco3]{`,)V">
                                  <field name="VAR">maxCodeLaenge</field>
                                  <value name="VALUE">
                                    <block type="math_number" id="|Wm^i`:C`~o0Bp7;,-yy">
                                      <field name="NUM">3</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="comment" id="ZgOwwPRCnNLM~@tR?DhB">
                                      <field name="COMMENT">Liste der Codes</field>
                                      <next>
                                        <block type="comment" id="Kp%9#vKhE4,}vS;@yW_0">
                                          <field name="COMMENT">Beliebig erweiterbar. Auf Länge achten!</field>
                                          <next>
                                            <block type="variables_set" id=";~}[HtK6:wa8W/1,]j2a">
                                              <field name="VAR">CodeAbwesend</field>
                                              <value name="VALUE">
                                                <block type="text" id="/%k9:KVHUC2RVgH.:^v5">
                                                  <field name="TEXT">321</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="variables_set" id="~g%5m:PVJO18)ZuFgT%Y">
                                                  <field name="VAR">CodeAnwesend</field>
                                                  <value name="VALUE">
                                                    <block type="text" id=";ut1,j-D,_`I[Y-ibyD-">
                                                      <field name="TEXT">123</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
        <block type="procedures_defnoreturn" id="t@lDFN#V:FHO31zeMUSV" x="-87" y="813">
          <mutation>
            <arg name="TastenWert"></arg>
          </mutation>
          <field name="NAME">getCode</field>
          <comment pinned="false" h="80" w="160">Code pruefen</comment>
          <statement name="STACK">
            <block type="text_append" id="@0sNv=W?MJzk`622W]Q4">
              <field name="VAR">tempCode</field>
              <value name="TEXT">
                <shadow type="text" id="6q^nqw|R(+L0{n_l/Gc4">
                  <field name="TEXT"></field>
                </shadow>
                <block type="variables_get" id="LWMvwI0w|bcPvg-n5gGg">
                  <field name="VAR">TastenWert</field>
                </block>
              </value>
              <next>
                <block type="debug" id="vjr3FKb9Vi*y+77wJTx,">
                  <field name="Severity">log</field>
                  <value name="TEXT">
                    <shadow type="text" id=".0O)AP~8_Z_^cA%~Y=0o">
                      <field name="TEXT"></field>
                    </shadow>
                    <block type="text_join" id=")*fGp8U0U/F=Wcs;KY/|">
                      <mutation items="2"></mutation>
                      <value name="ADD0">
                        <block type="text" id=").fVwr0of^0wi[*+UipI">
                          <field name="TEXT">*****Eingabe -&gt; </field>
                        </block>
                      </value>
                      <value name="ADD1">
                        <block type="variables_get" id="Cw9-Bo9Tle36/K]UpAeB">
                          <field name="VAR">tempCode</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <next>
                    <block type="controls_if" id="n5A{||l/F/:ozsHSOg4^">
                      <mutation elseif="2"></mutation>
                      <value name="IF0">
                        <block type="logic_compare" id="T`=]omffKe6S+_(UpU:6">
                          <field name="OP">GT</field>
                          <value name="A">
                            <block type="text_length" id=";Xk,nZX;Io@ax2OT=s73">
                              <value name="VALUE">
                                <shadow type="text" id="RGYf`*(-7S#_3L-Ww7];">
                                  <field name="TEXT">abc</field>
                                </shadow>
                                <block type="variables_get" id="gapi+DOc_=Fi})6b*l7}">
                                  <field name="VAR">tempCode</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <value name="B">
                            <block type="variables_get" id="j9RTTC,C]+Q)EY2SD}`i">
                              <field name="VAR">maxCodeLaenge</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO0">
                        <block type="comment" id="|T`go8I~X04G[v8TB8v3">
                          <field name="COMMENT">Zuviele Eingaben</field>
                          <next>
                            <block type="comment" id="+lM8)EE*fCo`n1X0.Dw=">
                              <field name="COMMENT">Eingabe löschen und Versuche hochzählen</field>
                              <next>
                                <block type="debug" id="sRw2Xy,4}LO3T4q.5*yM">
                                  <field name="Severity">log</field>
                                  <value name="TEXT">
                                    <shadow type="text" id="+cYZRRJa1z=6hGhTLdam">
                                      <field name="TEXT">*****Zuviele Zeichen*****</field>
                                    </shadow>
                                  </value>
                                  <next>
                                    <block type="variables_set" id="%D8buHC|kCUU1/KVJB[2">
                                      <field name="VAR">tempCode</field>
                                      <value name="VALUE">
                                        <block type="text" id="(+@y`]ao5LqZe-X1j!)D">
                                          <field name="TEXT"></field>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="procedures_callnoreturn" id="T/]?rq:p![ebfuT~k+i/">
                                          <mutation name="chkVersuche"></mutation>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </statement>
                      <value name="IF1">
                        <block type="logic_compare" id="lDJ@;/jzBi=HTRV]yYn,">
                          <field name="OP">EQ</field>
                          <value name="A">
                            <block type="variables_get" id="*v]-iY2]3*a;Ir}hU9sM">
                              <field name="VAR">tempCode</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="variables_get" id="FXw/|._t2rtHCxgNR}N{">
                              <field name="VAR">CodeAnwesend</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO1">
                        <block type="comment" id="l(HPe4p~ikj;pvhZJME,">
                          <field name="COMMENT">Eingabe korrekt</field>
                          <next>
                            <block type="debug" id="U;M412@-[mW58w:2/pDZ">
                              <field name="Severity">log</field>
                              <value name="TEXT">
                                <shadow type="text" id="/6PKtIv;_asj~zH1YFWm">
                                  <field name="TEXT">*****Abwesend aktivieren****</field>
                                </shadow>
                              </value>
                              <next>
                                <block type="variables_set" id="JsF`#tPrlP((e*D(PKz;">
                                  <field name="VAR">AnzahlVersuche</field>
                                  <value name="VALUE">
                                    <block type="math_number" id="_#wsFg(JuzNqSyCO63UI">
                                      <field name="NUM">0</field>
                                    </block>
                                  </value>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </statement>
                      <value name="IF2">
                        <block type="logic_compare" id="2vFBpg|}LmWTU`qhvSPq">
                          <field name="OP">EQ</field>
                          <value name="A">
                            <block type="variables_get" id="h{5A9tIJ[J}[xMy_7AAS">
                              <field name="VAR">tempCode</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="variables_get" id="*P@212xQ;qQPEGyj%ZrM">
                              <field name="VAR">CodeAbwesend</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO2">
                        <block type="comment" id="I#o7zi#/?,2ybu:rbslY">
                          <field name="COMMENT">Eingabe korrekt</field>
                          <next>
                            <block type="debug" id="gbMt*_LDG5GlZ=~5q;Cp">
                              <field name="Severity">log</field>
                              <value name="TEXT">
                                <shadow type="text" id="ZGUOVYnw5W!20VGJXQ};">
                                  <field name="TEXT">*****Anwesend aktivieren****</field>
                                </shadow>
                              </value>
                              <next>
                                <block type="variables_set" id="hK5#^tb~)E9Bgr*GFnxt">
                                  <field name="VAR">AnzahlVersuche</field>
                                  <value name="VALUE">
                                    <block type="math_number" id="kZ^Vqv6TF3HNE3Pral(2">
                                      <field name="NUM">0</field>
                                    </block>
                                  </value>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </statement>
                      <next>
                        <block type="timeouts_settimeout" id="*)]FG}!jqa@!^@C404zD">
                          <field name="NAME">timeout</field>
                          <field name="DELAY">5000</field>
                          <field name="UNIT">ms</field>
                          <statement name="STATEMENT">
                            <block type="comment" id="@87rub*L(JD2dLo|`Aef">
                              <field name="COMMENT">Wenn in 5 Sek. keine weitere Eingabe erfolgt</field>
                              <next>
                                <block type="comment" id="/6Z(,/]_}ZhyadfHIgZ5">
                                  <field name="COMMENT">dann Eingabe löschen und Versuche hochzählen</field>
                                  <next>
                                    <block type="variables_set" id="a3yX(4)M(27nSsHd.d-_">
                                      <field name="VAR">tempCode</field>
                                      <value name="VALUE">
                                        <block type="text" id="oolYv~l{~LPGx~/TXDZ[">
                                          <field name="TEXT"></field>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="procedures_callnoreturn" id="Uq`e6b9wNj]Sp(Zb#o#X">
                                          <mutation name="chkVersuche"></mutation>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </statement>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
        <block type="procedures_defnoreturn" id="c,ULx]X]~F-z^(_+{6vr" x="-87" y="1612">
          <field name="NAME">chkVersuche</field>
          <comment pinned="false" h="80" w="160">Fehlerhafte Eingaben zählen und Eingabe sperren wenn maxVersuche erreicht.</comment>
          <statement name="STACK">
            <block type="math_change" id="+bbjB`}N7U3vkk:@%?[V">
              <field name="VAR">AnzahlVersuche</field>
              <value name="DELTA">
                <shadow type="math_number" id="P!Tq!OVi/*(ehXZb]uC8">
                  <field name="NUM">1</field>
                </shadow>
              </value>
              <next>
                <block type="controls_if" id="V6AzqIh:%+F@oh[M-IQ{">
                  <value name="IF0">
                    <block type="logic_compare" id="!CYyilZ1svbcZ]Yf=BXd">
                      <field name="OP">EQ</field>
                      <value name="A">
                        <block type="variables_get" id="@Zmti,3QUsDg5gTF6tjC">
                          <field name="VAR">AnzahlVersuche</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="variables_get" id="x=cs)@yt;A6[ua*T5FE|">
                          <field name="VAR">maxVersuche</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="debug" id="[d~Z|qEH+C4%5%A*xBTT">
                      <field name="Severity">log</field>
                      <value name="TEXT">
                        <shadow type="text" id="v.9ViGY:H4?EbA+fzjKV">
                          <field name="TEXT">*****Eingabe gesperrt*****</field>
                        </shadow>
                      </value>
                      <next>
                        <block type="timeouts_settimeout" id="(l|4)g2/(/@5-swvVF@2">
                          <field name="NAME">sperren</field>
                          <field name="DELAY">10000</field>
                          <field name="UNIT">ms</field>
                          <statement name="STATEMENT">
                            <block type="comment" id="U22mj9gD,9P)FU@4%{K~">
                              <field name="COMMENT">Nach 10 Sek. wieder frei</field>
                              <next>
                                <block type="variables_set" id="d)*rJF_51+C|Z3NMW9N+">
                                  <field name="VAR">AnzahlVersuche</field>
                                  <value name="VALUE">
                                    <block type="math_number" id="^)c6!p[y)V0zk(9oMl16">
                                      <field name="NUM">0</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="debug" id="SO`ZMoZ)Os7:]]y=T3yE">
                                      <field name="Severity">log</field>
                                      <value name="TEXT">
                                        <shadow type="text" id="5.ubt?0E+m)aiIY`J``U">
                                          <field name="TEXT">*****Eingabe entsperrt*****</field>
                                        </shadow>
                                      </value>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </statement>
                        </block>
                      </next>
                    </block>
                  </statement>
                </block>
              </next>
            </block>
          </statement>
        </block>
      </xml>
      

      Grüße

      1 Reply Last reply Reply Quote 0
      • D
        dirkeb last edited by

        Hallo Rantanplan,

        ich habe schon lange auf etwas derartiges gewartet, Super! Dein Script habe bei mir importiert, beim Starten des Scripts und auch im log sind keine Fehlermeldungen zu sehen, soweit so gut. Müssten denn jetzt nicht auch Datenpunkte bei Objekte vorhanden sein, oder? Bei mit sieht das ganze so aus.

        317_pineingabe.jpg

        Viele Grüße

        Dirk

        1 Reply Last reply Reply Quote 0
        • rantanplan
          rantanplan last edited by

          Hallo dirkeb

          Schön, dass wenigstens einer damit was anfangen kann. 😉

          Die Datenpunke, musst Du selbst anlegen.

          Entweder Systemvariablen auf der CCU oder Objekte in ioBroker.

          Die im Script gezeigten Objekte (bolTest01 bis bolTest03) sind von mir, in ioBroker, angelegte Objekte.

          Die werden beim Ex- und Import nicht mitgegeben.

          Objekte/Variablen kannst Du auch sehr leicht mit Blockly anlegen.

          Ich habe dazu eigens ein Blockly Script angelegt "GlobalVars".

          (Wenn Du mit mehreren Javascript Instanzen arbeitest musst Du auf die jeweilige Instanz achten.)

          Wenn ich ein neues Objekt/Variable brauche, packe ich das in des Script und starte es einmal und beende es wieder.

          Das Script kann man starten, so oft wie man will.

          Bereits angelegte Objekte werden nicht nochmal angelegt.

          Deine Objekte findest Du dann unter der entsprechenden Javascript Instanz.

          Z.B. javascript.0 bolTest01

          Objekte mit Blockly anlegen sieht so aus.
          147_objekte_anlegen.png

          Grüße

          1 Reply Last reply Reply Quote 0
          • L
            Loomii last edited by

            Hallo,

            Sowas kann ich auch grad gut gebrauchen. 😄 Vielleicht ne doofe Frage,aber wie und wo Importier ich dieses?

            Steh ich vorm Baum? :mrgreen:

            Mfg

            Sven

            1 Reply Last reply Reply Quote 0
            • rantanplan
              rantanplan last edited by

              Hallo

              Das Script aus dem Beitrag kopieren (STRG A)

              Auf den Button klicken
              147_import_bl_cke.png

              und in dem aufgerufenden Fenster mit STRG V einfügen.

              Grüße

              1 Reply Last reply Reply Quote 0
              • L
                Loomii last edited by

                Hallo Rantanplan,

                Vielen Dank hab mir die Skript Seite 10 mal angeschaut aber an den beiden

                Pfeilen bin Ich wohl dran vorbei :ugeek:

                Jetzt geht´s ,danke fürs Skript

                Mfg

                Sven

                1 Reply Last reply Reply Quote 0
                • lobomau
                  lobomau last edited by

                  Skript importiert: ok

                  3 hqwidgets erzeugt: ok

                  3 Variablen bolTestxx: ok

                  Wie geht es jetzt weiter? Wo im widget trage ich jetzt den Bezug zum Skript ein?

                  1 Reply Last reply Reply Quote 0
                  • rantanplan
                    rantanplan last edited by

                    @lobomau:

                    Wie geht es jetzt weiter? Wo im widget trage ich jetzt den Bezug zum Skript ein? `

                    Ein Bezug zum Script brauchst Du nicht.

                    Der Trigger im Script reagiert auf Änderung einer aufgeführten Variablen auf True/Wahr.

                    Über VIS änderst Du den Zustand der Variablen wie beim Ein-/Ausschalten einer Lampe.

                    Die Schnittstelle SIND die Variablen.

                    Wenn eine davon WAHR wird, reagiert der Trigger.

                    (Ist auch so auf dem Trigger beschrieben. Schau mal genau hin.)

                    Achte bei dem hgWidget auf den Haken bei "Taster"!
                    147_vis.png

                    Bei mir stehen die Variablen unter javascript.1…...

                    Bei Dir wird es wahrscheinlich javascript.0.... sein.

                    [Edit] Mr ist noch aufgefalle, dass ich die Debug Ausgabe "Anwesend…. / Abwesend aktiviert" vertauscht habe.

                    Grüße

                    1 Reply Last reply Reply Quote 0
                    • lobomau
                      lobomau last edited by

                      Danke. Habe es hinbekommen. Nettes Script.

                      1 Reply Last reply Reply Quote 0
                      • rantanplan
                        rantanplan last edited by

                        Prima. Freut mich.

                        Habe jetzt meinen 6-fach Wandtaster wieder gefunden 😄

                        Werde das Script erweitern. Pin-Eingabe über VIS und 6-fach Wandtaster.

                        Demnächst in diesem Kino 😉

                        1 Reply Last reply Reply Quote 0
                        • kmxak
                          kmxak Most Active last edited by

                          Überlege gerade ob man das nicht einfacher und besser lösen könnte. Kann man sich kein php Script bauen das true oder false je nach eingegebenen Pin zurückschickt? Quasi button on click ziffernfeld und dann mit dem php Ergebnis false or true weiter machen. *nur eine Idee *

                          Gesendet von meinem SM-G928F mit Tapatalk

                          1 Reply Last reply Reply Quote 0
                          • svenomatt
                            svenomatt last edited by

                            Moin,

                            sitze gerade an der Pin-Eingabe, habe die 3 Variablen test Bol.. angelegt und mit den 3 hqwidgets verbunden.

                            Muss ich jetzt noch weitere Var. anlegen.

                            und wenn ja welche sind das?

                            1 Reply Last reply Reply Quote 0
                            • rantanplan
                              rantanplan last edited by

                              Moin, Moin

                              Da wo die Kommentare "Eingabe korrekt" stehen, musst Du natürlich eigene Aktionen einbauen.

                              In dem Beispiel gibt es ja nur eine Debug-Ausgabe.

                              Dort kannst Du irgend etwas schalten oder eine eigene Variable ändern.

                              z.B. Alarm = wahr / Alarm= unwahr

                              Grüße

                              1 Reply Last reply Reply Quote 0
                              • svenomatt
                                svenomatt last edited by

                                Danke, hat hat geklappt. Hatte ich glatt überlesen.

                                1 Reply Last reply Reply Quote 0
                                • D
                                  darkbrain85 last edited by

                                  Hi!

                                  Danke für die Inspiration.

                                  Ich habe das ganze sehr leicht übernehmen können.

                                  Das Problem mit dem zurücksetzen durch den Taster habe ich auch weitestgehend gelöst. Einfach nach jedem Tastendruck die Variable per Script zurücksetzen lassen.

                                  Eine erweiterung auf die Tasten 0-9 ist auch sehr einfach möglich. Bei Bedarf kann ich das aber gerne auch nochmal exportieren falls es jemand haben möchte.

                                  Gruß

                                  Michel
                                  1860_alarmscript.png

                                  1 Reply Last reply Reply Quote 0
                                  • SmarthomeMF
                                    SmarthomeMF last edited by

                                    Hallo

                                    Ich bin noch relativ neu hier und habe keine Ahnung vom Programmieren.

                                    Möchte aber die Pin Abfrage realisieren.

                                    Dazu brauche ich eure Hilfe, dass auch ich als Anfänger das schaffe.
                                    @rantanplan:

                                    Hier der Imort:Spoiler: Show hidden text `
                                    Den Script habe ich drin.

                                    aber brauche ich da nicht noch weitere Skripte?
                                    @rantanplan:

                                    Für das Beispiel benutze ich 3 boolsche Variablen die ich über VIS steuer. `
                                    Das sind die Skripte die du zu den Tasten brauchst? oder

                                    gibt es schon ein fertiges Script das ich als Anfänger einbinden kann und das von 0-9 geht?

                                    Wäre toll, wenn ich durch eure Hilfe das schaffen würde.

                                    Danke

                                    1 Reply Last reply Reply Quote 0
                                    • rantanplan
                                      rantanplan last edited by

                                      @SmarthomeMF:

                                      Den Script habe ich drin. `
                                      Dann hast Du ja schon 90% geschafft. 😉

                                      @SmarthomeMF:

                                      aber brauche ich da nicht noch weitere Skripte? `
                                      Nein
                                      @SmarthomeMF:

                                      @rantanplan:

                                      Für das Beispiel benutze ich 3 boolsche Variablen die ich über VIS steuer. Das sind die Skripte die du zu den Tasten brauchst? oder

                                      Nein, das sind keine Scripte.

                                      Das sind Datenpunkte/Variablen. Diese kannst Du in VIS mit den Widgets verbinden.

                                      Über VIS wird dann der "PinCode" eingegeben.

                                      Das Blockly reagiert dann auf die Eingabe über VIS und baut den PinCode zusammen.

                                      @SmarthomeMF:

                                      gibt es schon ein fertiges Script das ich als Anfänger einbinden kann und das von 0-9 geht? `
                                      Versuche erst einmal die Dreier Version ans laufen zu kriegen.

                                      Dazu brauchst Du "nur" die Datenpunkte und die VIS Widgets.

                                      Kommst Du mit VIS zurecht?

                                      @SmarthomeMF:

                                      Wäre toll, wenn ich durch eure Hilfe das schaffen würde. `

                                      Wir schaffen das 😉

                                      Hier etwas um schon mal die Datenpunkte anzulegen.

                                      Achtung!!! Die haben andere Namen als in dem Beispiel.

                                      Wenn Du das folgende Blockly einmal startest werden die Variablen angelegt.

                                      Die findest Du dann unter javascript.0.Pincode_0 usw.

                                      Das Script kannst Du dann wieder beenden.

                                      Du musst dann nur in dem Beispielscript, da klicken wo "javascript.0.bolTestx" steht und durch die

                                      entsprechende "javascript.0.Pincode_x" tauschen.
                                      147_beispiel.png

                                      Hier der Export:

                                      ! <xml xmlns="http://www.w3.org/1999/xhtml"><block type="create" id="k45s-D}hiCCfW)QXQ13!" x="-312" y="37"><field name="NAME">Pincode_0</field> <statement name="STATEMENT"><block type="create" id="GzGNlOW@(Fd*)A1PQwP+"><field name="NAME">Pincode_1</field> <statement name="STATEMENT"><block type="create" id="{KMqqs^U6+Bqefj-e)_H"><field name="NAME">Pincode_2</field> <statement name="STATEMENT"><block type="create" id="Bh|7!TU)qCE)NLUQcUox"><field name="NAME">Pincode_3</field> <statement name="STATEMENT"><block type="create" id="BEQkl{Dy)uxW;O)Z1eU}"><field name="NAME">Pincode_4</field> <statement name="STATEMENT"><block type="create" id="-8S]ZFn8xy]AIG=ypi?V"><field name="NAME">Pincode_5</field> <statement name="STATEMENT"><block type="create" id="{e%@W;N!WN6)FFuzjGt%"><field name="NAME">Pincode_6</field> <statement name="STATEMENT"><block type="create" id="_H4%;yPLLJgS[UV9a0+s"><field name="NAME">Pincode_7</field> <statement name="STATEMENT"><block type="create" id="V5p68}x+,Ch!)qIu?ZlA"><field name="NAME">Pincode_8</field> <statement name="STATEMENT"><block type="create" id="e9Ue+P2Wa@=C|FOhYEX4"><field name="NAME">Pincode_9</field></block></statement></block></statement></block></statement></block></statement></block></statement></block></statement></block></statement></block></statement></block></statement></block></xml> !

                                      Und hier das Widget aus VIS.

                                      ! [{"tpl":"tplHqButton","data":{"g_fixed":false,"g_visibility":false,"g_css_font_text":false,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","oid":"javascript.0.bolTaste01","min":"false","max":"true","iconName":"/icons-mfd-png/edit_numeric_1.png","btIconWidth":"56","offsetAuto":true,"leftOffset":"15","topOffset":"55","pushButton":false,"caption":"","captionOn":"","g_leftRight":true,"timeAsInterval":"true","infoLeftFontSize":"0","infoFontRightSize":"0","infoLeftPaddingLeft":"0","infoLeftPaddingRight":"0","infoRightPaddingRight":"0","descriptionLeft":"bolTaste01","g_styles":false,"signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0},"style":{"left":"324px","top":"168px","width":"64px","height":"64px"},"widgetSet":"hqwidgets"}] !

                                      Bei Fragen fragen.

                                      Grüße

                                      1 Reply Last reply Reply Quote 0
                                      • SmarthomeMF
                                        SmarthomeMF last edited by

                                        So nun brauche ich deine Unterstützung.

                                        Ich habe das Script drin und auch schon abgeändert

                                        ! <xml 1999/xmlns="<URL url=" http:/www.w3.org/xhtml"="">http://www.w3.org/1999/xhtml">
                                        ! <block id=".M/Q%KRmxbXWc2P9~MO" type="comment" y="162" x="-87"><field name="COMMENT">Einmalige Initialisierung bei Programmstart</field>
                                        ! <next><block id="tjP%K@i{#i,h1Dyax-gY" type="procedures_callnoreturn"><mutation name="Initialisierung"></mutation>
                                        ! <next><block id="?bXfiCYH0h;wOsNVLQT1" type="comment"><field name="COMMENT">Hier beginnt das Triggern</field>
                                        ! <next><block id="Ox)}[Fr#C.VldaJS5L^k" type="comment"><field name="COMMENT">Beliebig erweiterbar</field>
                                        ! <next><block id="7r*}c).]GtkEH)FR.:s." type="on_ext"><mutation items="3"></mutation>
                                        ! <field name="CONDITION">true</field>
                                        ! <value name="OID0"><shadow id="qW*M98DOf90FmZ?BT;~" type="field_oid"><field name="oid">javascript.0.Pincode_1</field></shadow></value> ! <value name="OID1"><shadow id="db.g;R[uTi-M|khCqfC" type="field_oid"><field name="oid">javascript.0.Pincode_2</field></shadow></value>
                                        ! <value name="OID2"><shadow id="xXI+u{uUm0V4mOYK!n]j" type="field_oid"><field name="oid">javascript.0.Pincode_3</field></shadow></value>
                                        ! <statement name="STATEMENT"><block id="Yg;,[I7Ex=?rcz#y?kj%" type="comment"><field name="COMMENT">Timer für zu lange Eingabepause stoppen</field>
                                        ! <next><block id="#p8Sw}HSQK?cYiU:YHiK" type="timeouts_cleartimeout"><field name="NAME">timeout</field>
                                        ! <next><block id="?pNSp?WhqKPHT/B_pJo:" type="comment"><field name="COMMENT">Nur ausführen wenn Eingabe nicht geblockt</field>
                                        ! <next><block id="dn-O]h-kTj)k:Hx)Xkz" type="controls_if"><value name="IF0"><block id="aahnsRO!(k,8K;ftiGcN" type="logic_compare"><field name="OP">NEQ</field> ! <value name="A"><block id="~1[*:7k/oGI/ZT1ie-F5" type="variables_get"><field name="VAR">AnzahlVersuche</field></block></value> ! <value name="B"><block id="9EtqToNOpvma_:nUc:I3" type="variables_get"><field name="VAR">maxVersuche</field></block></value></block></value> ! <statement name="DO0"><block id="53won3Q~KRaZW)3F6
                                        [" type="controls_if"><mutation elseif="2"></mutation>
                                        ! <value name="IF0"><block id="=Vuh)csdD]A:f+;xaY0c" type="logic_compare"><field name="OP">EQ</field>
                                        ! <value name="A"><block id="73#D/?hW=+je)pXEOH]" type="get_value"><field name="ATTR">val</field>
                                        ! <field name="OID">javascript.0.Pincode_1</field></block></value>
                                        ! <value name="B"><block id="-nBqftYopC%u~4,0#S:J" type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value>
                                        ! <statement name="DO0"><block id="iDWo7Ppf@/PIDOC3,nQg" type="comment"><field name="COMMENT">Die Eingabe an Funktion übergeben</field>
                                        ! <next><block id="9ND8^RRRst6JTr1aF:P" type="procedures_callnoreturn" inline="true"><mutation name="getCode"><arg name="TastenWert"></arg></mutation>
                                        ! <value name="ARG0"><block id=";{hUhJ|FuWgRnG+Vx/" type="text"><field name="TEXT">1</field></block></value></block></next></block></statement>
                                        ! <value name="IF1"><block id="7OCP}UF3YaQ|gs=RDFy" type="logic_compare"><field name="OP">EQ</field> ! <value name="A"><block id="NHZ%eeYxhwr?#M_(BhP/" type="get_value"><field name="ATTR">val</field> ! <field name="OID">javascript.0.Pincode_2</field></block></value> ! <value name="B"><block id="*2NWW1B~r6Z2E}P%j2wg" type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value> ! <statement name="DO1"><block id="TUEyn}|x(z36g?T63y*_" type="procedures_callnoreturn" inline="true"><mutation name="getCode"><arg name="TastenWert"></arg></mutation> ! <value name="ARG0"><block id="]Rf6@?xK
                                        gplLyQ-bQP" type="text"><field name="TEXT">2</field></block></value></block></statement>
                                        ! <value name="IF2"><block id="8oUmv2o%~@wjdNn_2bB}" type="logic_compare"><field name="OP">EQ</field>
                                        ! <value name="A"><block id="D5^##Kxmy;bo1B=Nj_?" type="get_value"><field name="ATTR">val</field> ! <field name="OID">javascript.0.Pincode_3</field></block></value> ! <value name="B"><block id="=+FvloDpnlxoQhQt]biY" type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value> ! <statement name="DO2"><block id="?}Q)OGY}05Ms(#R@Kycz" type="procedures_callnoreturn" inline="true"><mutation name="getCode"><arg name="TastenWert"></arg></mutation> ! <value name="ARG0"><block id=";dy%FKdEuIq;eorrIp|h" type="text"><field name="TEXT">3</field></block></value></block></statement></block></statement></block></next></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block> ! <block id="O)q*?M8Hfa5)/}O6ZsZ7" type="procedures_defnoreturn" y="163" x="563"><field name="NAME">Initialisierung</field> ! <comment w="160" h="80" pinned="false">Bei Programmstart Werte vorgeben.</comment> ! <statement name="STACK"><block id="?L69j3%sRmc}([5G2X60" type="variables_set"><field name="VAR">AnzahlVersuche</field> ! <value name="VALUE"><block id="t]h/PX7feEalP-;RDq
                                        " type="math_number"><field name="NUM">0</field></block></value>
                                        ! <next><block id="wMeGQPHU)@|vwaJP%iqr" type="variables_set"><field name="VAR">tempCode</field>
                                        ! <value name="VALUE"></value>
                                        ! <next><block id="UZqDvMtW0LHk96L^T8z" type="comment"><field name="COMMENT">Maximale Fehlversuche festlegen</field>
                                        ! <next><block id="e663[k*hSCd%o
                                        ?sd(XA" type="variables_set"><field name="VAR">maxVersuche</field>
                                        ! <value name="VALUE"><block id="{OjuYXvX(;:=T.oag~a#" type="math_number"><field name="NUM">3</field></block></value>
                                        ! <next><block id="K(:;y-gihBx_:{%kJ~Oo" type="comment"><field name="COMMENT">Länge der Codes festlegen</field>
                                        ! <next><block id="BGt@+4h!d)Kco3]{,)V" type="variables_set"><field name="VAR">maxCodeLaenge</field> ! <value name="VALUE"><block id="|Wm^i:C~o0Bp7;,-yy" type="math_number"><field name="NUM">3</field></block></value> ! <next><block id="ZgOwwPRCnNLM~@tR?DhB" type="comment"><field name="COMMENT">Liste der Codes</field> ! <next><block id="Kp%9#vKhE4,}vS;@yW_0" type="comment"><field name="COMMENT">Beliebig erweiterbar. Auf Länge achten!</field> ! <next><block id=";~}[HtK6:wa8W/1,]j2a" type="variables_set"><field name="VAR">CodeAbwesend</field> ! <value name="VALUE"><block id="/%k9:KVHUC2RVgH.:^v5" type="text"><field name="TEXT">321</field></block></value> ! <next><block id="~g%5m:PVJO18)ZuFgT%Y" type="variables_set"><field name="VAR">CodeAnwesend</field> ! <value name="VALUE"><block id=";ut1,j-D,_I[Y-ibyD-" type="text"><field name="TEXT">123</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block>
                                        ! <block id="t@lDFN#V:FHO31zeMUSV" type="procedures_defnoreturn" y="813" x="-87"><mutation><arg name="TastenWert"></arg></mutation>
                                        ! <field name="NAME">getCode</field>
                                        ! <comment w="160" h="80" pinned="false">Code pruefen</comment>
                                        ! <statement name="STACK"><block id="@0sNv=W?MJzk622W]Q4" type="text_append"><field name="VAR">tempCode</field> ! <value name="TEXT"><shadow id="6q^nqw|R(+L0{n_l/Gc4" type="text"></shadow> ! <block id="LWMvwI0w|bcPvg-n5gGg" type="variables_get"><field name="VAR">TastenWert</field></block></value> ! <next><block id="vjr3FKb9Vi*y+77wJTx," type="debug"><field name="Severity">log</field> ! <value name="TEXT"><shadow id=".0O)AP~8_Z_^cA%~Y=0o" type="text"></shadow> ! <block id=")*fGp8U0U/F=Wcs;KY/|" type="text_join"><mutation items="2"></mutation> ! <value name="ADD0"><block id=").fVwr0of^0wi[*+UipI" type="text"><field name="TEXT">*****Eingabe -></field></block></value> ! <value name="ADD1"><block id="Cw9-Bo9Tle36/K]UpAeB" type="variables_get"><field name="VAR">tempCode</field></block></value></block></value> ! <next><block id="n5A{||l/F/:ozsHSOg4^" type="controls_if"><mutation elseif="2"></mutation> ! <value name="IF0"><block id="T=]omffKe6S+(UpU:6" type="logic_compare"><field name="OP">GT</field>
                                        ! <value name="A"><block id=";Xk,nZX;Io@ax2OT=s73" type="text_length"><value name="VALUE"><shadow id="RGYf*(-7S#_3L-Ww7];" type="text"><field name="TEXT">abc</field></shadow> ! <block id="gapi+DOc_=Fi})6b*l7}" type="variables_get"><field name="VAR">tempCode</field></block></value></block></value> ! <value name="B"><block id="j9RTTC,C]+Q)EY2SD}i" type="variables_get"><field name="VAR">maxCodeLaenge</field></block></value></block></value>
                                        ! <statement name="DO0"><block id="|Tgo8I~X04G[v8TB8v3" type="comment"><field name="COMMENT">Zuviele Eingaben</field> ! <next><block id="+lM8)EE*fCon1X0.Dw=" type="comment"><field name="COMMENT">Eingabe löschen und Versuche hochzählen</field>
                                        ! <next><block id="sRw2Xy,4}LO3T4q.5yM" type="debug"><field name="Severity">log</field>
                                        ! <value name="TEXT"><shadow id="+cYZRRJa1z=6hGhTLdam" type="text"><field name="TEXT">Zuviele Zeichen</field></shadow></value>
                                        ! <next><block id="%D8buHC|kCUU1/KVJB[2" type="variables_set"><field name="VAR">tempCode</field>
                                        ! <value name="VALUE"></value>
                                        ! <next><block id="T/]?rq:p![ebfuT~k+i/" type="procedures_callnoreturn"><mutation name="chkVersuche"></mutation></block></next></block></next></block></next></block></next></block></statement>
                                        ! <value name="IF1"><block id="lDJ@;/jzBi=HTRV]yYn," type="logic_compare"><field name="OP">EQ</field>
                                        ! <value name="A"><block id="v]-iY2]3a;Ir}hU9sM" type="variables_get"><field name="VAR">tempCode</field></block></value>
                                        ! <value name="B"><block id="FXw/|._t2rtHCxgNR}N{" type="variables_get"><field name="VAR">CodeAnwesend</field></block></value></block></value>
                                        ! <statement name="DO1"><block id="l(HPe4p~ikj;pvhZJME," type="comment"><field name="COMMENT">Eingabe korrekt</field>
                                        ! <next><block id="U;M412@-[mW58w:2/pDZ" type="debug"><field name="Severity">log</field>
                                        ! <value name="TEXT"><shadow id="/6PKtIv;_asj~zH1YFWm" type="text"><field name="TEXT">*Abwesend aktivieren</field></shadow></value>
                                        ! <next><block id="JsF#tPrlP((e*D(PKz;" type="variables_set"><field name="VAR">AnzahlVersuche</field> ! <value name="VALUE"><block id="_#wsFg(JuzNqSyCO63UI" type="math_number"><field name="NUM">0</field></block></value></block></next></block></next></block></statement> ! <value name="IF2"><block id="2vFBpg|}LmWTUqhvSPq" type="logic_compare"><field name="OP">EQ</field>
                                        ! <value name="A"><block id="h{5A9tIJ[J}[xMy_7AAS" type="variables_get"><field name="VAR">tempCode</field></block></value>
                                        ! <value name="B"><block id="P@212xQ;qQPEGyj%ZrM" type="variables_get"><field name="VAR">CodeAbwesend</field></block></value></block></value>
                                        ! <statement name="DO2"><block id="I#o7zi#/?,2ybu:rbslY" type="comment"><field name="COMMENT">Eingabe korrekt</field>
                                        ! <next><block id="gbMt
                                        _LDG5GlZ=~5q;Cp" type="debug"><field name="Severity">log</field>
                                        ! <value name="TEXT"><shadow id="ZGUOVYnw5W!20VGJXQ};" type="text"><field name="TEXT">*Anwesend aktivieren</field></shadow></value>
                                        ! <next><block id="hK5#^tb~)E9Bgr
                                        GFnxt" type="variables_set"><field name="VAR">AnzahlVersuche</field>
                                        ! <value name="VALUE"><block id="kZ^Vqv6TF3HNE3Pral(2" type="math_number"><field name="NUM">0</field></block></value></block></next></block></next></block></statement>
                                        ! <next><block id=")]FG}!jqa@!^@C404zD" type="timeouts_settimeout"><field name="NAME">timeout</field>
                                        ! <field name="DELAY">5000</field>
                                        ! <field name="UNIT">ms</field>
                                        ! <statement name="STATEMENT"><block id="@87rub
                                        L(JD2dLo|Aef" type="comment"><field name="COMMENT">Wenn in 5 Sek. keine weitere Eingabe erfolgt</field> ! <next><block id="/6Z(,/]_}ZhyadfHIgZ5" type="comment"><field name="COMMENT">dann Eingabe löschen und Versuche hochzählen</field> ! <next><block id="a3yX(4)M(27nSsHd.d-_" type="variables_set"><field name="VAR">tempCode</field> ! <value name="VALUE"></value> ! <next><block id="Uqe6b9wNj]Sp(Zb#o#X" type="procedures_callnoreturn"><mutation name="chkVersuche"></mutation></block></next></block></next></block></next></block></statement></block></next></block></next></block></next></block></statement></block>
                                        ! <block id="c,ULx]X]~F-z^(
                                        +{6vr" type="procedures_defnoreturn" y="1612" x="-87"><field name="NAME">chkVersuche</field>
                                        ! <comment w="160" h="80" pinned="false">Fehlerhafte Eingaben zählen und Eingabe sperren wenn maxVersuche erreicht.</comment>
                                        ! <statement name="STACK"><block id="+bbjB}N7U3vkk:@%?[V" type="math_change"><field name="VAR">AnzahlVersuche</field> ! <value name="DELTA"><shadow id="P!Tq!OVi/*(ehXZb]uC8" type="math_number"><field name="NUM">1</field></shadow></value> ! <next><block id="V6AzqIh:%+F@oh[M-IQ{" type="controls_if"><value name="IF0"><block id="!CYyilZ1svbcZ]Yf=BXd" type="logic_compare"><field name="OP">EQ</field> ! <value name="A"><block id="@Zmti,3QUsDg5gTF6tjC" type="variables_get"><field name="VAR">AnzahlVersuche</field></block></value> ! <value name="B"><block id="x=cs)@yt;A6[ua*T5FE|" type="variables_get"><field name="VAR">maxVersuche</field></block></value></block></value> ! <statement name="DO0"><block id="[d~Z|qEH+C4%5%A*xBTT" type="debug"><field name="Severity">log</field> ! <value name="TEXT"><shadow id="v.9ViGY:H4?EbA+fzjKV" type="text"><field name="TEXT">*****Eingabe gesperrt*****</field></shadow></value> ! <next><block id="(l|4)g2/(/@5-swvVF@2" type="timeouts_settimeout"><field name="NAME">sperren</field> ! <field name="DELAY">10000</field> ! <field name="UNIT">ms</field> ! <statement name="STATEMENT"><block id="U22mj9gD,9P)FU@4%{K~" type="comment"><field name="COMMENT">Nach 10 Sek. wieder frei</field> ! <next><block id="d)*rJF_51+C|Z3NMW9N+" type="variables_set"><field name="VAR">AnzahlVersuche</field> ! <value name="VALUE"><block id="^)c6!p[y)V0zk(9oMl16" type="math_number"><field name="NUM">0</field></block></value> ! <next><block id="SOZMoZ)Os7:]]y=T3yE" type="debug"><field name="Severity">log</field>
                                        ! <value name="TEXT"><shadow id="5.ubt?0E+m)aiIY`J``U" type="text"><field name="TEXT">Eingabe entsperrt</field></shadow></value></block></next></block></next></block></statement></block></next></block></statement></block></next></block></statement></block></xml>
                                        Die Daten punkte habe ich auch drin.

                                        ! <xml 1999/xmlns="<URL url=" http:/www.w3.org/xhtml"="">http://www.w3.org/1999/xhtml">
                                        ! <block id="k45s-D}hiCCfW)QXQ13!" type="create" y="37" x="-312"><field name="NAME">Pincode_0</field>
                                        ! <statement name="STATEMENT"><block id="GzGNlOW@(Fd*)A1PQwP+" type="create"><field name="NAME">Pincode_1</field>
                                        ! <statement name="STATEMENT"><block id="{KMqqs^U6+Bqefj-e)_H" type="create"><field name="NAME">Pincode_2</field>
                                        ! <statement name="STATEMENT"><block id="Bh|7!TU)qCE)NLUQcUox" type="create"><field name="NAME">Pincode_3</field>
                                        ! <statement name="STATEMENT"><block id="BEQkl{Dy)uxW;O)Z1eU}" type="create"><field name="NAME">Pincode_4</field>
                                        ! <statement name="STATEMENT"><block id="-8S]ZFn8xy]AIG=ypi?V" type="create"><field name="NAME">Pincode_5</field>
                                        ! <statement name="STATEMENT"><block id="{e%@W;N!WN6)FFuzjGt%" type="create"><field name="NAME">Pincode_6</field>
                                        ! <statement name="STATEMENT"><block id="_H4%;yPLLJgS[UV9a0+s" type="create"><field name="NAME">Pincode_7</field>
                                        ! <statement name="STATEMENT"><block id="V5p68}x+,Ch!)qIu?ZlA" type="create"><field name="NAME">Pincode_8</field>
                                        ! <statement name="STATEMENT"><block id="e9Ue+P2Wa@=C|FOhYEX4" type="create"><field name="NAME">Pincode_9</field></block></statement></block></statement></block></statement></block></statement></block></statement></block></statement></block></statement></block></statement></block></statement></block></xml>
                                        Habe auch die Views schon angepasst.

                                        Wenn es an der Tür klingelt wird das Kamera VIEW geöffnet (siehe Bild)

                                        Danach möchte ich auf die Tür drücken….

                                        dann soll sich das Widget mit dem Nummer Pat öffnen.... (siehe Bild)

                                        nach Pin eingabe soll die Tür dann aufgehen.

                                        Ich glaube für einen Anfänger zu viel des Guten dadurch hoffe das du mir helfen kannst.
                                        4668_k640_unbenannt11.jpg
                                        4668_unbenannt12.png

                                        1 Reply Last reply Reply Quote 0
                                        • rantanplan
                                          rantanplan last edited by

                                          Das sieht sehr gut aus!

                                          In dem Beispiel gibt es zwei lokale Variablen.

                                          "CodeAbwesend" und "CodeAnwesend"

                                          Die waren dafür gedacht eine "Alarmanlage" scharf/unscharf zu schalten.

                                          In der Funktion "Initialisierung" wird der Code vorgegeben, den Du jederzeit ändern kannst.

                                          Aber bleiben wir erstmal bei der Vorgabe.

                                          Deine Eingabe über VIS wird in der Funktion "getCode" geprüft.

                                          Um jetzt keine neue lokale Variable anzulegen, nehmen wir die "CodeAbwesend".

                                          Also die Eingabenfolge "321"

                                          Wenn also 321 eingegeben wird soll sich Deine Tür öffnen.

                                          Dafür schaust Du in die Funktion "getCode".

                                          Dort setzt Du einen Baustein "steuere …." mit dem Datenpunkt Deines Türöffners.
                                          147_beispiel.png

                                          Ob das Blockly die Eingaben richtig nimmt kannst Du im LOG Reiter überprüfen.

                                          Dafür sind die "Debug-Bausteine"

                                          Wobei ich gerade sehen, dass ich die Ausgabe für "Anwesend" und "Abwesend" vertauscht habe. :oops:

                                          Hilft Dir das weiter?

                                          Grüße

                                          1 Reply Last reply Reply Quote 0
                                          • SmarthomeMF
                                            SmarthomeMF last edited by

                                            Hallo

                                            Habe das genau mal so gemacht wie beschrieben.

                                            Aber wenn ich das Script starte kommt in Log ein error!

                                            ! <xml 1999/xmlns="<URL url=" http:/www.w3.org/xhtml"="">http://www.w3.org/1999/xhtml">
                                            ! <block id=".M/Q%KRmxbXWc2P9~MO" type="comment" x="-87" y="162"><field name="COMMENT">Einmalige Initialisierung bei Programmstart</field>
                                            ! <next><block id="tjP%K@i{#i,h1Dyax-gY" type="procedures_callnoreturn"><mutation name="Initialisierung"></mutation>
                                            ! <next><block id="?bXfiCYH0h;wOsNVLQT1" type="comment"><field name="COMMENT">Hier beginnt das Triggern</field>
                                            ! <next><block id="Ox)}[Fr#C.VldaJS5L^k" type="comment"><field name="COMMENT">Beliebig erweiterbar</field>
                                            ! <next><block id="7r*}c).]GtkEH)FR.:s." type="on_ext"><mutation items="3"></mutation>
                                            ! <field name="CONDITION">true</field>
                                            ! <value name="OID0"><shadow id="qW*M98DOf90FmZ?BT;~" type="field_oid"><field name="oid">javascript.0.Pincode_1</field></shadow></value> ! <value name="OID1"><shadow id="db.g;R[uTi-M|khCqfC" type="field_oid"><field name="oid">javascript.0.Pincode_2</field></shadow></value>
                                            ! <value name="OID2"><shadow id="xXI+u{uUm0V4mOYK!n]j" type="field_oid"><field name="oid">javascript.0.Pincode_3</field></shadow></value>
                                            ! <statement name="STATEMENT"><block id="Yg;,[I7Ex=?rcz#y?kj%" type="comment"><field name="COMMENT">Timer für zu lange Eingabepause stoppen</field>
                                            ! <next><block id="#p8Sw}HSQK?cYiU:YHiK" type="timeouts_cleartimeout"><field name="NAME">timeout</field>
                                            ! <next><block id="?pNSp?WhqKPHT/B_pJo:" type="comment"><field name="COMMENT">Nur ausführen wenn Eingabe nicht geblockt</field>
                                            ! <next><block id="dn-O]h-kTj)k:Hx)Xkz" type="controls_if"><value name="IF0"><block id="aahnsRO!(k,8K;ftiGcN" type="logic_compare"><field name="OP">NEQ</field> ! <value name="A"><block id="~1[*:7k/oGI/ZT1ie-F5" type="variables_get"><field name="VAR">AnzahlVersuche</field></block></value> ! <value name="B"><block id="9EtqToNOpvma_:nUc:I3" type="variables_get"><field name="VAR">maxVersuche</field></block></value></block></value> ! <statement name="DO0"><block id="53won3Q~KRaZW)3F6
                                            [" type="controls_if"><mutation elseif="2"></mutation>
                                            ! <value name="IF0"><block id="=Vuh)csdD]A:f+;xaY0c" type="logic_compare"><field name="OP">EQ</field>
                                            ! <value name="A"><block id="73#D/?hW=+je)pXEOH]" type="get_value"><field name="ATTR">val</field>
                                            ! <field name="OID">javascript.0.Pincode_1</field></block></value>
                                            ! <value name="B"><block id="-nBqftYopC%u~4,0#S:J" type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value>
                                            ! <statement name="DO0"><block id="iDWo7Ppf@/PIDOC3,nQg" type="comment"><field name="COMMENT">Die Eingabe an Funktion übergeben</field>
                                            ! <next><block id="9ND8^RRRst6JTr1aF:P" type="procedures_callnoreturn" inline="true"><mutation name="getCode"><arg name="TastenWert"></arg></mutation>
                                            ! <value name="ARG0"><block id=";{hUhJ|FuWgRnG+Vx/" type="text"><field name="TEXT">1</field></block></value></block></next></block></statement>
                                            ! <value name="IF1"><block id="7OCP}UF3YaQ|gs=RDFy" type="logic_compare"><field name="OP">EQ</field> ! <value name="A"><block id="NHZ%eeYxhwr?#M_(BhP/" type="get_value"><field name="ATTR">val</field> ! <field name="OID">javascript.0.Pincode_2</field></block></value> ! <value name="B"><block id="*2NWW1B~r6Z2E}P%j2wg" type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value> ! <statement name="DO1"><block id="TUEyn}|x(z36g?T63y*_" type="procedures_callnoreturn" inline="true"><mutation name="getCode"><arg name="TastenWert"></arg></mutation> ! <value name="ARG0"><block id="]Rf6@?xK
                                            gplLyQ-bQP" type="text"><field name="TEXT">2</field></block></value></block></statement>
                                            ! <value name="IF2"><block id="8oUmv2o%~@wjdNn_2bB}" type="logic_compare"><field name="OP">EQ</field>
                                            ! <value name="A"><block id="D5^##Kxmy;bo1B=Nj_?" type="get_value"><field name="ATTR">val</field> ! <field name="OID">javascript.0.Pincode_3</field></block></value> ! <value name="B"><block id="=+FvloDpnlxoQhQt]biY" type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value> ! <statement name="DO2"><block id="?}Q)OGY}05Ms(#R@Kycz" type="procedures_callnoreturn" inline="true"><mutation name="getCode"><arg name="TastenWert"></arg></mutation> ! <value name="ARG0"><block id=";dy%FKdEuIq;eorrIp|h" type="text"><field name="TEXT">3</field></block></value></block></statement></block></statement></block></next></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block> ! <block id="O)q*?M8Hfa5)/}O6ZsZ7" type="procedures_defnoreturn" x="563" y="163"><field name="NAME">Initialisierung</field> ! <comment pinned="false" h="80" w="160">Bei Programmstart Werte vorgeben.</comment> ! <statement name="STACK"><block id="?L69j3%sRmc}([5G2X60" type="variables_set"><field name="VAR">AnzahlVersuche</field> ! <value name="VALUE"><block id="t]h/PX7feEalP-;RDq
                                            " type="math_number"><field name="NUM">0</field></block></value>
                                            ! <next><block id="wMeGQPHU)@|vwaJP%iqr" type="variables_set"><field name="VAR">tempCode</field>
                                            ! <value name="VALUE"></value>
                                            ! <next><block id="UZqDvMtW0LHk96L^T8z" type="comment"><field name="COMMENT">Maximale Fehlversuche festlegen</field>
                                            ! <next><block id="e663[k*hSCd%o
                                            ?sd(XA" type="variables_set"><field name="VAR">maxVersuche</field>
                                            ! <value name="VALUE"><block id="{OjuYXvX(;:=T.oag~a#" type="math_number"><field name="NUM">3</field></block></value>
                                            ! <next><block id="K(:;y-gihBx_:{%kJ~Oo" type="comment"><field name="COMMENT">Länge der Codes festlegen</field>
                                            ! <next><block id="BGt@+4h!d)Kco3]{,)V" type="variables_set"><field name="VAR">maxCodeLaenge</field> ! <value name="VALUE"><block id="|Wm^i:C~o0Bp7;,-yy" type="math_number"><field name="NUM">3</field></block></value> ! <next><block id="ZgOwwPRCnNLM~@tR?DhB" type="comment"><field name="COMMENT">Liste der Codes</field> ! <next><block id="Kp%9#vKhE4,}vS;@yW_0" type="comment"><field name="COMMENT">Beliebig erweiterbar. Auf Länge achten!</field> ! <next><block id=";~}[HtK6:wa8W/1,]j2a" type="variables_set"><field name="VAR">CodeAbwesend</field> ! <value name="VALUE"><block id="/%k9:KVHUC2RVgH.:^v5" type="text"><field name="TEXT">321</field></block></value> ! <next><block id="~g%5m:PVJO18)ZuFgT%Y" type="variables_set"><field name="VAR">CodeAnwesend</field> ! <value name="VALUE"><block id=";ut1,j-D,_I[Y-ibyD-" type="text"><field name="TEXT">123</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block>
                                            ! <block id="t@lDFN#V:FHO31zeMUSV" type="procedures_defnoreturn" x="-87" y="838"><mutation><arg name="TastenWert"></arg></mutation>
                                            ! <field name="NAME">getCode</field>
                                            ! <comment pinned="false" h="80" w="160">Code pruefen</comment>
                                            ! <statement name="STACK"><block id="@0sNv=W?MJzk622W]Q4" type="text_append"><field name="VAR">tempCode</field> ! <value name="TEXT"><shadow id="6q^nqw|R(+L0{n_l/Gc4" type="text"></shadow> ! <block id="LWMvwI0w|bcPvg-n5gGg" type="variables_get"><field name="VAR">TastenWert</field></block></value> ! <next><block id="vjr3FKb9Vi*y+77wJTx," type="debug"><field name="Severity">log</field> ! <value name="TEXT"><shadow id=".0O)AP~8_Z_^cA%~Y=0o" type="text"></shadow> ! <block id=")*fGp8U0U/F=Wcs;KY/|" type="text_join"><mutation items="2"></mutation> ! <value name="ADD0"><block id=").fVwr0of^0wi[*+UipI" type="text"><field name="TEXT">*****Eingabe -></field></block></value> ! <value name="ADD1"><block id="Cw9-Bo9Tle36/K]UpAeB" type="variables_get"><field name="VAR">tempCode</field></block></value></block></value> ! <next><block id="n5A{||l/F/:ozsHSOg4^" type="controls_if"><mutation elseif="2"></mutation> ! <value name="IF0"><block id="T=]omffKe6S+(UpU:6" type="logic_compare"><field name="OP">GT</field>
                                            ! <value name="A"><block id=";Xk,nZX;Io@ax2OT=s73" type="text_length"><value name="VALUE"><shadow id="RGYf*(-7S#_3L-Ww7];" type="text"><field name="TEXT">abc</field></shadow> ! <block id="gapi+DOc_=Fi})6b*l7}" type="variables_get"><field name="VAR">tempCode</field></block></value></block></value> ! <value name="B"><block id="j9RTTC,C]+Q)EY2SD}i" type="variables_get"><field name="VAR">maxCodeLaenge</field></block></value></block></value>
                                            ! <statement name="DO0"><block id="|Tgo8I~X04G[v8TB8v3" type="comment"><field name="COMMENT">Zuviele Eingaben</field> ! <next><block id="+lM8)EE*fCon1X0.Dw=" type="comment"><field name="COMMENT">Eingabe löschen und Versuche hochzählen</field>
                                            ! <next><block id="sRw2Xy,4}LO3T4q.5yM" type="debug"><field name="Severity">log</field>
                                            ! <value name="TEXT"><shadow id="+cYZRRJa1z=6hGhTLdam" type="text"><field name="TEXT">Zuviele Zeichen</field></shadow></value>
                                            ! <next><block id="%D8buHC|kCUU1/KVJB[2" type="variables_set"><field name="VAR">tempCode</field>
                                            ! <value name="VALUE"></value>
                                            ! <next><block id="T/]?rq:p![ebfuT~k+i/" type="procedures_callnoreturn"><mutation name="chkVersuche"></mutation></block></next></block></next></block></next></block></next></block></statement>
                                            ! <value name="IF1"><block id="lDJ@;/jzBi=HTRV]yYn," type="logic_compare"><field name="OP">EQ</field>
                                            ! <value name="A"><block id="v]-iY2]3a;Ir}hU9sM" type="variables_get"><field name="VAR">tempCode</field></block></value>
                                            ! <value name="B"><block id="FXw/|._t2rtHCxgNR}N{" type="variables_get"><field name="VAR">CodeAnwesend</field></block></value></block></value>
                                            ! <statement name="DO1"><block id="l(HPe4p~ikj;pvhZJME," type="comment"><field name="COMMENT">Eingabe korrekt</field>
                                            ! <next><block id="r36-dG%vP|-NxY(}BSJe" type="comment"><field name="COMMENT">zu Testzwecke eine Lampe</field>
                                            ! <next><block id="w+5Ue0Hm9)4.e]{AO?{N" type="control"><mutation delay_input="false"></mutation>
                                            ! <field name="OID">hue.0.Philips_hue.Hue_Deckenlampe_Büro_EG.on</field>
                                            ! <field name="WITH_DELAY">FALSE</field>
                                            ! <next><block id="U;M412@-[mW58w:2/pDZ" type="debug"><field name="Severity">log</field>
                                            ! <value name="TEXT"><shadow id="/6PKtIv;_asj~zH1YFWm" type="text"><field name="TEXT">*Anwesen aktivieren</field></shadow></value>
                                            ! <next><block id="JsF#tPrlP((e*D(PKz;" type="variables_set"><field name="VAR">AnzahlVersuche</field> ! <value name="VALUE"><block id="_#wsFg(JuzNqSyCO63UI" type="math_number"><field name="NUM">0</field></block></value></block></next></block></next></block></next></block></next></block></statement> ! <value name="IF2"><block id="2vFBpg|}LmWTUqhvSPq" type="logic_compare"><field name="OP">EQ</field>
                                            ! <value name="A"><block id="h{5A9tIJ[J}[xMy_7AAS" type="variables_get"><field name="VAR">tempCode</field></block></value>
                                            ! <value name="B"><block id="P@212xQ;qQPEGyj%ZrM" type="variables_get"><field name="VAR">CodeAbwesend</field></block></value></block></value>
                                            ! <statement name="DO2"><block id="I#o7zi#/?,2ybu:rbslY" type="comment"><field name="COMMENT">Eingabe korrekt</field>
                                            ! <next><block id="gbMt
                                            _LDG5GlZ=~5q;Cp" type="debug"><field name="Severity">log</field>
                                            ! <value name="TEXT"><shadow id="ZGUOVYnw5W!20VGJXQ};" type="text"><field name="TEXT">*Abwesend aktivieren</field></shadow></value>
                                            ! <next><block id="hK5#^tb~)E9Bgr
                                            GFnxt" type="variables_set"><field name="VAR">AnzahlVersuche</field>
                                            ! <value name="VALUE"><block id="kZ^Vqv6TF3HNE3Pral(2" type="math_number"><field name="NUM">0</field></block></value></block></next></block></next></block></statement>
                                            ! <next><block id=")]FG}!jqa@!^@C404zD" type="timeouts_settimeout"><field name="NAME">timeout</field>
                                            ! <field name="DELAY">5000</field>
                                            ! <field name="UNIT">ms</field>
                                            ! <statement name="STATEMENT"><block id="@87rub
                                            L(JD2dLo|Aef" type="comment"><field name="COMMENT">Wenn in 5 Sek. keine weitere Eingabe erfolgt</field> ! <next><block id="/6Z(,/]_}ZhyadfHIgZ5" type="comment"><field name="COMMENT">dann Eingabe löschen und Versuche hochzählen</field> ! <next><block id="a3yX(4)M(27nSsHd.d-_" type="variables_set"><field name="VAR">tempCode</field> ! <value name="VALUE"></value> ! <next><block id="Uqe6b9wNj]Sp(Zb#o#X" type="procedures_callnoreturn"><mutation name="chkVersuche"></mutation></block></next></block></next></block></next></block></statement></block></next></block></next></block></next></block></statement></block>
                                            ! <block id="c,ULx]X]~F-z^(
                                            +{6vr" type="procedures_defnoreturn" x="-62" y="1763"><field name="NAME">chkVersuche</field>
                                            ! <comment pinned="false" h="80" w="160">Fehlerhafte Eingaben zählen und Eingabe sperren wenn maxVersuche erreicht.</comment>
                                            ! <statement name="STACK"><block id="+bbjB}N7U3vkk:@%?[V" type="math_change"><field name="VAR">AnzahlVersuche</field> ! <value name="DELTA"><shadow id="P!Tq!OVi/*(ehXZb]uC8" type="math_number"><field name="NUM">1</field></shadow></value> ! <next><block id="V6AzqIh:%+F@oh[M-IQ{" type="controls_if"><value name="IF0"><block id="!CYyilZ1svbcZ]Yf=BXd" type="logic_compare"><field name="OP">EQ</field> ! <value name="A"><block id="@Zmti,3QUsDg5gTF6tjC" type="variables_get"><field name="VAR">AnzahlVersuche</field></block></value> ! <value name="B"><block id="x=cs)@yt;A6[ua*T5FE|" type="variables_get"><field name="VAR">maxVersuche</field></block></value></block></value> ! <statement name="DO0"><block id="[d~Z|qEH+C4%5%A*xBTT" type="debug"><field name="Severity">log</field> ! <value name="TEXT"><shadow id="v.9ViGY:H4?EbA+fzjKV" type="text"><field name="TEXT">*****Eingabe gesperrt*****</field></shadow></value> ! <next><block id="(l|4)g2/(/@5-swvVF@2" type="timeouts_settimeout"><field name="NAME">sperren</field> ! <field name="DELAY">10000</field> ! <field name="UNIT">ms</field> ! <statement name="STATEMENT"><block id="U22mj9gD,9P)FU@4%{K~" type="comment"><field name="COMMENT">Nach 10 Sek. wieder frei</field> ! <next><block id="d)*rJF_51+C|Z3NMW9N+" type="variables_set"><field name="VAR">AnzahlVersuche</field> ! <value name="VALUE"><block id="^)c6!p[y)V0zk(9oMl16" type="math_number"><field name="NUM">0</field></block></value> ! <next><block id="SOZMoZ)Os7:]]y=T3yE" type="debug"><field name="Severity">log</field>
                                            ! <value name="TEXT"><shadow id="5.ubt?0E+m)aiIY`J``U" type="text"><field name="TEXT">Eingabe entsperrt</field></shadow></value></block></next></block></next></block></statement></block></next></block></statement></block></next></block></statement></block></xml>
                                            was habe ich übersehen?

                                            Habe die Datenpunkte alle angelegt und mit den Tastern eingebunden….

                                            eine Lampe zum Ansteuern habe ich im Blockly auch hinzugefügt...
                                            4668_unbenannt13.png
                                            4668_unbenannt14.png

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            647
                                            Online

                                            31.6k
                                            Users

                                            79.5k
                                            Topics

                                            1.3m
                                            Posts

                                            blockly template
                                            16
                                            72
                                            14504
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo