Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [gelöst] Zigbee Überwachung via Blockly

    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

    [gelöst] Zigbee Überwachung via Blockly

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

      @Kueppert
      Die Abfrage auf die Zeitdifferenz muss in die Schleife.

      K 1 Reply Last reply Reply Quote 0
      • K
        Kueppert @paul53 last edited by

        @paul53 meinst du so:
        654c8a0d-7f55-4ea6-a963-117f4bb70a5a-image.png

        Hab jetzt ne Fehlermeldung bekommen:

        	warn	javascript.0 (538) at Object.<anonymous> (script.js.common.Sonstiges.Status_letzte_Aktualisierung:15:44)
        
        paul53 1 Reply Last reply Reply Quote 0
        • paul53
          paul53 @Kueppert last edited by paul53

          @Kueppert sagte

          Nein, so:

          Blockly_temp.JPG

          K 1 Reply Last reply Reply Quote 0
          • K
            Kueppert @paul53 last edited by

            @paul53 hm, hab wieder neue Fehlermeldungen

            2b4ef8cc-c09e-48c8-ba17-0f3ab0675e3c-image.png

            18:35:11.704	error	javascript.0 (538) script.js.common.Sonstiges.Status_letzte_Aktualisierung: TypeError: Cannot read property 'length' of undefined
            18:35:11.704	error	javascript.0 (538) at script.js.common.Sonstiges.Status_letzte_Aktualisierung:23:11
            18:35:11.705	error	javascript.0 (538) at script.js.common.Sonstiges.Status_letzte_Aktualisierung:30:3
            
            paul53 1 Reply Last reply Reply Quote 0
            • paul53
              paul53 @Kueppert last edited by paul53

              @Kueppert sagte:

              hab wieder neue Fehlermeldungen

              Der falls-Block mit telegram gehört in den Zeitplan unter die Schleife (s. mein Bild).

              K 1 Reply Last reply Reply Quote 1
              • K
                Kueppert @paul53 last edited by Kueppert

                @paul53 sorry, bin vor lauter Bearbeitung ganz blind geworden. Danke dir 🙂 Dann warte ich mal ab, ob es klappt. Ein Sensor ist definitiv seit 1 Monat offline ^^

                5fa50499-3ace-480a-b483-a33042127fc7-image.png

                1 Reply Last reply Reply Quote 0
                • K
                  Kueppert last edited by Kueppert

                  *** GELÖST ***

                  So,
                  für alle die ggf. danach suchen anbei das fertige Blockly:

                  bb504086-2a6e-44e4-a06e-ca1da9f3e1a7-image.png

                  Der Javaskript-Blockly beinhaltet folgenden Code:

                  return getObject(id.substring(0, id.lastIndexOf('.'))).common.name;
                  

                  Blockly-Export:

                  <xml xmlns="https://developers.google.com/blockly/xml">
                    <variables>
                      <variable id="Hxgr,3rW59z?c[p:m55!">id</variable>
                      <variable id="J}Gnjc[$U]~GgxsXotr)">tage</variable>
                      <variable id="GQCJ-ywGYI:D%^3R]1zy">Namen</variable>
                      <variable id="jk_f9Bsj*{k?NKo`D5g(">differenz</variable>
                      <variable id="^fQ?5!9i6[PA6I~$jq?*">i</variable>
                    </variables>
                    <block type="procedures_defcustomreturn" id="?)C+XJ:/T[|h7CJ#).Lc" x="337" y="63">
                      <mutation statements="false">
                        <arg name="id" varid="Hxgr,3rW59z?c[p:m55!"></arg>
                      </mutation>
                      <field name="NAME">getParentName</field>
                      <field name="SCRIPT">cmV0dXJuIGdldE9iamVjdChpZC5zdWJzdHJpbmcoMCwgaWQubGFzdEluZGV4T2YoJy4nKSkpLmNvbW1vbi5uYW1lOw0KDQovL3JldHVybiBnZXRPYmplY3QoaWQpLmNvbW1vbi5uYW1l</field>
                      <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                    </block>
                    <block type="variables_set" id="{^-0S#IiV#S#+`s7t;j;" x="22" y="81">
                      <field name="VAR" id="J}Gnjc[$U]~GgxsXotr)">tage</field>
                      <value name="VALUE">
                        <block type="math_number" id="NtZtYH@mPbRNCcm%.!O0">
                          <field name="NUM">2</field>
                        </block>
                      </value>
                      <next>
                        <block type="schedule" id="D3V$+;;O($)#o16sY9jL">
                          <field name="SCHEDULE">*/5 * * * *</field>
                          <statement name="STATEMENT">
                            <block type="variables_set" id="VU4J0DT0q;}1,``D{dBE">
                              <field name="VAR" id="GQCJ-ywGYI:D%^3R]1zy">Namen</field>
                              <value name="VALUE">
                                <block type="text" id="deb5rSpqc9d4C[E=K1`T">
                                  <field name="TEXT"></field>
                                </block>
                              </value>
                              <next>
                                <block type="variables_set" id=":GT*_Z9OU[RtXTywPw*^">
                                  <field name="VAR" id="jk_f9Bsj*{k?NKo`D5g(">differenz</field>
                                  <value name="VALUE">
                                    <block type="math_arithmetic" id="[RU,:k0s]X2:w*((]2,?">
                                      <field name="OP">MULTIPLY</field>
                                      <value name="A">
                                        <shadow type="math_number" id="-;S7NqYJ;k!Y%zs;xO6D">
                                          <field name="NUM">1</field>
                                        </shadow>
                                        <block type="variables_get" id="Nd-`50-Stf(ly^gV4!0H">
                                          <field name="VAR" id="J}Gnjc[$U]~GgxsXotr)">tage</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <shadow type="math_number" id="N4{?!TT}Vl0nO_^xmbMB">
                                          <field name="NUM">86400000</field>
                                        </shadow>
                                      </value>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="controls_forEach" id="%ZUL,hL5JdgS*s;w1[Y4">
                                      <field name="VAR" id="^fQ?5!9i6[PA6I~$jq?*">i</field>
                                      <value name="LIST">
                                        <block type="selector" id="XG$Hl55rP5Q.wN(Y|-a_">
                                          <field name="TEXT">state[id=zigbee.0.*.link_quality]</field>
                                        </block>
                                      </value>
                                      <statement name="DO">
                                        <block type="controls_if" id="t+/u-1wx-dpU;79:ZI6!">
                                          <value name="IF0">
                                            <block type="logic_compare" id="lhj)!bvO}E:TNr*Szp@+" inline="false">
                                              <field name="OP">GT</field>
                                              <value name="A">
                                                <block type="math_arithmetic" id="I)ThU^Z_e{xml5;xZxj.">
                                                  <field name="OP">MINUS</field>
                                                  <value name="A">
                                                    <shadow type="math_number" id="L3XLA#qmwLTP4|c:UF^{">
                                                      <field name="NUM">1</field>
                                                    </shadow>
                                                    <block type="time_get" id="W1EXN}bTY=s/7n:.P^W`">
                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                      <field name="OPTION">object</field>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <shadow type="math_number" id="_L{#0p5k5BXWf^Tij!zq">
                                                      <field name="NUM">1</field>
                                                    </shadow>
                                                    <block type="variables_get" id="OU:65s4*PC89O@Fu{4[U">
                                                      <field name="VAR" id="jk_f9Bsj*{k?NKo`D5g(">differenz</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="get_value_var" id="Db0M1=*/jWOrdy1oqC@n">
                                                  <field name="ATTR">ts</field>
                                                  <value name="OID">
                                                    <shadow type="text" id="!)hz[%)c:tf;pQW9-Z{C">
                                                      <field name="TEXT"></field>
                                                    </shadow>
                                                    <block type="variables_get" id="28]O6g7kc4E.!hNFx=*0">
                                                      <field name="VAR" id="^fQ?5!9i6[PA6I~$jq?*">i</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <statement name="DO0">
                                            <block type="variables_set" id="E+e|wvC1Di,taMrerrfs">
                                              <field name="VAR" id="GQCJ-ywGYI:D%^3R]1zy">Namen</field>
                                              <value name="VALUE">
                                                <block type="text_join" id=".jHkp#s7a+!79P]}siFt">
                                                  <mutation items="3"></mutation>
                                                  <value name="ADD0">
                                                    <block type="variables_get" id="%UJ$nh%tH69sTzpQ=5X^">
                                                      <field name="VAR" id="GQCJ-ywGYI:D%^3R]1zy">Namen</field>
                                                    </block>
                                                  </value>
                                                  <value name="ADD1">
                                                    <block type="procedures_callcustomreturn" id="*$ts29/9F}?n@hoGbmfS">
                                                      <mutation name="getParentName">
                                                        <arg name="id"></arg>
                                                      </mutation>
                                                      <value name="ARG0">
                                                        <block type="variables_get" id="u/QZXqTi_FT:6Z$)e[x)">
                                                          <field name="VAR" id="^fQ?5!9i6[PA6I~$jq?*">i</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <value name="ADD2">
                                                    <block type="text_newline" id="TF{w[(Qt{PzLI2:RlX-H">
                                                      <field name="Type">\n</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                            </block>
                                          </statement>
                                        </block>
                                      </statement>
                                      <next>
                                        <block type="debug" id="mv5[gr$eRnX%]9f{InZ.">
                                          <field name="Severity">log</field>
                                          <value name="TEXT">
                                            <shadow type="text" id="`G:cXrbpWICu?.!0m/xl">
                                              <field name="TEXT">test</field>
                                            </shadow>
                                            <block type="variables_get" id="QE~=rd{D_)VkU,~#g+zI">
                                              <field name="VAR" id="GQCJ-ywGYI:D%^3R]1zy">Namen</field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="controls_if" id="IX}i.n9Z$8Oh7RnZ`_GS">
                                              <value name="IF0">
                                                <block type="logic_compare" id="y%mgm]jySOCJn5UJ?R]h">
                                                  <field name="OP">GT</field>
                                                  <value name="A">
                                                    <block type="text_length" id="IQul02DUhqp:8vi^={XP">
                                                      <value name="VALUE">
                                                        <shadow type="text" id="Y3nXhm`ji,cLy*@!Amcq">
                                                          <field name="TEXT">abc</field>
                                                        </shadow>
                                                        <block type="variables_get" id="Ao_|9Whl}FgM:}@t:#h{">
                                                          <field name="VAR" id="GQCJ-ywGYI:D%^3R]1zy">Namen</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <block type="math_number" id="E+vohsdRwSwSZz8#ZBj9">
                                                      <field name="NUM">0</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <statement name="DO0">
                                                <block type="telegram" id="e/Yf#38+yVzNcIn?dUnK">
                                                  <field name="INSTANCE"></field>
                                                  <field name="LOG"></field>
                                                  <field name="SILENT">FALSE</field>
                                                  <field name="PARSEMODE">default</field>
                                                  <value name="MESSAGE">
                                                    <shadow type="text" id="xXm}h]MuLh=Nz4r7v3TN">
                                                      <field name="TEXT">text</field>
                                                    </shadow>
                                                    <block type="text_join" id="*+n0G`a,MXHl7|IQN1{j">
                                                      <mutation items="3"></mutation>
                                                      <value name="ADD0">
                                                        <block type="text" id="D]+8_PT@|=D,!(7BMN$0">
                                                          <field name="TEXT">2 Tage keine Änderung bei</field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD1">
                                                        <block type="text_newline" id=":UcndGsUc~[AMw_%5,Y}">
                                                          <field name="Type">\n</field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD2">
                                                        <block type="variables_get" id="xq{`=O2WVDtd0p=FXR}X">
                                                          <field name="VAR" id="GQCJ-ywGYI:D%^3R]1zy">Namen</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                </block>
                                              </statement>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </statement>
                        </block>
                      </next>
                    </block>
                  </xml>
                  

                  Danke @paul53 für die Hilfe. Thread schließe ich hiermit.

                  VG Thorsten

                  Skyx3 1 Reply Last reply Reply Quote 0
                  • Skyx3
                    Skyx3 @Kueppert last edited by

                    @kueppert
                    Vielen Dank für das Teilen des Skriptes.

                    Meine Frage bezieht sich auf den Javaskript-Code.
                    Ich muss leider noch eine Ebene höher, um den richtigen Namen auszugeben und probiere hier schon den ganzen Tag rum und bekomme es nicht hin. Bei mir ist der Aufbau Gerätename/info/Datumsobjekt.

                    Ohne dein Skript bekomme ich nur "Datumsobjekt" als Name ausgeworfen, mit Deinem "info" nur brauche ich den Gerätenamen, noch eins drüber.

                    Grüße

                    paul53 1 Reply Last reply Reply Quote 1
                    • paul53
                      paul53 @Skyx3 last edited by

                      @skyx3 sagte: Gerätenamen, noch eins drüber.

                      Also den grandparentName?

                      id = id.substring(0, id.lastIndexOf('.'));
                      return getObject(id.substring(0, id.lastIndexOf('.'))).common.name;
                      
                      Skyx3 1 Reply Last reply Reply Quote 1
                      • Skyx3
                        Skyx3 @paul53 last edited by

                        @paul53
                        WOW das ging fix und es funktioniert. Vielen Dank für Deine Hilfe 🙂

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        547
                        Online

                        31.9k
                        Users

                        80.2k
                        Topics

                        1.3m
                        Posts

                        blockly monitoring
                        3
                        11
                        941
                        Loading More Posts
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes
                        Reply
                        • Reply as topic
                        Log in to reply
                        Community
                        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                        The ioBroker Community 2014-2023
                        logo