Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. rantanplan

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Profile
    • Following 0
    • Followers 3
    • Topics 37
    • Posts 1918
    • Best 66
    • Groups 3

    rantanplan

    @rantanplan

    106
    Reputation
    302
    Profile views
    1918
    Posts
    3
    Followers
    0
    Following
    Joined Last Online

    rantanplan Follow
    Pro Starter Most Active

    Best posts made by rantanplan

    • [Vorlage] Blockly - Beliebiges Zeichen im Text tauschen

      Hallo

      Manchmal ist es notwendig unliebsame Zeichen aus einem Text zu entfernen um diese z.B. in VIS vernünftig darstellen zu können.
      Mit dem folgenden Blockly kann man jedes Zeichen, ganze Wörter oder eine Folge von Steuerzeichen gegen etwas anderes tauschen.

      Der von @robson gefundene Bug wurde behoben.

      Zeichentausch.png

      Hier der geänderte Export:

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id="xSVSX?qYBxERx4)1(5:3">originalText</variable>
          <variable id=";bO,k;{f-t4YW^V4Yaby">suchText</variable>
          <variable id="=KxFmb,!C-6!HK%6iSz4">tauschText</variable>
          <variable id="pF_ac~cY~|C(S.I!U%Uu">MeinText</variable>
          <variable id="Uf:U=$(.HDJ72/VPr1!o">Teil_1</variable>
          <variable id="P8$b81v9fsrHHrb+z]g1">Text</variable>
          <variable id="g[0H+Z8J_%|p]v;tR.p.">Teil_2</variable>
          <variable id="I;i^c)UORMgY^LOatF[8">neuerText</variable>
          <variable id="6,6h67!#*?Hh,1(Sy,@u">AnzZeichenSuchtext</variable>
          <variable id="(NMF97xgk;{xp~AH$Ln*">Stelle</variable>
        </variables>
        <block type="comment" id="?t^|J^}%io+OnqAwVT4A" x="-237" y="-87">
          <field name="COMMENT">Beliebige Zeichen tauschen</field>
          <next>
            <block type="variables_set" id="-P{_[1=caHEAoB9cP4Qx">
              <field name="VAR" id="pF_ac~cY~|C(S.I!U%Uu">MeinText</field>
              <value name="VALUE">
                <block type="text" id="]-v|)OoSpw-K*Z-|~Z|L">
                  <field name="TEXT">Dieser Text müßte geändert werden.</field>
                </block>
              </value>
              <next>
                <block type="controls_if" id="eO-Yu;zv=:r~yJNHR:iS">
                  <value name="IF0">
                    <block type="logic_negate" id="u@28{:]xG=4a9HU}|/v)">
                      <value name="BOOL">
                        <block type="text_isEmpty" id="W-_T.2)lUsLG/Z(5zIQN">
                          <value name="VALUE">
                            <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="9LrDM?0xYv?MX-(}2OrI">
                              <field name="TEXT"></field>
                            </shadow>
                            <block type="variables_get" id="B?L(8|(8?-Z7Ao*[F/VM">
                              <field name="VAR" id="pF_ac~cY~|C(S.I!U%Uu">MeinText</field>
                            </block>
                          </value>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="variables_set" id="ziw)~y|7*7le5/J*8HC#">
                      <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                      <value name="VALUE">
                        <block type="procedures_callreturn" id="ECH/%?YEFylSUOK._8/K">
                          <mutation name="changeText">
                            <arg name="originalText"></arg>
                            <arg name="suchText"></arg>
                            <arg name="tauschText"></arg>
                          </mutation>
                          <value name="ARG0">
                            <block type="variables_get" id="Y(bM=~D[D5v)7a#1{`}`">
                              <field name="VAR" id="pF_ac~cY~|C(S.I!U%Uu">MeinText</field>
                            </block>
                          </value>
                          <value name="ARG1">
                            <block type="text" id="(iqf|@QE;6:tP0}rbaEj">
                              <field name="TEXT">ü</field>
                            </block>
                          </value>
                          <value name="ARG2">
                            <block type="text" id="_{HiLh|2|F3|a#[4lCvX">
                              <field name="TEXT">ue</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <next>
                        <block type="variables_set" id="`vGUP!R!*|3sjY~dZXxZ">
                          <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                          <value name="VALUE">
                            <block type="procedures_callreturn" id="rvKR.cz9FhImw~YT8:YY">
                              <mutation name="changeText">
                                <arg name="originalText"></arg>
                                <arg name="suchText"></arg>
                                <arg name="tauschText"></arg>
                              </mutation>
                              <value name="ARG0">
                                <block type="variables_get" id="4r-=T6yu%Y[}Zn!QhpR/">
                                  <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                </block>
                              </value>
                              <value name="ARG1">
                                <block type="text" id="mbk@+N`6F_eG)N%Jw|2J">
                                  <field name="TEXT">ä</field>
                                </block>
                              </value>
                              <value name="ARG2">
                                <block type="text" id="OtGH;LSHf;*t,59fJ)5i">
                                  <field name="TEXT">ae</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <next>
                            <block type="variables_set" id="3+|QU5[xS;U@Qijfuu@7">
                              <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                              <value name="VALUE">
                                <block type="procedures_callreturn" id="~C~TrH*=xX3Xl-l@tg#V">
                                  <mutation name="changeText">
                                    <arg name="originalText"></arg>
                                    <arg name="suchText"></arg>
                                    <arg name="tauschText"></arg>
                                  </mutation>
                                  <value name="ARG0">
                                    <block type="variables_get" id=",eH?bND1?H}TimRX_wnz">
                                      <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                    </block>
                                  </value>
                                  <value name="ARG1">
                                    <block type="text" id="6AWuk;A#5~8;jXas31)I">
                                      <field name="TEXT">ß</field>
                                    </block>
                                  </value>
                                  <value name="ARG2">
                                    <block type="text" id="[M[ZL8Y,u8fNWw|eR|g)">
                                      <field name="TEXT">ss</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <next>
                                <block type="debug" id="g8IUrYe_.rei!S6]Mc?a">
                                  <field name="Severity">log</field>
                                  <value name="TEXT">
                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="d7HPm]yEeu9+?9HT0u|l">
                                      <field name="TEXT"></field>
                                    </shadow>
                                    <block type="variables_get" id="^/WzSct]9kWQNOvtqOg/">
                                      <field name="VAR" id="pF_ac~cY~|C(S.I!U%Uu">MeinText</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="debug" id="Hme!w3Ag?_DUH%uRzR)U">
                                      <field name="Severity">log</field>
                                      <value name="TEXT">
                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="d7HPm]yEeu9+?9HT0u|l">
                                          <field name="TEXT"></field>
                                        </shadow>
                                        <block type="variables_get" id="`v3q2Xw=qC`r6)o/kUEY">
                                          <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                        </block>
                                      </value>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </statement>
                </block>
              </next>
            </block>
          </next>
        </block>
        <block type="procedures_defreturn" id="*?%n[KG5e1!^tNun#Hj5" x="288" y="-87">
          <mutation>
            <arg name="originalText" varid="xSVSX?qYBxERx4)1(5:3"></arg>
            <arg name="suchText" varid=";bO,k;{f-t4YW^V4Yaby"></arg>
            <arg name="tauschText" varid="=KxFmb,!C-6!HK%6iSz4"></arg>
          </mutation>
          <field name="NAME">changeText</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="variables_set" id=",*Bi*dYY8!8mI7(mg9V.">
              <field name="VAR" id="Uf:U=$(.HDJ72/VPr1!o">Teil_1</field>
              <value name="VALUE">
                <block type="text" id="|BZm+^ZNZWW}2Oo#`j;?">
                  <field name="TEXT"></field>
                </block>
              </value>
              <next>
                <block type="variables_set" id="w]M[kO6!;:DS!~0O}SHV">
                  <field name="VAR" id="g[0H+Z8J_%|p]v;tR.p.">Teil_2</field>
                  <value name="VALUE">
                    <block type="text" id="LK!;|?K5!yeQYlUax(!P">
                      <field name="TEXT"></field>
                    </block>
                  </value>
                  <next>
                    <block type="variables_set" id="LyZ2%lYW+kfm,4)yV8UN">
                      <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                      <value name="VALUE">
                        <block type="variables_get" id="da5*p]}sO:{{|ZE!nhDe">
                          <field name="VAR" id="xSVSX?qYBxERx4)1(5:3">originalText</field>
                        </block>
                      </value>
                      <next>
                        <block type="variables_set" id="yx;qp1@1fC(oiG4c5gZt">
                          <field name="VAR" id="6,6h67!#*?Hh,1(Sy,@u">AnzZeichenSuchtext</field>
                          <value name="VALUE">
                            <block type="text_length" id="Jwz33ARDLc!=8:eDagDD">
                              <value name="VALUE">
                                <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="RZWm!~Yo4w5)66Gu|Gs_">
                                  <field name="TEXT">abc</field>
                                </shadow>
                                <block type="variables_get" id="G2I+np)5qee]q{4)BlN2">
                                  <field name="VAR" id=";bO,k;{f-t4YW^V4Yaby">suchText</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <next>
                            <block type="variables_set" id="eAGK[85W)DRaIaN!oMiH">
                              <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                              <value name="VALUE">
                                <block type="text_indexOf" id="/@rj}{;VUCJ8O|28^(Hf">
                                  <field name="END">FIRST</field>
                                  <value name="VALUE">
                                    <block type="variables_get" id="}de%ffO*rIt%j6)99pf3">
                                      <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                    </block>
                                  </value>
                                  <value name="FIND">
                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="7MprEQxoWq}#3~Xz:32k">
                                      <field name="TEXT">%0D%0A</field>
                                    </shadow>
                                    <block type="variables_get" id="7)r.X1a~Tee1!dAwZy`!">
                                      <field name="VAR" id=";bO,k;{f-t4YW^V4Yaby">suchText</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <next>
                                <block type="controls_whileUntil" id="4lR}{f])DWKyjt}.(6cc">
                                  <field name="MODE">WHILE</field>
                                  <value name="BOOL">
                                    <block type="logic_compare" id="e`eUWK6kyOU=[/x]M({`">
                                      <field name="OP">GT</field>
                                      <value name="A">
                                        <block type="variables_get" id="}7HLWRwI(SDg1^@=czoV">
                                          <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <block type="math_number" id="#y,za{r#@s7Ri.U!9v)A">
                                          <field name="NUM">0</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <statement name="DO">
                                    <block type="comment" id="38%#2?@btrH6%hebNg3_">
                                      <field name="COMMENT">Wenn nicht erste Zeichen im Text!</field>
                                      <next>
                                        <block type="controls_if" id="R]}Pl(*eeA:Dh@;{q_CH">
                                          <value name="IF0">
                                            <block type="logic_compare" id="l,u?h{)Z-u/OozI,.79G">
                                              <field name="OP">GT</field>
                                              <value name="A">
                                                <block type="variables_get" id="B/K~z.ANK2);I3(uk4Bh">
                                                  <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="math_number" id="|3~K:6jrHq7oxz=fL:Yz">
                                                  <field name="NUM">1</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <statement name="DO0">
                                            <block type="variables_set" id="{R*X,7K)DA^dq/.~KK7{">
                                              <field name="VAR" id="Uf:U=$(.HDJ72/VPr1!o">Teil_1</field>
                                              <value name="VALUE">
                                                <block type="text_getSubstring" id="Img0opt.EB#)RM-bp~hw">
                                                  <mutation at1="false" at2="true"></mutation>
                                                  <field name="WHERE1">FIRST</field>
                                                  <field name="WHERE2">FROM_START</field>
                                                  <value name="STRING">
                                                    <block type="variables_get" id="A9h*F{tgJR0y[Q0uv7,=">
                                                      <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                    </block>
                                                  </value>
                                                  <value name="AT2">
                                                    <block type="math_arithmetic" id="([5R[:8Ywn-thKN@r:~}">
                                                      <field name="OP">MINUS</field>
                                                      <value name="A">
                                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="u@:!j5WimCjV%fG9hPGs">
                                                          <field name="NUM">1</field>
                                                        </shadow>
                                                        <block type="variables_get" id="U0qw,~,2KoaAc37UO{l#">
                                                          <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                        </block>
                                                      </value>
                                                      <value name="B">
                                                        <shadow type="math_number" id="DT#zRSRu1.y^|5Z#G37W">
                                                          <field name="NUM">1</field>
                                                        </shadow>
                                                      </value>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                            </block>
                                          </statement>
                                          <next>
                                            <block type="variables_set" id="Else^,?QE9TTS.Y%K]W=">
                                              <field name="VAR" id="g[0H+Z8J_%|p]v;tR.p.">Teil_2</field>
                                              <value name="VALUE">
                                                <block type="text_getSubstring" id="e8A7NqY7O!@K(aFlMpV#" inline="false">
                                                  <mutation at1="true" at2="false"></mutation>
                                                  <field name="WHERE1">FROM_START</field>
                                                  <field name="WHERE2">LAST</field>
                                                  <value name="STRING">
                                                    <block type="variables_get" id="|jU0g8+eIgwn_|IB56)@">
                                                      <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                    </block>
                                                  </value>
                                                  <value name="AT1">
                                                    <block type="math_arithmetic" id="F#*%;R9ugmwaaas?WBwG">
                                                      <field name="OP">ADD</field>
                                                      <value name="A">
                                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="8/I%=/~YReHV]Iwo{}(J">
                                                          <field name="NUM">1</field>
                                                        </shadow>
                                                        <block type="variables_get" id="R0|a}kx2M~SYjPKS5Cc{">
                                                          <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                        </block>
                                                      </value>
                                                      <value name="B">
                                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id=";Q(aJ::90?0?H;-45cgS">
                                                          <field name="NUM">0</field>
                                                        </shadow>
                                                        <block type="variables_get" id="dY33=1IVxkrSH1k1#X6A">
                                                          <field name="VAR" id="6,6h67!#*?Hh,1(Sy,@u">AnzZeichenSuchtext</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="variables_set" id="OcJS!-Ku1vQY4)I+r,gc">
                                                  <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                  <value name="VALUE">
                                                    <block type="text_join" id="%%D@nUqB1tt^`?qrUahx">
                                                      <mutation items="3"></mutation>
                                                      <value name="ADD0">
                                                        <block type="variables_get" id="q]l%0Dpb89BZy1-m[TjM">
                                                          <field name="VAR" id="Uf:U=$(.HDJ72/VPr1!o">Teil_1</field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD1">
                                                        <block type="variables_get" id="f~POFU0}K4-w]xVc1?,`">
                                                          <field name="VAR" id="=KxFmb,!C-6!HK%6iSz4">tauschText</field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD2">
                                                        <block type="variables_get" id="U77~u,Qfmb2g[O19eHoh">
                                                          <field name="VAR" id="g[0H+Z8J_%|p]v;tR.p.">Teil_2</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="variables_set" id="lao?KUxF77Si~Xc2j%^{">
                                                      <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                      <value name="VALUE">
                                                        <block type="text_indexOf" id="[),PN,ZrAW,C/~:K[x[:">
                                                          <field name="END">FIRST</field>
                                                          <value name="VALUE">
                                                            <block type="variables_get" id="6{t:BeVh6=bsQF(zUhYG">
                                                              <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                            </block>
                                                          </value>
                                                          <value name="FIND">
                                                            <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="{Vd/Su8uk@lo|:3KMi1L">
                                                              <field name="TEXT">%0D%0A</field>
                                                            </shadow>
                                                            <block type="variables_get" id="r|~fKkGR#@1@G6_GX`-g">
                                                              <field name="VAR" id=";bO,k;{f-t4YW^V4Yaby">suchText</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </statement>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
          <value name="RETURN">
            <block type="variables_get" id=".*DA-:q/GzURSEPH2ZiQ">
              <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
            </block>
          </value>
        </block>
      </xml>
      

      Bei Fragen, fragen.

      Grüße

      posted in Blockly
      rantanplan
      rantanplan
    • RE: Wunschliste Blockly-Elemente

      @darkiop sagte in Wunschliste Blockly-Elemente:

      Zum Thema von oben, Zielgruppe für Blockly: Ja die Hauptzielgruppe ist sicher der Anwender der nicht Programmieren kann. Aber auch der fortgeschrittene nutzt sicher an der ein oder anderen Stelle Blockly. Ich finde es für SmartHome Themen sehr nützlich mit Blockly zu arbeiten.

      Aus Anfängern werden machmal Fortgeschrittene. Und die Begehrlichkeiten wachsen ziemlich schnell. Da sollte Blockly keine Einbahnstrasse sein.
      Den Spruch "na dann sollen die doch JS lernen" finde ich immer sehr unangebracht und weltfremd.

      Blockly sollte/muss erweitert werden, aber immer mit dem Hintergrund, das es Blockly ist.

      posted in Entwicklung
      rantanplan
      rantanplan
    • [VORLAGE] Blockly Meldung wenn Waschmaschine fertig

      Hallo

      Das Thema wurde in einem anderen Thread behandelt. Das Ergebnis hier mal als Vorlage.

      Es wird ein Datenpunkt "WaschmaschineAN" benötigt. (wird vom Script generiert)

      Vier Dinge müssen für die eigene Waschmaschine angepasst werden.

      1. GrenzWertInWatt
      Wird der dort eingetragene Wert überschritten, startet der Waschvorgang und die Meldung "Waschmaschine LÄUFT" wird abgesetzt. Wird der Wert unterschritten, (Waschmaschine geht in den StandBy Modus) wird die Meldung "Waschmaschine FERTIG" abgesetzt.

      2. Einschaltverzögerung
      Dieser Wert ist nur wichtig, wenn man die Steckdose EINSCHALTET.
      Wenn die Waschmaschine also von 0 Watt eingeschaltet wird!
      Einige Maschinen durchlaufen dann eine Initialisierung, wobei die Watt-Zahl mehrere Sprünge machen kann.
      Nach der Initialisierung gehen die Maschinen in den StandBy Modus.
      Dieses Watt Chaos wird mit der "Einschaltverzögerung" übergangen.
      In dem Beispiel sind es 20 Sek..
      Dauert die Initialisierung länger, muss dieser Wert angepasst werden.
      Bleibt die Waschmaschine aber immer auf StandBy, wird also NICHT ausgeschaltet, ist hier KEINE Änderung notwendig!

      3. timeout
      Waschmaschinen durchlaufen meist mehrere Programme.
      Zwischen den Programmwechsel kann es schon mal sein, dass der "GrenzWertInWatt" unterschritten wird, obwohl der Waschgang noch nicht fertig ist. Dafür wird ein Timeout von 40 Sek. gestartet.
      Erst wenn nach den 40 Sek. der "GrenzWertInWatt" immer noch unterschritten ist, wird "WaschmaschineAN" auf "unwahr" gesetzt und die Fertigmeldung verschickt.
      Dauert das bei Eurer Maschine länger, muss der "timeout" angepasst werden.

      4. In die Funktion "Melden" den gewünschten "SendTo" Baustein einsetzen.

      Forum_Waschmaschine_B1.png
      Forum_Waschmaschine_B2.png
      Forum_Waschmaschine_B3.png

      Export:

      <xml xmlns="http://www.w3.org/1999/xhtml">
        <block type="create" id=":XvakORUFJ^_I1/^;0qD" x="13" y="13">
          <field name="NAME">WaschmaschineAN</field>
          <next>
            <block type="comment" id="@`s,ARMz+*DZ*ns;z2m_">
              <field name="COMMENT">Initialisierung bei Scriptstart</field>
              <next>
                <block type="comment" id="Ov|lJMd@PV!y.oUN9Boj">
                  <field name="COMMENT">VerzögerungAktiv NICHT ändern</field>
                  <next>
                    <block type="variables_set" id="T+;|Db@bx|T]wkX[e.xT">
                      <field name="VAR">VerzoegerungAktiv</field>
                      <value name="VALUE">
                        <block type="logic_boolean" id="FimMeG{k6LBu0{7UjBJ4">
                          <field name="BOOL">FALSE</field>
                        </block>
                      </value>
                      <next>
                        <block type="comment" id="6q4+KcF6/q*eh;RCmGKL">
                          <field name="COMMENT">Entscheidungswert festlegen</field>
                          <next>
                            <block type="variables_set" id="pE;t15K()B2=@=,RY5D_">
                              <field name="VAR">GrenzWertInWatt</field>
                              <value name="VALUE">
                                <block type="math_number" id="OB=)nO2pXH:1HNwm(JpG">
                                  <field name="NUM">4</field>
                                </block>
                              </value>
                              <next>
                                <block type="comment" id="|2tm%?,yK/o3_AA)J{ah">
                                  <field name="COMMENT">Steckdose überwachen</field>
                                  <next>
                                    <block type="on_ext" id="n)UklDS{=z!-#^HfL@Ly">
                                      <mutation items="1"></mutation>
                                      <field name="CONDITION">ne</field>
                                      <field name="ACK_CONDITION"></field>
                                      <value name="OID0">
                                        <shadow type="field_oid" id="@Uda~stBc8L/=2DFzrvo">
                                          <field name="oid">hm-rpc.0.LEQ0661170.2.POWER</field>
                                        </shadow>
                                      </value>
                                      <statement name="STATEMENT">
                                        <block type="controls_if" id="=n/Jfc]x(Ib[NRPJZ%7X">
                                          <value name="IF0">
                                            <block type="logic_compare" id="?m1STicTe5=N-/f:Ji2s">
                                              <field name="OP">EQ</field>
                                              <value name="A">
                                                <block type="on_source" id="QjKQBx`PdHENcy)eGM,5">
                                                  <field name="ATTR">oldState.val</field>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="math_number" id=":(p2PWPzD2(~R-q9upeS">
                                                  <field name="NUM">0</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <statement name="DO0">
                                            <block type="comment" id=";%e=m5A.5_U8[v[Odt7.">
                                              <field name="COMMENT">Dieser Teil wird NUR ausgeführt wenn</field>
                                              <next>
                                                <block type="comment" id="Bv,r2iN_4zSfF_^X35gM">
                                                  <field name="COMMENT">Funkstecker oder Waschm. komplett aus war.</field>
                                                  <next>
                                                    <block type="variables_set" id="xuK#29.xYf)m6FX5LA78">
                                                      <field name="VAR">VerzoegerungAktiv</field>
                                                      <value name="VALUE">
                                                        <block type="logic_boolean" id=")}Jh9zUdflaLNnL+;^h=">
                                                          <field name="BOOL">TRUE</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="debug" id="Wv*jiP9Bn3#//0KE[4e[">
                                                          <field name="Severity">log</field>
                                                          <value name="TEXT">
                                                            <shadow type="text" id="!hyL_SIc#q!nV1G.NU,/">
                                                              <field name="TEXT">***Starte Verzögerung</field>
                                                            </shadow>
                                                          </value>
                                                          <next>
                                                            <block type="timeouts_settimeout" id="v[ws-ZxN:-nNl,kERlT8">
                                                              <field name="NAME">Einschaltverzoegerung</field>
                                                              <field name="DELAY">20</field>
                                                              <field name="UNIT">sec</field>
                                                              <statement name="STATEMENT">
                                                                <block type="comment" id="UyUTD{W;Ef;u2!)%y5h|">
                                                                  <field name="COMMENT">Eventuell hohe Einschaltspannung abfangen.</field>
                                                                  <next>
                                                                    <block type="comment" id="^wiM;VZ*5RLS-+SMsG7?">
                                                                      <field name="COMMENT">Diese kann größer als der Grenzwert sein</field>
                                                                      <next>
                                                                        <block type="variables_set" id="@d2;tEWydly|fW:ng;eg">
                                                                          <field name="VAR">VerzoegerungAktiv</field>
                                                                          <value name="VALUE">
                                                                            <block type="logic_boolean" id="S5R1RMtIKx(=N;}|dM%Z">
                                                                              <field name="BOOL">FALSE</field>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="debug" id="1^,/eLLAT{#66hqVIel8">
                                                                              <field name="Severity">log</field>
                                                                              <value name="TEXT">
                                                                                <shadow type="text" id="[koH26;mOP0UeXV~CJRb">
                                                                                  <field name="TEXT">***Beende Verzögerung</field>
                                                                                </shadow>
                                                                              </value>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </statement>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </statement>
                                          <next>
                                            <block type="comment" id="EZK4(UY%`}HZl{2F)m6p">
                                              <field name="COMMENT">Ab hier wird gewaschen</field>
                                              <next>
                                                <block type="controls_if" id="S(-Xvr1uja6/vNdH|?j:">
                                                  <mutation elseif="2"></mutation>
                                                  <value name="IF0">
                                                    <block type="logic_operation" id="s(;r=_ekdU*dF=_Tsrbb" inline="false">
                                                      <field name="OP">AND</field>
                                                      <value name="A">
                                                        <block type="logic_compare" id="d_lZY_VlNaa40/Pob=Um">
                                                          <field name="OP">GT</field>
                                                          <value name="A">
                                                            <block type="on_source" id="`c4GU.`+o2_G+Vdxq;n/">
                                                              <field name="ATTR">state.val</field>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <block type="variables_get" id="FD[JnQcwajuYLgGmTX`.">
                                                              <field name="VAR">GrenzWertInWatt</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <value name="B">
                                                        <block type="logic_operation" id="*Y`H0qa!`fsBeI/2Cv+c" inline="false">
                                                          <field name="OP">AND</field>
                                                          <value name="A">
                                                            <block type="logic_compare" id="zC,(}TPXAvX2yd^k`W._">
                                                              <field name="OP">EQ</field>
                                                              <value name="A">
                                                                <block type="get_value" id=";a;[[bw/v2oQnG9DHZIn">
                                                                  <field name="ATTR">val</field>
                                                                  <field name="OID">javascript.0.WaschmaschineAN</field>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <block type="logic_boolean" id=";a5=vVD`86hstjR{4y~+">
                                                                  <field name="BOOL">FALSE</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <block type="logic_compare" id="K.3M9Le`+STB!.M_eD7O">
                                                              <field name="OP">EQ</field>
                                                              <value name="A">
                                                                <block type="variables_get" id="[!KuvI83Wzp*sDDNM{S!">
                                                                  <field name="VAR">VerzoegerungAktiv</field>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <block type="logic_boolean" id="9_[X?aI?X1w]lj.RY`K^">
                                                                  <field name="BOOL">FALSE</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <statement name="DO0">
                                                    <block type="control" id="S6URE:3#}}.v#e!X.A4D">
                                                      <mutation delay_input="false"></mutation>
                                                      <field name="OID">javascript.0.WaschmaschineAN</field>
                                                      <field name="WITH_DELAY">FALSE</field>
                                                      <value name="VALUE">
                                                        <block type="logic_boolean" id="QqpwRU?xP?P=bvS9HS[1">
                                                          <field name="BOOL">TRUE</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="procedures_callnoreturn" id="=!*WIp};Ta`)XeMMk,iR">
                                                          <mutation name="Melden">
                                                            <arg name="Meldetext"></arg>
                                                          </mutation>
                                                          <value name="ARG0">
                                                            <block type="text" id="{QcAY3oi:,FGG.929?TS">
                                                              <field name="TEXT">Waschmaschine LÄUFT</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </statement>
                                                  <value name="IF1">
                                                    <block type="logic_compare" id="Yuagp|w@)mC+asceXLLu">
                                                      <field name="OP">GT</field>
                                                      <value name="A">
                                                        <block type="on_source" id="P(tu4AS{);E?w-p?]{1q">
                                                          <field name="ATTR">state.val</field>
                                                        </block>
                                                      </value>
                                                      <value name="B">
                                                        <block type="variables_get" id="ou6,Zi?vbs[;{]@93U`!">
                                                          <field name="VAR">GrenzWertInWatt</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <statement name="DO1">
                                                    <block type="comment" id="H90l#sdGb5I}Wqsbz=9s">
                                                      <field name="COMMENT">Timer stoppen</field>
                                                      <next>
                                                        <block type="procedures_callnoreturn" id="zo=cPu~=j#pus6bWVaJl">
                                                          <mutation name="checkFertig">
                                                            <arg name="parameter"></arg>
                                                          </mutation>
                                                          <value name="ARG0">
                                                            <block type="logic_boolean" id="1SYbGS^3xkqD/Uj?{bvJ">
                                                              <field name="BOOL">FALSE</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </statement>
                                                  <value name="IF2">
                                                    <block type="logic_operation" id="_@|YxZPYI(z3![Q=ZbX4" inline="false">
                                                      <field name="OP">AND</field>
                                                      <value name="A">
                                                        <block type="logic_compare" id="Ge6FX#6b5WYoc;wF%%iH">
                                                          <field name="OP">LT</field>
                                                          <value name="A">
                                                            <block type="on_source" id="0Vw33+AwVD~={g{aHa~d">
                                                              <field name="ATTR">state.val</field>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <block type="variables_get" id="NufLwbvZR1.fEmqJNOTZ">
                                                              <field name="VAR">GrenzWertInWatt</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <value name="B">
                                                        <block type="logic_compare" id="X[1t=zl25bQ]aHT[:`,8">
                                                          <field name="OP">EQ</field>
                                                          <value name="A">
                                                            <block type="get_value" id="4WFkiPOYU?#zQhOL)0u(">
                                                              <field name="ATTR">val</field>
                                                              <field name="OID">javascript.0.WaschmaschineAN</field>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <block type="logic_boolean" id="?jrLY7K)k;1?sa!Ef{VO">
                                                              <field name="BOOL">TRUE</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <statement name="DO2">
                                                    <block type="comment" id="}Q59!:8+Dc~b~LwZhq-(">
                                                      <field name="COMMENT">Timer starten</field>
                                                      <next>
                                                        <block type="procedures_callnoreturn" id=";MD%1IF[[H29g_f=vvYH">
                                                          <mutation name="checkFertig">
                                                            <arg name="parameter"></arg>
                                                          </mutation>
                                                          <value name="ARG0">
                                                            <block type="logic_boolean" id="/yX*,4aU!HHUO#/2U-NR">
                                                              <field name="BOOL">TRUE</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </statement>
                                                </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="l1.gm`YNTt2#Ww;_Stf+" x="838" y="88">
          <mutation>
            <arg name="Meldetext"></arg>
          </mutation>
          <field name="NAME">Melden</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="comment" id="CgkHkrp5c26e`w3uU(i`">
              <field name="COMMENT">Hier wird die Meldung ausgegeben</field>
              <next>
                <block type="debug" id="SYQu;@N0JgE!W~[JZcZ_">
                  <field name="Severity">log</field>
                  <value name="TEXT">
                    <shadow type="text" id="4+J8c.^+FrkDV^]dAda-">
                      <field name="TEXT">test</field>
                    </shadow>
                    <block type="variables_get" id="KuX^Hf4/i6gnp|rmq9WR">
                      <field name="VAR">Meldetext</field>
                    </block>
                  </value>
                  <next>
                    <block type="comment" id="a;Ent4V!@/ELz)~^PTwn">
                      <field name="COMMENT">Hier den SendTo Baustein einsetzen,</field>
                      <next>
                        <block type="comment" id="Xc,u6Sm.@c5xeqVM)suq">
                          <field name="COMMENT">den man benutzen will.</field>
                          <next>
                            <block type="comment" id="cI=%X;P?/Tfam8YIny%V">
                              <field name="COMMENT">Die Meldung befindet sich in der Variablen</field>
                              <next>
                                <block type="comment" id="{(av)+6o4VfWo^eJEnft">
                                  <field name="COMMENT">"Meldetext"</field>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
        <block type="procedures_defnoreturn" id="sDP?w~)oJD}Z95[_?EY0" x="13" y="1237">
          <mutation>
            <arg name="parameter"></arg>
          </mutation>
          <field name="NAME">checkFertig</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="comment" id="V2@7jqv5RTl+}q}xfEsZ">
              <field name="COMMENT">Timer stoppen</field>
              <next>
                <block type="timeouts_cleartimeout" id="y7iPL;/^^,*);q|%Pk6;">
                  <field name="NAME">timeout</field>
                  <next>
                    <block type="controls_if" id="*DX-*|5t*M5.|5Qw0p76">
                      <value name="IF0">
                        <block type="logic_compare" id="[-Hs2uzeFf6L7XO4:d6g">
                          <field name="OP">EQ</field>
                          <value name="A">
                            <block type="variables_get" id="uT*6f!Y:?Sivq1F-y;7_">
                              <field name="VAR">parameter</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="logic_boolean" id="w?1)4.uK{/ey3NJ)NjH:">
                              <field name="BOOL">TRUE</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO0">
                        <block type="comment" id="fU`TRz:h*y1K[t@GmyY:">
                          <field name="COMMENT">Timer starten</field>
                          <next>
                            <block type="timeouts_settimeout" id="k%sy5:QdTn+3f@{OZshs">
                              <field name="NAME">timeout</field>
                              <field name="DELAY">40</field>
                              <field name="UNIT">sec</field>
                              <statement name="STATEMENT">
                                <block type="control" id="UOquZ.)w|Dv~5_@iC*HO">
                                  <mutation delay_input="false"></mutation>
                                  <field name="OID">javascript.0.WaschmaschineAN</field>
                                  <field name="WITH_DELAY">FALSE</field>
                                  <value name="VALUE">
                                    <block type="logic_boolean" id="ttQizIf!/AB*HLfb9Kw1">
                                      <field name="BOOL">FALSE</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="procedures_callnoreturn" id="HHrpaU=vtt6v1JInTG~l">
                                      <mutation name="Melden">
                                        <arg name="Meldetext"></arg>
                                      </mutation>
                                      <value name="ARG0">
                                        <block type="text" id="leE4:W;JI@,LD;n0Gs6r">
                                          <field name="TEXT">Waschmaschine FERTIG</field>
                                        </block>
                                      </value>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                            </block>
                          </next>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
      </xml>
      

      Grüße

      posted in Blockly
      rantanplan
      rantanplan
    • RE: Wunschliste Blockly-Elemente

      @MyzerAT sagte in Wunschliste Blockly-Elemente:

      du sagst es selbst du kennst ical nicht, aber behauptest das das nicht geht, sorry aber bitte las das Rätsel raten. Sicher weiss ical meine Termine in der Zukunft und daher sollte es machbar sein, aber nicht mit Timeout

      Starke Worte! ...................................................
      Auf dieses Niveau lasse ich mich aber nicht ein.

      posted in Entwicklung
      rantanplan
      rantanplan
    • [Vorlage] Blockly Änderungen innerhalt eines Zeitraums erkennen.

      Wer erkennen möchte/muss, wie oft ein Aktor innerhalb eines Zeitraums auslöst und bei einer bestimmten Anzahl von Auslösungen etwas starten möchte, kann vielleicht dieses Blockly gebrauchen.

      Parameter: (in der Funktion "initVar" zu setzen)
      maxSekunden -> Zeit in Sekunden in denen die Ereignisse summiert werden
      maxAktionen -> maximale Ereignisse die in "maxSekunden" stattfinden dürfen.

      ForumAktionInZeitraum.png

      Export:

      <xml xmlns="http://www.w3.org/1999/xhtml">
        <variables>
          <variable type="" id="W=tjkG/xj`ZS6uuvcM0;">erstesAusloesen</variable>
          <variable type="" id="qRJ$=yoz?*hYz,ah4.@|">weiteresAusloesen</variable>
          <variable type="" id=",ulmYVfAeGQl9RCaj};9">count</variable>
          <variable type="" id="?gk9(--6?7oeB),xAPnZ">Sekunden</variable>
          <variable type="" id=";q`4gX#-!^r.C5vYW|.y">maxSekunden</variable>
          <variable type="" id="w26ULW#O6mrD}GeW}P$=">maxAktionen</variable>
        </variables>
        <block type="procedures_defnoreturn" id="eJH/DyNr0iKb}/[Gl!HE" x="463" y="-62">
          <field name="NAME">initvAR</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="variables_set" id="AQ6z=^ocF/=ddh+c$5b,">
              <field name="VAR" id="W=tjkG/xj`ZS6uuvcM0;" variabletype="">erstesAusloesen</field>
              <value name="VALUE">
                <block type="math_number" id="/DkC#gnF@b(MJ[=fbN|L">
                  <field name="NUM">0</field>
                </block>
              </value>
              <next>
                <block type="variables_set" id="+8E?d7bjFw{S!YLq,)f/">
                  <field name="VAR" id="qRJ$=yoz?*hYz,ah4.@|" variabletype="">weiteresAusloesen</field>
                  <value name="VALUE">
                    <block type="math_number" id="`TxtzW;{nj$9;+d/o;~Y">
                      <field name="NUM">0</field>
                    </block>
                  </value>
                  <next>
                    <block type="variables_set" id="yL!-4OOTA./$,4ee(Cds">
                      <field name="VAR" id=",ulmYVfAeGQl9RCaj};9" variabletype="">count</field>
                      <value name="VALUE">
                        <block type="math_number" id="gZ0gtUg26~h%#eyM+kyc">
                          <field name="NUM">0</field>
                        </block>
                      </value>
                      <next>
                        <block type="comment" id="{Q*]tChd7q-wh@0YGdaQ">
                          <field name="COMMENT">Parameter für Aktion</field>
                          <next>
                            <block type="variables_set" id="-KJQnkRFTYWODY2M=P[}">
                              <field name="VAR" id=";q`4gX#-!^r.C5vYW|.y" variabletype="">maxSekunden</field>
                              <value name="VALUE">
                                <block type="math_number" id="JU3qzz12bdJy7;w_wC]i">
                                  <field name="NUM">900</field>
                                </block>
                              </value>
                              <next>
                                <block type="variables_set" id="}qNk8Tr-w:ELO1u4f(wO">
                                  <field name="VAR" id="w26ULW#O6mrD}GeW}P$=" variabletype="">maxAktionen</field>
                                  <value name="VALUE">
                                    <block type="math_number" id=";o%!f-T(8Xy[`mAo29q`">
                                      <field name="NUM">3</field>
                                    </block>
                                  </value>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
        <block type="procedures_callnoreturn" id="Oy?5l{.zD(@$40hb|l:-" x="63" y="13">
          <mutation name="initvAR"></mutation>
          <next>
            <block type="on_ext" id="YYCsbU7xie.u2:Jbzn}z">
              <mutation items="1"></mutation>
              <field name="CONDITION">true</field>
              <field name="ACK_CONDITION"></field>
              <value name="OID0">
                <shadow type="field_oid" id="H]z6nzSBT`HJx2NBjfx0">
                  <field name="oid">default</field>
                </shadow>
              </value>
              <statement name="STATEMENT">
                <block type="controls_if" id="0z9~9=VF=-5^l0kKUe/Q">
                  <mutation else="1"></mutation>
                  <value name="IF0">
                    <block type="logic_compare" id="P]oBnwC[+of1+Zy5e{jh">
                      <field name="OP">EQ</field>
                      <value name="A">
                        <block type="variables_get" id="%mE7$1.5TRuNtkeA~07I">
                          <field name="VAR" id="W=tjkG/xj`ZS6uuvcM0;" variabletype="">erstesAusloesen</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="math_number" id="`{qE|mEhR^(/ejldjo~c">
                          <field name="NUM">0</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="variables_set" id="`vyqmlTjii_?E_rJTEIZ">
                      <field name="VAR" id="W=tjkG/xj`ZS6uuvcM0;" variabletype="">erstesAusloesen</field>
                      <value name="VALUE">
                        <block type="time_get" id="pkuVf1;[ehasqK+_GO~=">
                          <mutation format="false" language="false"></mutation>
                          <field name="OPTION">object</field>
                        </block>
                      </value>
                    </block>
                  </statement>
                  <statement name="ELSE">
                    <block type="variables_set" id="0WZSoT)tXYYf;|_bwj,3">
                      <field name="VAR" id="qRJ$=yoz?*hYz,ah4.@|" variabletype="">weiteresAusloesen</field>
                      <value name="VALUE">
                        <block type="time_get" id="B8$i.jJG4Fi`.qEp].I?">
                          <mutation format="false" language="false"></mutation>
                          <field name="OPTION">object</field>
                        </block>
                      </value>
                      <next>
                        <block type="variables_set" id="m4^:{{K@hvL*lmi)6{2H">
                          <field name="VAR" id="?gk9(--6?7oeB),xAPnZ" variabletype="">Sekunden</field>
                          <value name="VALUE">
                            <block type="convert_from_date" id="+^#ztyEb][`tUdEwrQ+H" inline="false">
                              <mutation format="false" language="false"></mutation>
                              <field name="OPTION">s</field>
                              <value name="VALUE">
                                <block type="math_arithmetic" id="nfS|lSpf@X6R=M)oT3|C">
                                  <field name="OP">MINUS</field>
                                  <value name="A">
                                    <shadow type="math_number" id="|%?p~CA0bzjR|1)f4:]j">
                                      <field name="NUM">1</field>
                                    </shadow>
                                    <block type="variables_get" id="nQRSVq@C#nW1HPfZ~Rh6">
                                      <field name="VAR" id="qRJ$=yoz?*hYz,ah4.@|" variabletype="">weiteresAusloesen</field>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <shadow type="math_number" id="1L}]Fn;7,{C7@eA)/qb6">
                                      <field name="NUM">1</field>
                                    </shadow>
                                    <block type="variables_get" id="VXtglw3pM]Rz!.v2N9(;">
                                      <field name="VAR" id="W=tjkG/xj`ZS6uuvcM0;" variabletype="">erstesAusloesen</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                            </block>
                          </value>
                          <next>
                            <block type="controls_if" id="YrXcjy{d[+o$-*/E`F`2">
                              <mutation else="1"></mutation>
                              <value name="IF0">
                                <block type="logic_compare" id="ek6F}GY+F.s%FIH0E~hZ">
                                  <field name="OP">LT</field>
                                  <value name="A">
                                    <block type="variables_get" id="H;H+l`dvgWiPu4Fj=N^_">
                                      <field name="VAR" id="?gk9(--6?7oeB),xAPnZ" variabletype="">Sekunden</field>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <block type="variables_get" id="g%8|E/;y%`xCci$t!d8-">
                                      <field name="VAR" id=";q`4gX#-!^r.C5vYW|.y" variabletype="">maxSekunden</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <statement name="DO0">
                                <block type="math_change" id="OykB3%82xmoe5zf0YA=2">
                                  <field name="VAR" id=",ulmYVfAeGQl9RCaj};9" variabletype="">count</field>
                                  <value name="DELTA">
                                    <shadow type="math_number" id="lGT(C@g**7NKpwt8iS)I">
                                      <field name="NUM">1</field>
                                    </shadow>
                                  </value>
                                  <next>
                                    <block type="controls_if" id="(e?c.R8:QwQv%gh}mW:H">
                                      <value name="IF0">
                                        <block type="logic_compare" id="ZJJJ^jL[ZP*?CS6v`!h{">
                                          <field name="OP">EQ</field>
                                          <value name="A">
                                            <block type="variables_get" id="t49[Oj#s7+fcE7k{SmAM">
                                              <field name="VAR" id=",ulmYVfAeGQl9RCaj};9" variabletype="">count</field>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <block type="variables_get" id="b1uoaE.4{uaV7T@dx[$m">
                                              <field name="VAR" id="w26ULW#O6mrD}GeW}P$=" variabletype="">maxAktionen</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <statement name="DO0">
                                        <block type="comment" id="[O{y8xakx@f$rm`^W:4v">
                                          <field name="COMMENT">Action</field>
                                          <next>
                                            <block type="debug" id="pC%ZL=Qr^_}C.2il[mCL">
                                              <field name="Severity">log</field>
                                              <value name="TEXT">
                                                <shadow type="text" id="N+F}TNK3S{t#1%EmbB{S">
                                                  <field name="TEXT">Aktion ist notwendig!!!</field>
                                                </shadow>
                                              </value>
                                              <next>
                                                <block type="comment" id="X}kGeEyP@IH4mWHQAq7m">
                                                  <field name="COMMENT">Alles auf 0</field>
                                                  <next>
                                                    <block type="procedures_callnoreturn" id="|![qE]#wGPs5ay`6,ion">
                                                      <mutation name="initvAR"></mutation>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </statement>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                              <statement name="ELSE">
                                <block type="comment" id="`+h;ql,CkezwSL61`+wH">
                                  <field name="COMMENT">Alles auf 0</field>
                                  <next>
                                    <block type="procedures_callnoreturn" id="j-1nhr8wT:bxU8xHOcV(">
                                      <mutation name="initvAR"></mutation>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </statement>
                </block>
              </statement>
            </block>
          </next>
        </block>
      </xml>
      

      Grüße

      posted in Blockly
      rantanplan
      rantanplan
    • RE: Wunschliste Blockly-Elemente

      Dynamischer Astro-Versatz.

      Da haben früher immer so viele nach geschrien. Jetzt keiner mehr?
      wunsch_001.png

      (Wird aber wahrscheinlich nicht gehen)

      posted in Entwicklung
      rantanplan
      rantanplan
    • RE: [VORLAGE] Blockly Meldung wenn Waschmaschine fertig

      @Alero sagte in [VORLAGE] Blockly Meldung wenn Waschmaschine fertig:

      Hi, hat jemand über Blockly schon einen Baustein mit telegram?
      habe den Baustein nur für CCU als Script und habe wenig bis gar keine Ahnung von Blockly.

      Gruß
      Alero

      Was soll die Frage in diesem Thread? Der ist schon genug durcheinander.
      In etlichen Beispielen wird der Telegram-Baustein benutzt. Im Forum einfach mal nach Blockly und oder Telegram suchen.
      Oder einen neuen Beitrag erhöffnen.

      posted in Blockly
      rantanplan
      rantanplan
    • [Vorlage] Blockly Anwesenheitserkennung nach "Badewannen-Prinzip"

      Hallo Zusammen

      In einem Fred hier im Forum wurde nach dem Badewannen-Prinzip gefragt.
      http://forum.iobroker.net/viewtopic.php … ead#p44827

      Ich setzte dieses Prinzip seit längerem an Stellen ein, wo andere Arten von Anwesenheitserkennung nur schwer oder gar nicht umsetzbar sind.
      Die ursprüngliche Idee hatte Roland M. aus dem Homatic-Forum.
      http://homematic-forum.de/forum/viewtop … 31&t=24962

      Die Einstellungen in meinem Beispiel, muss sich natürlich jeder nach seinen Bedürfnissen anpassen.
      Der betreffende BW ist folgendermaßen eingestellt:
      Auslösen bei jedem Sensor-Impuls
      Sendeabstand dynamisch
      Mindestsendeabstand 60 Sekunden
      Bei diesen Einstellungen kommt theoretisch jede Minute ein Impuls wenn sich jemand im Raum befindet.
      Das sind also max. 60 Impulse pro Stunde.
      Bei jeder erkannten Bewegung wird eine Variable (Motion_B1) um 1 erhöht.
      Und alle 30 Minuten werden von Motion_B1 wieder 10 abgezogen.
      Über die Angaben wie schnell, wieviel abgezogen wird, kann man seine Bedürfnisse anpassen

      Ich habe noch einen "Badewannen-Überlauf" eingebaut.
      Ohne "Überlauf" würde, wenn bei Motion_B1=60 keiner mehr im Raum ist, 3 Std. dauern bis Motion_B1 auf Null wäre (Alle 30 Min - 10) Das ist mir zu lang.

      Motion_B1 kann, in dem Beispiel, nicht größer als 30 werden.
      Dadurch wird nach max. 1,5 Std., ohne Bewegung, Motion_B1 auf 0 gesetzt.
      Dies wird an anderen Stellen getriggert und es erfolgen, je nach Wochentag und Tageszeit, weitere Aktionen.

      Hier ein paar Bildchen.
      Forum_Badewannenprinzip_B1.png
      Forum_Badewannenprinzip_B2.png

      Hiermit kann man sich das Blockly-Script importieren.

      <xml xmlns="http://www.w3.org/1999/xhtml">
        <block type="comment" id="dCjITNr+E3C4n~bCzT6A" x="-87" y="212">
          <field name="COMMENT">Anwesenheitserkennung nach</field>
          <next>
            <block type="comment" id="Z%{=SAN}R3~M%ru]Qk3N">
              <field name="COMMENT">"Badewannenprinzip"</field>
              <next>
                <block type="create" id="?}+9rxryWIjLf|V5PhK_">
                  <field name="NAME">Motion_Raum</field>
                  <next>
                    <block type="comment" id="@HdB0rR#*X1(DwRnE:.0">
                      <field name="COMMENT">"CountUp"</field>
                      <next>
                        <block type="on_ext" id="w3744~(4aM]Lmr1x%e?#">
                          <mutation items="1"></mutation>
                          <field name="CONDITION">true</field>
                          <field name="ACK_CONDITION"></field>
                          <value name="OID0">
                            <shadow type="field_oid" id="rbgU::(YPcRn+0+RqqDL">
                              <field name="oid">hm-rpc.0.KEQ0972714.1.MOTION</field>
                            </shadow>
                          </value>
                          <statement name="STATEMENT">
                            <block type="comment" id="_=|iyOkm(/DPWb+|3R%^">
                              <field name="COMMENT">Wenn Bewegung erkannt</field>
                              <next>
                                <block type="comment" id="n):F#kIqAp#:22q9z0RG">
                                  <field name="COMMENT">erfolgt der CountUp</field>
                                  <next>
                                    <block type="controls_if" id="9?(p#xHTJ@97wE=.3Gu~">
                                      <mutation else="1"></mutation>
                                      <value name="IF0">
                                        <block type="logic_compare" id="PIv`T`NUcv6}@B=]vM|z">
                                          <field name="OP">EQ</field>
                                          <value name="A">
                                            <block type="get_value" id="58FB1t=MwH2,s+*wio5{">
                                              <field name="ATTR">val</field>
                                              <field name="OID">javascript.0.Motion_Raum</field>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <block type="math_number" id="@}5EodeJimakIHg1,NGe">
                                              <field name="NUM">0</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <statement name="DO0">
                                        <block type="comment" id="`)QLP5HNi7/04=5UwDT}">
                                          <field name="COMMENT">Wenn der Wert 0 ist einen kleinen "Vorlauf" setzen</field>
                                          <next>
                                            <block type="comment" id="4wk%DJu0I:uTXujAcmWj">
                                              <field name="COMMENT">sonst könnte dieser beim nächsten "CountDown"</field>
                                              <next>
                                                <block type="comment" id="y%@L(;8TG[*!jJVIsT_e">
                                                  <field name="COMMENT">SOFORT wieder auf Null gesetzt werden</field>
                                                  <next>
                                                    <block type="control" id="|E=^o]go?T#xHZa~3sB6">
                                                      <mutation delay_input="false"></mutation>
                                                      <field name="OID">hm-rega.0.11551</field>
                                                      <field name="WITH_DELAY">FALSE</field>
                                                      <value name="VALUE">
                                                        <block type="math_arithmetic" id="aPV,*?0Vi~X[afH|to5i">
                                                          <field name="OP">ADD</field>
                                                          <value name="A">
                                                            <shadow type="math_number" id="wc,;^#NSu{I1!Hp6;(3O">
                                                              <field name="NUM">1</field>
                                                            </shadow>
                                                            <block type="get_value" id="4p#Vfti?!,xPiQkVz(zJ">
                                                              <field name="ATTR">val</field>
                                                              <field name="OID">javascript.0.Motion_Raum</field>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <shadow type="math_number" id=".Av%rm/b;nUSM;heLI]B">
                                                              <field name="NUM">12</field>
                                                            </shadow>
                                                          </value>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </statement>
                                      <statement name="ELSE">
                                        <block type="comment" id="zfi@QDP]po]IoF4[:tXi">
                                          <field name="COMMENT">Motion Wert begrenzen (hier 30)</field>
                                          <next>
                                            <block type="controls_if" id="Td7?Stv51,wH/,!(lk%m">
                                              <value name="IF0">
                                                <block type="logic_compare" id=":=jgcl95Opr]cFCsFWMG">
                                                  <field name="OP">LT</field>
                                                  <value name="A">
                                                    <block type="get_value" id="9(0)^Hsvw.0NzGOjDfDr">
                                                      <field name="ATTR">val</field>
                                                      <field name="OID">javascript.0.Motion_Raum</field>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <block type="math_number" id="wgwJa}fZa}?vHaQ8v{3#">
                                                      <field name="NUM">30</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <statement name="DO0">
                                                <block type="comment" id="E[MqxsQP@+ilOFighRhc">
                                                  <field name="COMMENT">Motion erhöhen</field>
                                                  <next>
                                                    <block type="control" id="#k~BtfHBwLimY?r98v5#">
                                                      <mutation delay_input="false"></mutation>
                                                      <field name="OID">javascript.0.Motion_Raum</field>
                                                      <field name="WITH_DELAY">FALSE</field>
                                                      <value name="VALUE">
                                                        <block type="math_arithmetic" id="(bW;IT1c#|8OZrB+4kxb">
                                                          <field name="OP">ADD</field>
                                                          <value name="A">
                                                            <shadow type="math_number" id="wc,;^#NSu{I1!Hp6;(3O">
                                                              <field name="NUM">1</field>
                                                            </shadow>
                                                            <block type="get_value" id="|H{+Z.9,{Lupf=TC@(ej">
                                                              <field name="ATTR">val</field>
                                                              <field name="OID">javascript.0.Motion_Raum</field>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <shadow type="math_number" id="TSCih;^5vNn+k[G;_d~)">
                                                              <field name="NUM">1</field>
                                                            </shadow>
                                                          </value>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </next>
                                                </block>
                                              </statement>
                                            </block>
                                          </next>
                                        </block>
                                      </statement>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </statement>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </next>
        </block>
        <block type="comment" id="rl9+_.4LKN]01[IKTrz|" x="-87" y="888">
          <field name="COMMENT">Alle 30 Minuten "CountDown"</field>
          <next>
            <block type="schedule" id="RxlCGpL@mvhUlw^I{@/C">
              <field name="SCHEDULE">*/30 * * * *</field>
              <statement name="STATEMENT">
                <block type="comment" id="CdLQ1%RGU;;p#@?3}EDY">
                  <field name="COMMENT">Dieser Wert soll abgezogen werden</field>
                  <next>
                    <block type="variables_set" id="919P*ZDse6JI;Tx?OrPR">
                      <field name="VAR">AbzugWert</field>
                      <value name="VALUE">
                        <block type="math_number" id="Cp*2Dn_*xMmR}*W-A(}B">
                          <field name="NUM">10</field>
                        </block>
                      </value>
                      <next>
                        <block type="comment" id="Qyt[7%^2[loDz^#E5Z9`">
                          <field name="COMMENT">Nicht ins Minus laufen lassen</field>
                          <next>
                            <block type="controls_if" id="S_1xt9-+tbwtdS/*.]|~">
                              <mutation else="1"></mutation>
                              <value name="IF0">
                                <block type="logic_compare" id="P!O,QbN/!t#A9@kvusRr">
                                  <field name="OP">GTE</field>
                                  <value name="A">
                                    <block type="get_value" id="(rPW/JXt8BC13v^W_@v=">
                                      <field name="ATTR">val</field>
                                      <field name="OID">javascript.0.Motion_Raum</field>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <block type="variables_get" id="!YXQe:`It).%^=!{.wto">
                                      <field name="VAR">AbzugWert</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <statement name="DO0">
                                <block type="comment" id="XE^UpiZ??O^`Ltcf{.C:">
                                  <field name="COMMENT">AbzugsWert von Motion abziehen</field>
                                  <next>
                                    <block type="control" id="*7#498bFA!D3YisX|,Xi">
                                      <mutation delay_input="false"></mutation>
                                      <field name="OID">javascript.0.Motion_Raum</field>
                                      <field name="WITH_DELAY">FALSE</field>
                                      <value name="VALUE">
                                        <block type="math_arithmetic" id="rm35]JDVR!vn2-M?y!O{">
                                          <field name="OP">MINUS</field>
                                          <value name="A">
                                            <shadow type="math_number" id="wc,;^#NSu{I1!Hp6;(3O">
                                              <field name="NUM">1</field>
                                            </shadow>
                                            <block type="get_value" id="@1JoE5?c;%;K6as!]}4R">
                                              <field name="ATTR">val</field>
                                              <field name="OID">javascript.0.Motion_Raum</field>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <shadow type="math_number" id="MN^b`GXU.4sT?sj;]DqH">
                                              <field name="NUM">1</field>
                                            </shadow>
                                            <block type="variables_get" id="JNcP^m!1MOASXd`}dE]q">
                                              <field name="VAR">AbzugWert</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                              <statement name="ELSE">
                                <block type="comment" id=")S23z;Un`c|`kyrW`Fy1">
                                  <field name="COMMENT">Definitiv keiner mehr anwesend</field>
                                  <next>
                                    <block type="comment" id="3-Alqg!2(8zASq%D%lu_">
                                      <field name="COMMENT">Wert wird auf Null gesetzt</field>
                                      <next>
                                        <block type="comment" id="bg}hgHp%Bh.r:7@6@^a+">
                                          <field name="COMMENT">Dieser Wert auf Null wird in anderen Programmen</field>
                                          <next>
                                            <block type="comment" id="|lfOV4D`Q+@CCcCGg]:T">
                                              <field name="COMMENT">getriggert und Aktionen ausgelöst</field>
                                              <next>
                                                <block type="control" id="[Y6tCHG`[OkIxvEoPd8C">
                                                  <mutation delay_input="false"></mutation>
                                                  <field name="OID">javascript.0.Motion_Raum</field>
                                                  <field name="WITH_DELAY">FALSE</field>
                                                  <value name="VALUE">
                                                    <block type="math_number" id="D:tX2*C|Vr3`f8Y(xtJC">
                                                      <field name="NUM">0</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </statement>
            </block>
          </next>
        </block>
      </xml>
      

      Und für, die nichts mit Blockly am Hut haben, das generierte JavaScript.

      var AbzugWert;
      
      
      // Anwesenheitserkennung nach
      // "Badewannenprinzip"
      createState("Motion_Raum", function () {
      });
      // "CountUp"
      on({id: 'hm-rpc.0.KEQ0972714.1.MOTION', val: true}, function (obj) {
        var value = obj.state.val;
        var oldValue = obj.oldState.val;
        // Wenn Bewegung erkannt
        // erfolgt der CountUp
        if (getState("javascript.0.Motion_Raum").val == 0) {
          // Wenn der Wert 0 ist einen kleinen "Vorlauf" setzen
          // sonst könnte dieser beim nächsten "CountDown"
          // SOFORT wieder auf Null gesetzt werden
          setState("hm-rega.0.11551", (getState("javascript.0.Motion_Raum").val + 12));
        } else {
          // Motion Wert begrenzen (hier 30)
          if (getState("javascript.0.Motion_Raum").val < 30) {
            // Motion erhöhen
            setState("javascript.0.Motion_Raum"/*Motion_Raum*/, (getState("javascript.0.Motion_Raum").val + 1));
          }
        }
      });
      
      // Alle 30 Minuten "CountDown"
      schedule("*/30 * * * *", function () {
        // Dieser Wert soll abgezogen werden
        AbzugWert = 10;
        // Nicht ins Minus laufen lassen
        if (getState("javascript.0.Motion_Raum").val >= AbzugWert) {
          // AbzugsWert von Motion abziehen
          setState("javascript.0.Motion_Raum"/*Motion_Raum*/, (getState("javascript.0.Motion_Raum").val - AbzugWert));
        } else {
          // Definitiv keiner mehr anwesend
          // Wert wird auf Null gesetzt
          // Dieser Wert auf Null wird in anderen Programmen
          // getriggert und Aktionen ausgelöst
          setState("javascript.0.Motion_Raum"/*Motion_Raum*/, 0);
        }
      });
      

      Vielleicht kann es jemand gebrauchen.

      Grüße

      posted in Skripten / Logik
      rantanplan
      rantanplan
    • RE: Variable in ID-Namen verwenden?

      @Homoran sagte in Variable in ID-Namen verwenden?:

      Besteht eigentlich in Blockly die Möglichkeit Zustände von IDs variabel abzufragen.
      Voraussetzung ist natürlich, dass die IDs (oder die Namen??) systematisch benannt sind.

      Ich habe für jeden Raum das gleiche Skkript und würde gerne nach dem Kopiern nur den Raumnamen in einer Variable ändern:

      Werte von einer ID-Variablen abfragen geht leider (noch) nicht in Blockly.
      Werte setzen/verändern aber schon.
      Ich stand vor der gleichen Problematik bei meiner Heizungssteuerung. Jede Menge Räume und alle einzeln steuerbar.
      Da die Logik in jedem Raum gleich ist und ich grundsätzlich ein "fauler Hund" bin, wollte ich die Scripte einfach kopieren.

      Damit ich nicht jedes Script komplett überarbeiten musste, habe ich eine "Initialisierung" Funktion eingebaut.
      Dort werden alle raumspezifischen Daten in lokale Variablen gesetzt. Wenn der Trigger auslöst, wird als erstes die Initialisierung aufgerufen.
      Somit habe ich nur eine Stelle an der ich die Parameter anpassen muss.
      Init_001.png

      Und hier der "schreibe" Baustein mit dem man ID's, die in einer Variablen stehen, ändern kann.
      Init_002.png

      posted in Blockly
      rantanplan
      rantanplan
    • RE: Rechenfehler - Denkfehler bei "Klammerfunktionen"?

      Komplexe Berechnungen in einen Baustein packen ist in Blockly fast nicht möglich.
      Mit der Klammersetzung hapert es da irgendwo.
      Am Besten sieht man das, wenn man kurz auf die JavaScript Anzeige umschaltet.
      Um mir weitere graue Haare zu ersparen, habe ich mir es angewöhnt solche Dinge "aufzudröseln".
      Ich packe mir die Berechnungen immer in eine Funktion. Da bleibt das Blockly übersichtlicher.

      Rechnen_001.png

      Export:

      <xml xmlns="http://www.w3.org/1999/xhtml">
        <variables>
          <variable type="" id=";n:cqW_i{Wk?|i^b;r?q">akt_Hitzestatus_hinten</variable>
          <variable type="" id="pHw}S)9MWPUzWt|+t*Y0">akt_mittlere_hitze_hinten</variable>
          <variable type="" id="-xwNt2JMiJNB9J5-`qz:">Ergebnis</variable>
        </variables>
        <block type="debug" id="im^Q,7`S8l.0.(#]I(lM" x="88" y="38">
          <field name="Severity">log</field>
          <value name="TEXT">
            <shadow type="text" id=";I0^nqg~DTVQ_$x9;~zr">
              <field name="TEXT">test</field>
            </shadow>
            <block type="text_join" id="qRg.ODbKt)#`+~SKQ@Zy">
              <mutation items="2"></mutation>
              <value name="ADD0">
                <block type="text" id="$*PvA17(=%pD)0F@@bm~">
                  <field name="TEXT">ERGEBNIS: </field>
                </block>
              </value>
              <value name="ADD1">
                <block type="procedures_callreturn" id="th-xDe6~}Am.hm_ld:@g">
                  <mutation name="Berechnung">
                    <arg name="akt_Hitzestatus_hinten"></arg>
                    <arg name="akt_mittlere_hitze_hinten"></arg>
                  </mutation>
                  <value name="ARG0">
                    <block type="math_number" id="C=Sh?|pb:Ifr|Z}UYflq">
                      <field name="NUM">0.923</field>
                    </block>
                  </value>
                  <value name="ARG1">
                    <block type="math_number" id="7LTb0YCoM=A3SG530Mri">
                      <field name="NUM">2.3</field>
                    </block>
                  </value>
                </block>
              </value>
            </block>
          </value>
        </block>
        <block type="procedures_defreturn" id="{!kE%gWB@.4D,:uA~A|R" x="263" y="188">
          <mutation>
            <arg name="akt_Hitzestatus_hinten" varid=";n:cqW_i{Wk?|i^b;r?q"></arg>
            <arg name="akt_mittlere_hitze_hinten" varid="pHw}S)9MWPUzWt|+t*Y0"></arg>
          </mutation>
          <field name="NAME">Berechnung</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="variables_set" id="U8zMu6^VE2:Hj~_!jp/{">
              <field name="VAR" id="-xwNt2JMiJNB9J5-`qz:" variabletype="">Ergebnis</field>
              <value name="VALUE">
                <block type="math_arithmetic" id="KsD=}R)(|t7J:k|]U{jb">
                  <field name="OP">DIVIDE</field>
                  <value name="A">
                    <shadow type="math_number" id="dI7QFQzZJ6mbea!7ih=B">
                      <field name="NUM">1</field>
                    </shadow>
                    <block type="variables_get" id="vIrP^63=%(cf(*]WkVzt">
                      <field name="VAR" id=";n:cqW_i{Wk?|i^b;r?q" variabletype="">akt_Hitzestatus_hinten</field>
                    </block>
                  </value>
                  <value name="B">
                    <shadow type="math_number" id="j}T2)LZ[h!^$%7,IHGzj">
                      <field name="NUM">4</field>
                    </shadow>
                  </value>
                </block>
              </value>
              <next>
                <block type="variables_set" id=":(s+3}_$xmBwOmnTm=z@">
                  <field name="VAR" id="-xwNt2JMiJNB9J5-`qz:" variabletype="">Ergebnis</field>
                  <value name="VALUE">
                    <block type="math_arithmetic" id="S#uK:v/gGiem[{FsoU}q">
                      <field name="OP">MULTIPLY</field>
                      <value name="A">
                        <shadow type="math_number" id="dI7QFQzZJ6mbea!7ih=B">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="variables_get" id="zizO+?_W^}rFW:]6=oYH">
                          <field name="VAR" id="-xwNt2JMiJNB9J5-`qz:" variabletype="">Ergebnis</field>
                        </block>
                      </value>
                      <value name="B">
                        <shadow type="math_number" id=")%H!WlNdC_4mYQxmkZ)L">
                          <field name="NUM">3</field>
                        </shadow>
                      </value>
                    </block>
                  </value>
                  <next>
                    <block type="variables_set" id="JvfqQFeOcmviH#PjJP~W">
                      <field name="VAR" id="-xwNt2JMiJNB9J5-`qz:" variabletype="">Ergebnis</field>
                      <value name="VALUE">
                        <block type="math_arithmetic" id="HQJm-8~hoBqt0W3RsK]y">
                          <field name="OP">ADD</field>
                          <value name="A">
                            <shadow type="math_number" id="C0zQ*[UNi5^5`,/jy~x]">
                              <field name="NUM">1</field>
                            </shadow>
                            <block type="variables_get" id="hcqlTglgFbtl}q@GrE^L">
                              <field name="VAR" id="-xwNt2JMiJNB9J5-`qz:" variabletype="">Ergebnis</field>
                            </block>
                          </value>
                          <value name="B">
                            <shadow type="math_number" id="8E2x_A:r=Ro)i+cW*uI{">
                              <field name="NUM">0</field>
                            </shadow>
                            <block type="variables_get" id="!9bzw:H6o`UCV]-f_Q(R">
                              <field name="VAR" id="pHw}S)9MWPUzWt|+t*Y0" variabletype="">akt_mittlere_hitze_hinten</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <next>
                        <block type="variables_set" id="Z_i*_BG5FlotNXTWry6+">
                          <field name="VAR" id="-xwNt2JMiJNB9J5-`qz:" variabletype="">Ergebnis</field>
                          <value name="VALUE">
                            <block type="math_arithmetic" id="WG5lc2%J}s/K^,p!cOM[">
                              <field name="OP">DIVIDE</field>
                              <value name="A">
                                <shadow type="math_number" id="C0zQ*[UNi5^5`,/jy~x]">
                                  <field name="NUM">1</field>
                                </shadow>
                                <block type="variables_get" id="$5,magvf.znfy9F3YY!C">
                                  <field name="VAR" id="-xwNt2JMiJNB9J5-`qz:" variabletype="">Ergebnis</field>
                                </block>
                              </value>
                              <value name="B">
                                <shadow type="math_number" id="]V.4I@|8rn?m5@o%-XnK">
                                  <field name="NUM">4</field>
                                </shadow>
                              </value>
                            </block>
                          </value>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
          <value name="RETURN">
            <block type="variables_get" id="p5V*jU]q%:*/7+(z[B:I">
              <field name="VAR" id="-xwNt2JMiJNB9J5-`qz:" variabletype="">Ergebnis</field>
            </block>
          </value>
        </block>
      </xml>
      

      Grüße

      posted in Blockly
      rantanplan
      rantanplan

    Latest posts made by rantanplan

    • RE: Zeitdifferenz berechnen

      @martin_olw Hallo
      Hier mal ein Teil aus meinem Urlaubs-Script.


      Blockly-Bild.png

      Hier der Import:

      <xml xmlns="https://developers.google.com/blockly/xml">
       <variables>
         <variable id="e9iD.-I54$~?Z|ZL+F{9">ObjektDatumAktuell</variable>
         <variable id="HS;qgmx.%$*4;[8X)sE#">Tage_bis_Urlaub</variable>
         <variable id="E:6SzWk}t@`61,$x`FXx">UrlaubStart</variable>
         <variable id="!}5U.l7kfEw/+lNM)Ab1">UrlaubEnde</variable>
         <variable id=":s,6VAIY,]GlSe|T!)9E">UrlaubsTage</variable>
         <variable id="lY?bd7V(:s+-ZYD^GnD2">TageBisUrlaubsEnde</variable>
         <variable id="=We=rhXNVW,Lr8ETlQwY">UrlaubRest</variable>
       </variables>
       <block type="on_ext" id="6Y@LIxe47B4)/e.|7dhR" x="13" y="13">
         <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
         <field name="CONDITION">ne</field>
         <field name="ACK_CONDITION"></field>
         <value name="OID0">
           <shadow type="field_oid" id=".pH*ia^ETsdO8W,L#Gk=">
             <field name="oid">0_userdata.0.Anwesendheit.Urlaub.Urlaub_1_Anfang</field>
           </shadow>
         </value>
         <value name="OID1">
           <shadow type="field_oid" id="D*3.w}vY.)vz0,R#Xf5;">
             <field name="oid">0_userdata.0.Anwesendheit.Urlaub.Urlaub_1_Ende</field>
           </shadow>
         </value>
         <statement name="STATEMENT">
           <block type="procedures_callnoreturn" id="CruK/)nJvPeDa%r+bEx+">
             <mutation name="INIT"></mutation>
           </block>
         </statement>
       </block>
       <block type="procedures_defnoreturn" id="rK9I[^hv-APnWSk-Kt.L" x="13" y="188">
         <field name="NAME">INIT</field>
         <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
         <statement name="STACK">
           <block type="variables_set" id="61JC/Ih{H)?7I=v/Fm=Q">
             <field name="VAR" id="e9iD.-I54$~?Z|ZL+F{9">ObjektDatumAktuell</field>
             <value name="VALUE">
               <block type="convert_to_date" id="h]gTUfA5G!-^/SWfcqc2">
                 <value name="VALUE">
                   <block type="time_get" id="+wNd8D]Iic8xhJ/d15iR">
                     <mutation xmlns="http://www.w3.org/1999/xhtml" format="true" language="false"></mutation>
                     <field name="OPTION">custom</field>
                     <field name="FORMAT">JJJJ-MM-TT</field>
                   </block>
                 </value>
               </block>
             </value>
             <next>
               <block type="variables_set" id="Lby=(fYB/_-R{ky.`{7]">
                 <field name="VAR" id="E:6SzWk}t@`61,$x`FXx">UrlaubStart</field>
                 <value name="VALUE">
                   <block type="convert_to_date" id="GPUD9FF0O`QE@2wZ2Z]N">
                     <value name="VALUE">
                       <block type="get_value" id="U}A,2^4+8S4DJ1*+F={|">
                         <field name="ATTR">val</field>
                         <field name="OID">0_userdata.0.Anwesendheit.Urlaub.Urlaub_1_Anfang</field>
                       </block>
                     </value>
                   </block>
                 </value>
                 <next>
                   <block type="variables_set" id="VKY$gdP}[3bH;+AXpBHZ">
                     <field name="VAR" id="!}5U.l7kfEw/+lNM)Ab1">UrlaubEnde</field>
                     <value name="VALUE">
                       <block type="convert_to_date" id="*R_Z}kF6`jL7+r1YL|}h">
                         <value name="VALUE">
                           <block type="get_value" id="AAJ|jBQ@iVn7U(iwE(!.">
                             <field name="ATTR">val</field>
                             <field name="OID">0_userdata.0.Anwesendheit.Urlaub.Urlaub_1_Ende</field>
                           </block>
                         </value>
                       </block>
                     </value>
                     <next>
                       <block type="procedures_callnoreturn" id="W)r1+a/-`v`fZ[ERXO+3">
                         <mutation name="Berechnen"></mutation>
                       </block>
                     </next>
                   </block>
                 </next>
               </block>
             </next>
           </block>
         </statement>
       </block>
       <block type="procedures_defnoreturn" id="L%cTl`j}R)j.9dGL(k)I" x="13" y="363">
         <field name="NAME">Berechnen</field>
         <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
         <statement name="STACK">
           <block type="variables_set" id="U]^N4kN@1v8`~e05sV40">
             <field name="VAR" id="HS;qgmx.%$*4;[8X)sE#">Tage_bis_Urlaub</field>
             <value name="VALUE">
               <block type="math_arithmetic" id="tBr:GvymRvpgrT1_2E5C">
                 <field name="OP">DIVIDE</field>
                 <value name="A">
                   <shadow type="math_number" id="dP0!DN7,T{IG#aQ(X~5K">
                     <field name="NUM">1</field>
                   </shadow>
                   <block type="math_arithmetic" id="PnLFGs#2s-cw!/1J~BR=">
                     <field name="OP">DIVIDE</field>
                     <value name="A">
                       <shadow type="math_number" id="*~Z?c`0?/W4QHG0KpJHa">
                         <field name="NUM">1</field>
                       </shadow>
                       <block type="math_arithmetic" id="-M?[syp1P$H*Nh}$]a07">
                         <field name="OP">DIVIDE</field>
                         <value name="A">
                           <shadow type="math_number" id="sZYs`ic+Oo%,ag+BhIV5">
                             <field name="NUM">1</field>
                           </shadow>
                           <block type="math_arithmetic" id=".@g),R`5Bd%V-TVvPRCe">
                             <field name="OP">MINUS</field>
                             <value name="A">
                               <shadow type="math_number" id="zNwwmAotb`B#+|27Fb#g">
                                 <field name="NUM">1</field>
                               </shadow>
                               <block type="variables_get" id="/MDql`:T}Q6%}xv}acQu">
                                 <field name="VAR" id="E:6SzWk}t@`61,$x`FXx">UrlaubStart</field>
                               </block>
                             </value>
                             <value name="B">
                               <shadow type="math_number" id="]^+vZgp!#:p]T%N^B36c">
                                 <field name="NUM">1</field>
                               </shadow>
                               <block type="variables_get" id="Hp+Lv4mN+wM[eh/_kL?O">
                                 <field name="VAR" id="e9iD.-I54$~?Z|ZL+F{9">ObjektDatumAktuell</field>
                               </block>
                             </value>
                           </block>
                         </value>
                         <value name="B">
                           <shadow type="math_number" id="/((:@f|[96!NnwHIVNTY">
                             <field name="NUM">60000</field>
                           </shadow>
                         </value>
                       </block>
                     </value>
                     <value name="B">
                       <shadow type="math_number" id="~9.YMbwQLoRv?I}y|,zu">
                         <field name="NUM">60</field>
                       </shadow>
                     </value>
                   </block>
                 </value>
                 <value name="B">
                   <shadow type="math_number" id="C?D)nEQfRpF}t))Ms*|j">
                     <field name="NUM">24</field>
                   </shadow>
                 </value>
               </block>
             </value>
             <next>
               <block type="debug" id="~N2Vh!EKK-T#|6INP{44">
                 <field name="Severity">info</field>
                 <value name="TEXT">
                   <shadow type="text" id="D1:c+o,B.N=Qc1g;f;/a">
                     <field name="TEXT">test</field>
                   </shadow>
                   <block type="variables_get" id="?DZEd@z3v90wdaK@|rqA">
                     <field name="VAR" id="HS;qgmx.%$*4;[8X)sE#">Tage_bis_Urlaub</field>
                   </block>
                 </value>
                 <next>
                   <block type="variables_set" id="5VU4?Mv4:2huebRFP11,">
                     <field name="VAR" id=":s,6VAIY,]GlSe|T!)9E">UrlaubsTage</field>
                     <value name="VALUE">
                       <block type="math_arithmetic" id="noz1b%8sh`#Bp#SsU0?H">
                         <field name="OP">ADD</field>
                         <value name="A">
                           <shadow type="math_number" id="sf$^_`Ao=`!RV(v@Lt#x">
                             <field name="NUM">1</field>
                           </shadow>
                           <block type="math_arithmetic" id="@{vaElI@,iXl5vX#c|5W">
                             <field name="OP">DIVIDE</field>
                             <value name="A">
                               <shadow type="math_number" id="`btQnasuTCm;qwO*%[(g">
                                 <field name="NUM">1</field>
                               </shadow>
                               <block type="math_arithmetic" id="PGK6{PZZ~O:7kQ3C|FG}">
                                 <field name="OP">DIVIDE</field>
                                 <value name="A">
                                   <shadow type="math_number" id="TO0C%*aX{lO5WW-:f^-R">
                                     <field name="NUM">1</field>
                                   </shadow>
                                   <block type="math_arithmetic" id="?Att1;@%4%Q(/_jZIy5=">
                                     <field name="OP">DIVIDE</field>
                                     <value name="A">
                                       <shadow type="math_number" id="sZYs`ic+Oo%,ag+BhIV5">
                                         <field name="NUM">1</field>
                                       </shadow>
                                       <block type="math_arithmetic" id="EsiyAfA21*3NvTDOu1I{">
                                         <field name="OP">MINUS</field>
                                         <value name="A">
                                           <shadow type="math_number" id="zNwwmAotb`B#+|27Fb#g">
                                             <field name="NUM">1</field>
                                           </shadow>
                                           <block type="variables_get" id="q||DUO@KnmY;n6M5@)(p">
                                             <field name="VAR" id="!}5U.l7kfEw/+lNM)Ab1">UrlaubEnde</field>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <shadow type="math_number" id="]^+vZgp!#:p]T%N^B36c">
                                             <field name="NUM">1</field>
                                           </shadow>
                                           <block type="variables_get" id="Jub1/{z%N7k2B?{V%mmh">
                                             <field name="VAR" id="E:6SzWk}t@`61,$x`FXx">UrlaubStart</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <value name="B">
                                       <shadow type="math_number" id=",,~N.K,x{XBuC]3q^9@Y">
                                         <field name="NUM">60000</field>
                                       </shadow>
                                     </value>
                                   </block>
                                 </value>
                                 <value name="B">
                                   <shadow type="math_number" id="dfV^QOPgu#R~)QikzV|8">
                                     <field name="NUM">60</field>
                                   </shadow>
                                 </value>
                               </block>
                             </value>
                             <value name="B">
                               <shadow type="math_number" id="/`2,hS8}B19v5LW-$/Nu">
                                 <field name="NUM">24</field>
                               </shadow>
                             </value>
                           </block>
                         </value>
                         <value name="B">
                           <shadow type="math_number" id="|Dqt!p.!c8?xc1YJ_$7d">
                             <field name="NUM">1</field>
                           </shadow>
                         </value>
                       </block>
                     </value>
                     <next>
                       <block type="debug" id="a%EN{P;ni)C(h+B{K/3S">
                         <field name="Severity">info</field>
                         <value name="TEXT">
                           <shadow type="text" id="D1:c+o,B.N=Qc1g;f;/a">
                             <field name="TEXT">test</field>
                           </shadow>
                           <block type="variables_get" id="7$,L@1*ag8eG-v1nnL2R">
                             <field name="VAR" id=":s,6VAIY,]GlSe|T!)9E">UrlaubsTage</field>
                           </block>
                         </value>
                         <next>
                           <block type="variables_set" id="g2^ncn{yP-~)8*P@F._l">
                             <field name="VAR" id="lY?bd7V(:s+-ZYD^GnD2">TageBisUrlaubsEnde</field>
                             <value name="VALUE">
                               <block type="math_arithmetic" id="Xd)W`4r{ZXZ6k@3dv$VG">
                                 <field name="OP">DIVIDE</field>
                                 <value name="A">
                                   <shadow type="math_number" id="dP0!DN7,T{IG#aQ(X~5K">
                                     <field name="NUM">1</field>
                                   </shadow>
                                   <block type="math_arithmetic" id="QmpPXam~rvT+MgNX9u+,">
                                     <field name="OP">DIVIDE</field>
                                     <value name="A">
                                       <shadow type="math_number" id="*~Z?c`0?/W4QHG0KpJHa">
                                         <field name="NUM">1</field>
                                       </shadow>
                                       <block type="math_arithmetic" id="w1o15_,o{(08nPDH+V{,">
                                         <field name="OP">DIVIDE</field>
                                         <value name="A">
                                           <shadow type="math_number" id="sZYs`ic+Oo%,ag+BhIV5">
                                             <field name="NUM">1</field>
                                           </shadow>
                                           <block type="math_arithmetic" id="n}7Zo/8GqFRM_n/6*(Xt">
                                             <field name="OP">MINUS</field>
                                             <value name="A">
                                               <shadow type="math_number" id="zNwwmAotb`B#+|27Fb#g">
                                                 <field name="NUM">1</field>
                                               </shadow>
                                               <block type="variables_get" id="MtN9sI^REd.n7!Ll/Qok">
                                                 <field name="VAR" id="!}5U.l7kfEw/+lNM)Ab1">UrlaubEnde</field>
                                               </block>
                                             </value>
                                             <value name="B">
                                               <shadow type="math_number" id="]^+vZgp!#:p]T%N^B36c">
                                                 <field name="NUM">1</field>
                                               </shadow>
                                               <block type="variables_get" id="S9}r}%dv+m__+^x6JkY0">
                                                 <field name="VAR" id="e9iD.-I54$~?Z|ZL+F{9">ObjektDatumAktuell</field>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <shadow type="math_number" id="::-{0q`94xph2Eg|-x|U">
                                             <field name="NUM">60000</field>
                                           </shadow>
                                         </value>
                                       </block>
                                     </value>
                                     <value name="B">
                                       <shadow type="math_number" id="``T+p/C8xgM_=p5Cs^W+">
                                         <field name="NUM">60</field>
                                       </shadow>
                                     </value>
                                   </block>
                                 </value>
                                 <value name="B">
                                   <shadow type="math_number" id="_irBzMi^l+RPzF^h?J@W">
                                     <field name="NUM">24</field>
                                   </shadow>
                                 </value>
                               </block>
                             </value>
                             <next>
                               <block type="debug" id="o9/+lp3,%3)QZSiURon4">
                                 <field name="Severity">info</field>
                                 <value name="TEXT">
                                   <shadow type="text" id="D1:c+o,B.N=Qc1g;f;/a">
                                     <field name="TEXT">test</field>
                                   </shadow>
                                   <block type="variables_get" id=",):=#H#8/0p$Z)()K0:9">
                                     <field name="VAR" id="lY?bd7V(:s+-ZYD^GnD2">TageBisUrlaubsEnde</field>
                                   </block>
                                 </value>
                                 <next>
                                   <block type="variables_set" id="#z+4]AP}FC6-TiA_G8fA">
                                     <field name="VAR" id="=We=rhXNVW,Lr8ETlQwY">UrlaubRest</field>
                                     <value name="VALUE">
                                       <block type="math_arithmetic" id=")PIjRrt8Rul#dK}Q2soP">
                                         <field name="OP">DIVIDE</field>
                                         <value name="A">
                                           <shadow type="math_number" id="dP0!DN7,T{IG#aQ(X~5K">
                                             <field name="NUM">1</field>
                                           </shadow>
                                           <block type="math_arithmetic" id="otHOPPC!:5nC?!K.,F^V">
                                             <field name="OP">DIVIDE</field>
                                             <value name="A">
                                               <shadow type="math_number" id="*~Z?c`0?/W4QHG0KpJHa">
                                                 <field name="NUM">1</field>
                                               </shadow>
                                               <block type="math_arithmetic" id="QEVx==e_%dhX0W/|#4+i">
                                                 <field name="OP">DIVIDE</field>
                                                 <value name="A">
                                                   <shadow type="math_number" id="sZYs`ic+Oo%,ag+BhIV5">
                                                     <field name="NUM">1</field>
                                                   </shadow>
                                                   <block type="math_arithmetic" id="Yq,`X1IWVW1~g05cg4f=">
                                                     <field name="OP">MINUS</field>
                                                     <value name="A">
                                                       <shadow type="math_number" id="zNwwmAotb`B#+|27Fb#g">
                                                         <field name="NUM">1</field>
                                                       </shadow>
                                                       <block type="variables_get" id="We*DW*18Ms-OQ@Th]/6!">
                                                         <field name="VAR" id="!}5U.l7kfEw/+lNM)Ab1">UrlaubEnde</field>
                                                       </block>
                                                     </value>
                                                     <value name="B">
                                                       <shadow type="math_number" id="]^+vZgp!#:p]T%N^B36c">
                                                         <field name="NUM">1</field>
                                                       </shadow>
                                                       <block type="variables_get" id="VhM}N+uW*3~d(Ad/;_Ot">
                                                         <field name="VAR" id="e9iD.-I54$~?Z|ZL+F{9">ObjektDatumAktuell</field>
                                                       </block>
                                                     </value>
                                                   </block>
                                                 </value>
                                                 <value name="B">
                                                   <shadow type="math_number" id="`GF=?375Ik$qs#o}VgDC">
                                                     <field name="NUM">60000</field>
                                                   </shadow>
                                                 </value>
                                               </block>
                                             </value>
                                             <value name="B">
                                               <shadow type="math_number" id="mQIS:jetB*#aHBYU)0PI">
                                                 <field name="NUM">60</field>
                                               </shadow>
                                             </value>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <shadow type="math_number" id="Om9T;?}xe$%eid;W`gF0">
                                             <field name="NUM">24</field>
                                           </shadow>
                                         </value>
                                       </block>
                                     </value>
                                     <next>
                                       <block type="debug" id=")?=j68qr=z=lgz[hX?u#">
                                         <field name="Severity">info</field>
                                         <value name="TEXT">
                                           <shadow type="text" id="D1:c+o,B.N=Qc1g;f;/a">
                                             <field name="TEXT">test</field>
                                           </shadow>
                                           <block type="variables_get" id="/K3#]{E4M_i.vt9,#}uD">
                                             <field name="VAR" id="=We=rhXNVW,Lr8ETlQwY">UrlaubRest</field>
                                           </block>
                                         </value>
                                       </block>
                                     </next>
                                   </block>
                                 </next>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
                     </next>
                   </block>
                 </next>
               </block>
             </next>
           </block>
         </statement>
       </block>
      </xml>
      

      Wie schon gesagt ist das ein Auszug aus einem größeren Script.
      Sollte aber funktionieren.
      Datenpunkte Urlaub_1_Anfang und Urlaub_1_Ende müsstest Du vorher anlegen.
      Ich hoffe es hilft Dir etwas weiter.

      Grüße

      posted in Blockly
      rantanplan
      rantanplan
    • RE: [Vorlage] Servicemeldungen Volume2

      @looxer01
      Perfekt!!!!
      Konnte zwar keine "Leere Batterie" mehr erzeugen, weil die alten Batterien wohl jetzt komplett leer sind, aber dafür kam die Meldung "Fehlstellung Ventil".

      Neue Batterien rein und alles gut!
      Ich gehe davon aus das das mein ENDbericht ist.

      Vielen lieben Dank für den super Support!!!!

      Grüße

      posted in Skripten / Logik
      rantanplan
      rantanplan
    • RE: [Vorlage] Servicemeldungen Volume2

      @looxer01 sagte in [Vorlage] Servicemeldungen Volume2:

      @rantanplan
      kannst du die folgende Tabelle austauschen ?

      Habe ich gemacht.
      Sieht gut aus!

      Scipt-Meldung:

      [
       {
         "datum_seit": "20.03.25 13:12:21 Uhr",
         "meldungsart": "FAULT_REPORTING-6_ALARM",
         "common_name": "Wohnzimmer-VD-Regal",
         "GeraeteId": "OEQ2637929",
         "status": 1,
         "status_message_Lang": "20.03.25 13:12:21 Uhr - FAULT_REPORTING-6_ALARM - Wohnzimmer-VD-Regal - (OEQ2637929) - 1 - Batterie niedrig - Batteriebezeichnung: 2x LR6/AA",
         "status_message_Pure": "Batterie niedrig - Batteriebezeichnung: 2x LR6/AA",
         "batterie_bezeichnung": "2x LR6/AA",
         "SM_aufgehoben_seit": "aktiv",
         "DataPoint": "hm-rpc.0.OEQ2637929.4.FAULT_REPORTING-6_ALARM"
       }
      ]
      


      Telegram hat aber nichts gemeldet.
      Liegt das eventuell daran, dass die Meldung schon vorhanden war?

      Hier das aktuelle Log
      ServicemeldungenSystemLog.csv

      Ich mache jetzt nochmal Batteriewechsel und melde mich danach.

      Grüße

      posted in Skripten / Logik
      rantanplan
      rantanplan
    • RE: [Vorlage] Servicemeldungen Volume2

      @looxer01 sagte in [Vorlage] Servicemeldungen Volume2:

      @rantanplan
      ich habe eine neue Version gebaut und hoffe, dass es jetzt ok ist.

      Du solltest jetzt eine lowbat message erhalten für dieses gerät.

      für alle anderen messages (Ventilstellung etc) erhälts du "Fault Messages"

      Irgendetwas hakt noch. (Sorry)

      Leztes Script gestartet.
      Leere Batterien noch im Gerät.
      CCU3 zeigt "Leere Batterie"
      Script JSONAktuelleSM "Keine passende Meldung......."

      [
       {
         "datum_seit": "20.03.25 13:12:21 Uhr",
         "meldungsart": "FAULT_REPORTING-6_ALARM",
         "common_name": "Wohnzimmer-VD-Regal",
         "GeraeteId": "OEQ2637929",
         "status": 1,
         "status_message_Lang": "20.03.25 13:12:21 Uhr - FAULT_REPORTING-6_ALARM - Wohnzimmer-VD-Regal - (OEQ2637929) - 1 - Keine passende Meldung fuer MessageType: \"FAULT_REPORTING-6_ALARM\", Adapter: \"hm-rpc\", Status: \"1\". - Batteriebezeichnung: 2x LR6/AA",
         "status_message_Pure": "Keine passende Meldung fuer MessageType: \"FAULT_REPORTING-6_ALARM\", Adapter: \"hm-rpc\", Status: \"1\". - Batteriebezeichnung: 2x LR6/AA",
         "batterie_bezeichnung": "2x LR6/AA",
         "SM_aufgehoben_seit": "aktiv",
         "DataPoint": "hm-rpc.0.OEQ2637929.4.FAULT_REPORTING-6_ALARM"
       }
      ]
      


      Über Telegram kam keine Meldung!!!

      Hier das LOG.
      ServicemeldungenSystemLog.csv

      Grüße

      posted in Skripten / Logik
      rantanplan
      rantanplan
    • RE: [Vorlage] Servicemeldungen Volume2

      @looxer01
      Nach dem Script-Start wird "Einstellbereich Ventil zu gross" gemeldet
      Auf der CCU3 keine Servicemeldung.

      Hier das Log.
      ServicemeldungenSystemLog.csv

      Habe auch mal das andere Log aktiviert.
      ServicemeldungenVol2.csv

      Sehe gerade, dass "FAULT_REPORTING-6_ALARM" in ioBroker tatsächlich auf '2' steht. Warum auch immer.
      CCU3 sagt "alles ok".

      Tausche jetzt nochmal die Batterien.

      posted in Skripten / Logik
      rantanplan
      rantanplan
    • RE: [Vorlage] Servicemeldungen Volume2

      @looxer01 sagte in [Vorlage] Servicemeldungen Volume2:

      @rantanplan
      ignoriere die voherige message.

      Zu spät😊

      Mit leeren Batterien kam die Meldung ".....Ventil blockiert"

      Damit meine "Arbeit" nicht umsonst war, hier das Log.😬
      ServicemeldungenSystemLog.csv

      Probiere jetzt Dein geändertes Script.

      posted in Skripten / Logik
      rantanplan
      rantanplan
    • RE: [Vorlage] Servicemeldungen Volume2

      @looxer01
      Ich habe mal im Script debugLevel auf 2 gesetzt.
      GeraeteId steht bei mir auf false.

      Dann habe ich neue Batterien eingesetzt.
      Meldung auf der CCU3 weg.

      Dann wieder die alten Batterien eingesetzt.
      Systemmeldung auf der CCU3 "Leere Batterie"

      Hier das LOG.
      ServicemeldungenSystemLog.csv

      Aktuell sind noch die leeren Batterien drin.
      Sieht so aus:


      Bild_1.png

      Object Daten WZ-VD-Regal:4.FAULT_REPORTING

      {
       "type": "state",
       "common": {
         "def": 0,
         "type": "number",
         "read": true,
         "write": false,
         "min": 0,
         "max": 7,
         "states": {
           "0": "NO_FAULT",
           "1": "VALVE_TIGHT",
           "2": "ADJUSTING_RANGE_TOO_LARGE",
           "3": "ADJUSTING_RANGE_TOO_SMALL",
           "4": "COMMUNICATION_ERROR",
           "5": "",
           "6": "LOWBAT",
           "7": "VALVE_ERROR_POSITION"
         },
         "role": "indicator",
         "name": "WZ-VD-Regal:4.FAULT_REPORTING"
       },
       "native": {
         "CONTROL": "NONE",
         "DEFAULT": 0,
         "FLAGS": 9,
         "ID": "FAULT_REPORTING",
         "MAX": 7,
         "MIN": 0,
         "OPERATIONS": 5,
         "TAB_ORDER": 1,
         "TYPE": "ENUM",
         "UNIT": "",
         "VALUE_LIST": [
           "NO_FAULT",
           "VALVE_TIGHT",
           "ADJUSTING_RANGE_TOO_LARGE",
           "ADJUSTING_RANGE_TOO_SMALL",
           "COMMUNICATION_ERROR",
           "",
           "LOWBAT",
           "VALVE_ERROR_POSITION"
         ]
       },
       "from": "system.adapter.hm-rega.0",
       "user": "system.user.admin",
       "ts": 1740918410792,
       "_id": "hm-rpc.0.OEQ2637929.4.FAULT_REPORTING",
       "acl": {
         "object": 1636,
         "state": 1636,
         "owner": "system.user.admin",
         "ownerGroup": "system.group.administrator"
       }
      }
      

      Object Daten WZ-VD-Regal:4.FAULT_REPORTING-6_ALARM

      {
       "type": "state",
       "common": {
         "name": "WZ-VD-Regal:4.FAULT_REPORTING-6_ALARM",
         "type": "number",
         "role": "indicator.alarm",
         "read": true,
         "write": true,
         "def": 0,
         "states": {
           "0": "NO ALARM",
           "1": "ALARM",
           "2": "ACKNOWLEDGED"
         }
       },
       "native": {
         "Name": "WZ-VD-Regal:4.FAULT_REPORTING-6_ALARM",
         "TypeName": "ALARM",
         "DP": "16978"
       },
       "from": "system.adapter.hm-rega.0",
       "user": "system.user.admin",
       "ts": 1548955628248,
       "_id": "hm-rpc.0.OEQ2637929.4.FAULT_REPORTING-6_ALARM",
       "acl": {
         "object": 1636,
         "state": 1636,
         "owner": "system.user.admin",
         "ownerGroup": "system.group.administrator"
       }
      }
      

      Was kann ich noch tun?

      Grüße

      posted in Skripten / Logik
      rantanplan
      rantanplan
    • RE: [Vorlage] Servicemeldungen Volume2

      @looxer01 Hallo

      Ich habe hier eine Servicemeldung die Dein Script nicht mitbekommt.

      Bei dem Gerät handelt es sich um ein HM-Classic "HM-CC-RT-DN".
      Die Servicemeldung lautet: "Leere Batterie".

      In Deinem Script habe ich mal folgendes hinzugefügt.

      //ErrorMessages fuer HM-Classic Geraet (Heizung) - Sonderfaelle
      const faultMessages = {
          'HM-CC-RT-DN': {
              0: 'keine Stoerung',
              1: 'Ventil blockiert',
              2: 'Einstellbereich Ventil zu gross',
              3: 'Einstellbereich Ventil zu klein',
              4: 'Kommunikationsfehler',
              6: 'Spannung Batterien/Akkus gering',
              7: 'Fehlstellung Ventil',
      	8: 'Leere Batterie'       //von mir hinzugefügt !!!
          }
      };
      

      Hat aber nichts gebracht. (Vielleicht weil die Meldung schon vorhanden ist?)

      Grüße

      posted in Skripten / Logik
      rantanplan
      rantanplan
    • RE: [Vorlage] Servicemeldungen Volume2

      @looxer01 sagte in [Vorlage] Servicemeldungen Volume2:

      Nimm die Auskommentierung zurück. Dann sollte es gehen.

      Das war es. Läuft nun perfekt.
      Danke.

      Grüße

      posted in Skripten / Logik
      rantanplan
      rantanplan
    • RE: [Vorlage] Servicemeldungen Volume2

      @looxer01 Hi

      "Kommunikation gestört" werden doch nicht von der CCU gelöscht.
      Bei Sabotage Meldungen klappt es einwandfrei.

      Im Script habe ich {key: 'Sticky_unreach_alarm".... auskommentiert.
      Sonst nur meine üblichen Parameter gesetzt.

      Grüße

      posted in Skripten / Logik
      rantanplan
      rantanplan
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    The ioBroker Community 2014-2023
    logo