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 Script, bitte um check ob das OK ist...

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Blockly Script, bitte um check ob das OK ist...

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

      Hallo, ich bin absolut neu in dem Blockly Thema.
      Habe nun ein script gebastelt, das ein ModBus register mit zwei Werten beschreibt, die abhängig von einem Gerätestatus sind.
      Hat auf Anhieb funktioniert. Nur ging das so verdächtig einfach, dass ich gerne einen Experten hätte der sich das anschaut und kurz Bescheid gibt ob das so OK ist oder was grundsätzliches fehlt.
      fa228c86-9663-4732-8dfb-32a5334c0ea0-grafik.png
      Vielen Dank !

      padrino dslraser 2 Replies Last reply Reply Quote 0
      • padrino
        padrino Most Active @Aiouh last edited by padrino

        @Aiouh
        Könntest aus "ist..." "geändert" machen.
        Dann ein "blaues" Falls Wert (aus trigger:Objekt id) = 'wahr" Schreibe1 sonst Schreibe2
        machen 🙂

        1 Reply Last reply Reply Quote 0
        • dslraser
          dslraser Forum Testing Most Active @Aiouh last edited by

          @Aiouh

          ich denke @padrino meint es so

          Bildschirmfoto 2020-02-17 um 20.09.26.png

          <xml xmlns="http://www.w3.org/1999/xhtml">
           <block type="on" id="Ha,bOObYr2ZR|EVc]N~K" x="137" y="12">
             <field name="OID">Object ID</field>
             <field name="CONDITION">ne</field>
             <field name="ACK_CONDITION"></field>
             <statement name="STATEMENT">
               <block type="controls_if" id="LHqE7G$Zjb#_#B^/g*,v">
                 <mutation else="1"></mutation>
                 <value name="IF0">
                   <block type="on_source" id="}x5T|RDUP2c7zGLfMyst">
                     <field name="ATTR">state.val</field>
                   </block>
                 </value>
                 <statement name="DO0">
                   <block type="control_ex" id="EFNapUbhiF^B`GcmEJH*">
                     <field name="TYPE">false</field>
                     <field name="CLEAR_RUNNING">FALSE</field>
                     <value name="OID">
                       <shadow type="field_oid" id="wRE%AeKlAWP9Nr/Z?fWf">
                         <field name="oid">Object ID</field>
                       </shadow>
                     </value>
                     <value name="VALUE">
                       <shadow type="logic_boolean" id="6GNhU+F+QR@L,b9G$:HR">
                         <field name="BOOL">TRUE</field>
                       </shadow>
                       <block type="math_number" id="x.F5S*@/KN4PJxcZ1C(;">
                         <field name="NUM">0</field>
                       </block>
                     </value>
                     <value name="DELAY_MS">
                       <shadow type="math_number" id="T7ac{bW3owvV*SEGfGxe">
                         <field name="NUM">500</field>
                       </shadow>
                     </value>
                   </block>
                 </statement>
                 <statement name="ELSE">
                   <block type="control_ex" id="hd~vbaZGznfIRR]0nq4U">
                     <field name="TYPE">false</field>
                     <field name="CLEAR_RUNNING">FALSE</field>
                     <value name="OID">
                       <shadow type="field_oid" id="RWm08NXoDv|)A8GIe[En">
                         <field name="oid">Object ID</field>
                       </shadow>
                     </value>
                     <value name="VALUE">
                       <shadow type="logic_boolean" id="2~=T5qO3@@%bhsAThxG#">
                         <field name="BOOL">TRUE</field>
                       </shadow>
                       <block type="math_number" id="Y_)t5q}JF%mz,ZzT`G:s">
                         <field name="NUM">4000</field>
                       </block>
                     </value>
                     <value name="DELAY_MS">
                       <shadow type="math_number" id="9zWZT;/fbZ(CA)etf1w|">
                         <field name="NUM">500</field>
                       </shadow>
                     </value>
                   </block>
                 </statement>
               </block>
             </statement>
           </block>
          </xml>
          

          padrino A 2 Replies Last reply Reply Quote 1
          • padrino
            padrino Most Active @dslraser last edited by

            @dslraser
            Yep, ist nur am Handy doof. 😅

            1 Reply Last reply Reply Quote 1
            • A
              Aiouh @dslraser last edited by

              @dslraser
              Danke,
              klappt bei mir noch nicht, bekomme ich aber sicher hin, die Idee ist klar.

              dslraser 1 Reply Last reply Reply Quote 0
              • dslraser
                dslraser Forum Testing Most Active @Aiouh last edited by

                @Aiouh
                ich habe Dir oben den Export rein gepackt, einfach importieren.

                A 1 Reply Last reply Reply Quote 0
                • A
                  Aiouh @dslraser last edited by

                  @dslraser
                  DANKE !

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

                  Support us

                  ioBroker
                  Community Adapters
                  Donate

                  594
                  Online

                  32.0k
                  Users

                  80.3k
                  Topics

                  1.3m
                  Posts

                  3
                  7
                  303
                  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