Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Blockly Skript HILFE!

    NEWS

    • Neues Video "KI im Smart Home" - ioBroker plus n8n

    • Neues Video über Aliase, virtuelle Geräte und Kategorien

    • Wir empfehlen: Node.js 22.x

    Blockly Skript HILFE!

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

      @Homoran sagte):

      @paul53 wird mir schon die Leviten lesen

      Ja, für einen Fehler, der Dir nicht mehr passieren sollte: Trigger auf einen Wert ?

      Homoran 1 Reply Last reply Reply Quote 0
      • Homoran
        Homoran Global Moderator Administrators @paul53 last edited by Homoran

        @paul53 sagte in Blockly Skript HILFE!:

        Trigger auf einen Wert ?

        Ääähm
        Was ist denn da passiert

        nee, so war das wirklich nicht gemeint - Sorry!

        Dämliches C&P
        MAC_finden_02.png
        so muss es

        marcuskl paul53 2 Replies Last reply Reply Quote 0
        • marcuskl
          marcuskl @Homoran last edited by

          @Homoran funktioniert danke 🙂

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

            @Homoran sagte in Blockly Skript HILFE!:

            so muss es

            Ich gehe mal davon aus, dass der Datenpunkt einen JSON-String enthält. Dann kann man es so ähnlich machen, wie @Homoran vorgeschlagen hat.

            Blockly_temp.JPG

            Zur Erläuterung:
            Die Variable Vorhanden ist 0 bei "nicht gefunden" und > 0 bei "gefunden"
            nicht nicht Vorhanden wandelt alle Werte <> 0 nach true und den Wert 0 nach false.

            <xml xmlns="http://www.w3.org/1999/xhtml">
             <variables>
               <variable type="" id="Fy9)NJ*Ri:E`D+MB6J*f">MAC</variable>
               <variable type="" id="Gq+hJ(]M`1q4wk?WuJ31">Vorhanden</variable>
             </variables>
             <block type="variables_set" id="9$1@9m;7SV$`bj)P@X=U" x="137" y="239">
               <field name="VAR" id="Fy9)NJ*Ri:E`D+MB6J*f" variabletype="">MAC</field>
               <value name="VALUE">
                 <block type="text" id="[4IW*L=|_Zw4,CpyWGs`">
                   <field name="TEXT">7e:82:14:a7:67:64</field>
                 </block>
               </value>
               <next>
                 <block type="on_ext" id="xc-DsF{ac!rVre7_uoQi">
                   <mutation items="1"></mutation>
                   <field name="CONDITION">ne</field>
                   <field name="ACK_CONDITION"></field>
                   <value name="OID0">
                     <shadow type="field_oid" id="Fr:Ep{+?+wkP4]a#}3rG">
                       <field name="oid">default</field>
                     </shadow>
                   </value>
                   <statement name="STATEMENT">
                     <block type="variables_set" id="VG?0Zr#Q@]7+#w:Fad!d">
                       <field name="VAR" id="Gq+hJ(]M`1q4wk?WuJ31" variabletype="">Vorhanden</field>
                       <value name="VALUE">
                         <block type="text_indexOf" id="sgIH(vOqM{-sQocl]GMW">
                           <field name="END">FIRST</field>
                           <value name="VALUE">
                             <block type="on_source" id="5./8v/8wMV{yFATu)oNK">
                               <field name="ATTR">state.val</field>
                             </block>
                           </value>
                           <value name="FIND">
                             <shadow type="text" id="Ua3tgy@JGu7#jTxWWB0H">
                               <field name="TEXT">abc</field>
                             </shadow>
                             <block type="variables_get" id="}=oG^:2Vj|=n9T.Si;sA">
                               <field name="VAR" id="Fy9)NJ*Ri:E`D+MB6J*f" variabletype="">MAC</field>
                             </block>
                           </value>
                         </block>
                       </value>
                       <next>
                         <block type="update" id=")w,I?.Zz+a/v5GJ@%UnW">
                           <mutation delay_input="false"></mutation>
                           <field name="OID">Object ID</field>
                           <field name="WITH_DELAY">FALSE</field>
                           <value name="VALUE">
                             <block type="logic_negate" id="7*{{jb}$p/`G!G$WSj^j">
                               <value name="BOOL">
                                 <block type="logic_negate" id="/]MSH9:MdQx=N,h$G]6v">
                                   <value name="BOOL">
                                     <block type="variables_get" id="GBqZ^Tv3@`LFJU`VSdM?">
                                       <field name="VAR" id="Gq+hJ(]M`1q4wk?WuJ31" variabletype="">Vorhanden</field>
                                     </block>
                                   </value>
                                 </block>
                               </value>
                             </block>
                           </value>
                         </block>
                       </next>
                     </block>
                   </statement>
                 </block>
               </next>
             </block>
             <block type="comment" id="%=d[,A+5G-[+dy/E)3^e" x="363" y="263">
               <field name="COMMENT">Datenpunkt</field>
             </block>
            </xml>
            

            Homoran 1 Reply Last reply Reply Quote 0
            • Homoran
              Homoran Global Moderator Administrators @paul53 last edited by

              @paul53 sagte in Blockly Skript HILFE!:

              Zur Erläuterung:
              Die Variable Vorhanden ist 0 bei "nicht gefunden" und > 0 bei "gefunden"
              nicht nicht Vorhanden wandelt alle Werte <> 0 nach true und den Wert 0 nach false.

              und die muss nicht zur Sicherheit wieder auf 0 gesetzt werden, damit beim nächsten Durchlauf auch alles stimmt?

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

                @Homoran sagte:

                die muss nicht zur Sicherheit wieder auf 0 gesetzt werden, damit beim nächsten Durchlauf auch alles stimmt?

                Nein, die Position im String wird jedesmal wieder neu ermittelt und wird bei "nicht vorhanden" automatisch zu 0.

                Homoran 1 Reply Last reply Reply Quote 0
                • Homoran
                  Homoran Global Moderator Administrators @paul53 last edited by

                  @paul53 Danke!

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

                    @marcuskl sagte:

                    @Homoran funktioniert danke

                    Im Script von @Homoran bleibt der Datenpunkt-Wert immer auf true, wenn er einmal auf true gesetzt wurde.

                    marcuskl Homoran 2 Replies Last reply Reply Quote 0
                    • marcuskl
                      marcuskl @paul53 last edited by

                      @Homoran habe ein sonst setze objelt auf false gemacht.
                      So setzt es wenn nicht vorhanden auf false.

                      1 Reply Last reply Reply Quote 0
                      • Homoran
                        Homoran Global Moderator Administrators @paul53 last edited by

                        @paul53 sagte in Blockly Skript HILFE!:

                        Im Script von @Homoran bleibt der Datenpunkt-Wert immer auf true, wenn er einmal auf true gesetzt wurde.

                        so was hatte ich befürchtet - auch hier Danke!

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        728
                        Online

                        32.1k
                        Users

                        80.7k
                        Topics

                        1.3m
                        Posts

                        blockly javascript
                        3
                        16
                        673
                        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