Navigation

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

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Hilfe bei Steuerung WLED

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

      Hallo, ichnhabe hier folgendes Problem:

      Ich habe ein Skript erstellt das wie folgt ablaufen soll

      Backofen wird eingeschaltet - LED Leuchte blau
      Backofen wird ausgeschaltet - LED ist aus
      Backofen Tür wird geöffnet - LED Leuchtet rot
      Backofentür wird geschlossen - LED ist aus Bzw. soll wieder auf blau Wechsel wenn der Backofen noch eigeschaltet ist.

      und genau hier liegt das Problem , soweit stimmen alle Abläufe (ausser das die LED nicht wieder in den blau zustand schaltet wenn der Backofen noch eingeschaltet ist)

      ich probiere seid einer Woche hin und her und finde keine Lösung . Bildschirmfoto 2023-06-19 um 12.01.12.png

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

        @tmischek
        Pro Datenpunkt immer nur einen Trigger verwenden (Ressourcen)!

        Blockly_temp.JPG

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

          @paul53 vielen dank, würdest du mir auch den code schicken? habe versucht das nachzubauen ohne erfolg , bin noch ziemlich unbedarft ich denke mir aber aller Anfang ist schwer .

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

            @tmischek sagte: code schicken?

            <xml xmlns="https://developers.google.com/blockly/xml">
             <variables>
               <variable id="@3I1[ojTf5.NM)#n9F#M">blau</variable>
               <variable id="/AEWVRh+Lt$Y9I@F87=k">rot</variable>
               <variable id="1-xNAHS],;f1hdyPO0MB">speak</variable>
             </variables>
             <block type="on" id="~*}7+xYP^,0H-)p~SCSG" x="63" y="66">
               <field name="OID">0_userdata.0.Blockly.Status</field>
               <field name="CONDITION">ne</field>
               <field name="ACK_CONDITION"></field>
               <statement name="STATEMENT">
                 <block type="variables_set" id="Oy03zN`/:}RHr3QVcf8*">
                   <field name="VAR" id="@3I1[ojTf5.NM)#n9F#M">blau</field>
                   <value name="VALUE">
                     <block type="on_source" id=":p/W$V84M6(``^N)Fiwc">
                       <field name="ATTR">state.val</field>
                     </block>
                   </value>
                   <next>
                     <block type="procedures_callnoreturn" id=")xt![a_^6-(%mi~oED4t">
                       <mutation name="LED"></mutation>
                       <next>
                         <block type="variables_set" id="z)w,TVV{,oj8l=1MEb7m">
                           <field name="VAR" id="1-xNAHS],;f1hdyPO0MB">speak</field>
                           <value name="VALUE">
                             <block type="logic_ternary" id="AUz+{@lxzKt1{Ws;:i$)">
                               <value name="IF">
                                 <block type="on_source" id=":9=Mz*9g;|=Wd7s~Mmu[">
                                   <field name="ATTR">state.val</field>
                                 </block>
                               </value>
                               <value name="THEN">
                                 <block type="text" id="95dhl(#0X6Nw|VDnDT~*">
                                   <field name="TEXT">Backofen eingeschaltet</field>
                                 </block>
                               </value>
                               <value name="ELSE">
                                 <block type="text" id="@0,9x!pubLaw3olbxtOV">
                                   <field name="TEXT">Backofen ausgeschaltet</field>
                                 </block>
                               </value>
                             </block>
                           </value>
                           <next>
                             <block type="control" id=":vgb:qMW0|4zK*ZFy)xK">
                               <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                               <field name="OID">Object ID</field>
                               <field name="WITH_DELAY">FALSE</field>
                               <value name="VALUE">
                                 <block type="variables_get" id="/-t0cr57]YD|-t:!27q7">
                                   <field name="VAR" id="1-xNAHS],;f1hdyPO0MB">speak</field>
                                 </block>
                               </value>
                             </block>
                           </next>
                         </block>
                       </next>
                     </block>
                   </next>
                 </block>
               </statement>
               <next>
                 <block type="on" id="eaW_bKnAgk]}(DPp,.^U">
                   <field name="OID">0_userdata.0.Blockly.Tuer</field>
                   <field name="CONDITION">ne</field>
                   <field name="ACK_CONDITION"></field>
                   <statement name="STATEMENT">
                     <block type="variables_set" id="0i0m@9.q(*u^-igP/#G[">
                       <field name="VAR" id="@3I1[ojTf5.NM)#n9F#M">blau</field>
                       <value name="VALUE">
                         <block type="logic_boolean" id="DWI)~Lh4dSyi?hHA8-31">
                           <field name="BOOL">FALSE</field>
                         </block>
                       </value>
                       <next>
                         <block type="variables_set" id="WrzyPTurM71yHNTV2#X(">
                           <field name="VAR" id="/AEWVRh+Lt$Y9I@F87=k">rot</field>
                           <value name="VALUE">
                             <block type="logic_boolean" id="D+OyfZSI;L7%}M0-pK:$">
                               <field name="BOOL">FALSE</field>
                             </block>
                           </value>
                           <next>
                             <block type="controls_if" id="S*hte.VCcrOE~rpT[4kn">
                               <mutation elseif="1"></mutation>
                               <value name="IF0">
                                 <block type="on_source" id="#RgE+UXOFa4zv.2ZX`wO">
                                   <field name="ATTR">state.val</field>
                                 </block>
                               </value>
                               <statement name="DO0">
                                 <block type="variables_set" id="i`uKl4]h0kSyE}~Ejkcu">
                                   <field name="VAR" id="/AEWVRh+Lt$Y9I@F87=k">rot</field>
                                   <value name="VALUE">
                                     <block type="logic_boolean" id="cpqPw*O~$ZgTHU})htkS">
                                       <field name="BOOL">TRUE</field>
                                     </block>
                                   </value>
                                 </block>
                               </statement>
                               <value name="IF1">
                                 <block type="get_value" id="%;7M(d^b1p2Uj,DKAe*k">
                                   <field name="ATTR">val</field>
                                   <field name="OID">0_userdata.0.Blockly.Status</field>
                                 </block>
                               </value>
                               <statement name="DO1">
                                 <block type="variables_set" id="Ag`wJ`}5z?$9_ejuBAnN">
                                   <field name="VAR" id="@3I1[ojTf5.NM)#n9F#M">blau</field>
                                   <value name="VALUE">
                                     <block type="logic_boolean" id=",tU1pQ|mwXH~zAD^xPD[">
                                       <field name="BOOL">TRUE</field>
                                     </block>
                                   </value>
                                 </block>
                               </statement>
                               <next>
                                 <block type="procedures_callnoreturn" id="Eh}U9t-+S~f!e=UpCWsi">
                                   <mutation name="LED"></mutation>
                                 </block>
                               </next>
                             </block>
                           </next>
                         </block>
                       </next>
                     </block>
                   </statement>
                 </block>
               </next>
             </block>
             <block type="procedures_defnoreturn" id="*y2p~o.ZG$.}DHl2EHoe" x="313" y="387">
               <field name="NAME">LED</field>
               <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
               <statement name="STACK">
                 <block type="control" id=",30v;$XzA*;HDK/zA0Ng">
                   <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                   <field name="OID">Object ID</field>
                   <field name="WITH_DELAY">FALSE</field>
                   <value name="VALUE">
                     <block type="variables_get" id="s;nYu{(Wcqy!)(0I@GS`">
                       <field name="VAR" id="/AEWVRh+Lt$Y9I@F87=k">rot</field>
                     </block>
                   </value>
                   <next>
                     <block type="control" id="N^@1WmGg}26NGv7z[|:t">
                       <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                       <field name="OID">Object ID</field>
                       <field name="WITH_DELAY">FALSE</field>
                       <value name="VALUE">
                         <block type="variables_get" id="Ef=drLc3F5^3dq9TVz~3">
                           <field name="VAR" id="@3I1[ojTf5.NM)#n9F#M">blau</field>
                         </block>
                       </value>
                     </block>
                   </next>
                 </block>
               </statement>
             </block>
            </xml>
            

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

              @paul53 das eigentliche Skript in Textform . so das ich die Bausteine importieren und passen kann

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

                @tmischek sagte: so das ich die Bausteine importieren und passen kann

                Das ist das XML-Format zum Importieren in Blockly.

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

                  @tmischek
                  Einfachere Version:

                  Blockly_temp.JPG

                  <xml xmlns="https://developers.google.com/blockly/xml">
                   <variables>
                     <variable id="/AEWVRh+Lt$Y9I@F87=k">rot</variable>
                     <variable id="@3I1[ojTf5.NM)#n9F#M">blau</variable>
                   </variables>
                   <block type="on" id="eaW_bKnAgk]}(DPp,.^U" x="62" y="-87">
                     <field name="OID">0_userdata.0.Blockly.Tuer</field>
                     <field name="CONDITION">ne</field>
                     <field name="ACK_CONDITION"></field>
                     <statement name="STATEMENT">
                       <block type="procedures_callnoreturn" id="Eh}U9t-+S~f!e=UpCWsi">
                         <mutation name="LED"></mutation>
                       </block>
                     </statement>
                     <next>
                       <block type="on" id="~*}7+xYP^,0H-)p~SCSG">
                         <field name="OID">0_userdata.0.Blockly.Status</field>
                         <field name="CONDITION">ne</field>
                         <field name="ACK_CONDITION"></field>
                         <statement name="STATEMENT">
                           <block type="procedures_callnoreturn" id=")xt![a_^6-(%mi~oED4t">
                             <mutation name="LED"></mutation>
                             <next>
                               <block type="control" id=":vgb:qMW0|4zK*ZFy)xK">
                                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                 <field name="OID">Object ID</field>
                                 <field name="WITH_DELAY">FALSE</field>
                                 <value name="VALUE">
                                   <block type="logic_ternary" id="AUz+{@lxzKt1{Ws;:i$)">
                                     <value name="IF">
                                       <block type="on_source" id=":9=Mz*9g;|=Wd7s~Mmu[">
                                         <field name="ATTR">state.val</field>
                                       </block>
                                     </value>
                                     <value name="THEN">
                                       <block type="text" id="95dhl(#0X6Nw|VDnDT~*">
                                         <field name="TEXT">Backofen eingeschaltet</field>
                                       </block>
                                     </value>
                                     <value name="ELSE">
                                       <block type="text" id="@0,9x!pubLaw3olbxtOV">
                                         <field name="TEXT">Backofen ausgeschaltet</field>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                               </block>
                             </next>
                           </block>
                         </statement>
                       </block>
                     </next>
                   </block>
                   <block type="procedures_defnoreturn" id="*y2p~o.ZG$.}DHl2EHoe" x="262" y="-37">
                     <field name="NAME">LED</field>
                     <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                     <statement name="STACK">
                       <block type="variables_set" id="c_ba-Bft:u=o|%(Tf};d">
                         <field name="VAR" id="/AEWVRh+Lt$Y9I@F87=k">rot</field>
                         <value name="VALUE">
                           <block type="get_value" id="WY~Y*2B/5Mh+BRaYQ|T;">
                             <field name="ATTR">val</field>
                             <field name="OID">0_userdata.0.Blockly.Tuer</field>
                           </block>
                         </value>
                         <next>
                           <block type="variables_set" id="KHN!jGp87NH~^E1Go%Al">
                             <field name="VAR" id="@3I1[ojTf5.NM)#n9F#M">blau</field>
                             <value name="VALUE">
                               <block type="logic_operation" id="0C1D-/YoeGmsOjU=:t[v" inline="false">
                                 <field name="OP">AND</field>
                                 <value name="A">
                                   <block type="get_value" id="kH{q]axh%imMNken/O0+">
                                     <field name="ATTR">val</field>
                                     <field name="OID">0_userdata.0.Blockly.Status</field>
                                   </block>
                                 </value>
                                 <value name="B">
                                   <block type="logic_negate" id="#WoMG,)T|?0hy;iUFvsZ">
                                     <value name="BOOL">
                                       <block type="variables_get" id="z{M~Nr*=%R.HDrWreGBO">
                                         <field name="VAR" id="/AEWVRh+Lt$Y9I@F87=k">rot</field>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                               </block>
                             </value>
                             <next>
                               <block type="control" id=",30v;$XzA*;HDK/zA0Ng">
                                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                 <field name="OID">Object ID</field>
                                 <field name="WITH_DELAY">FALSE</field>
                                 <value name="VALUE">
                                   <block type="variables_get" id="s;nYu{(Wcqy!)(0I@GS`">
                                     <field name="VAR" id="/AEWVRh+Lt$Y9I@F87=k">rot</field>
                                   </block>
                                 </value>
                                 <next>
                                   <block type="control" id="N^@1WmGg}26NGv7z[|:t">
                                     <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                     <field name="OID">Object ID</field>
                                     <field name="WITH_DELAY">FALSE</field>
                                     <value name="VALUE">
                                       <block type="variables_get" id="Ef=drLc3F5^3dq9TVz~3">
                                         <field name="VAR" id="@3I1[ojTf5.NM)#n9F#M">blau</field>
                                       </block>
                                     </value>
                                   </block>
                                 </next>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
                     </statement>
                   </block>
                  </xml>
                  

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

                    @paul53 vielen dank für die mühe , mir ist nicht klar welche Variablen in den gekennzeichneten Bereichen eingetragen werden sollenBildschirmfoto 2023-06-19 um 13.51.23.png

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

                      @tmischek sagte: mir ist nicht klar welche Variablen

                      Frage zu WLED: Ist blau = 1 (set / preset) und rot = 4? Eingeschaltet wird über "On / Off"?
                      Falls ja, dann mache es so:

                      Blockly_temp.JPG

                      <xml xmlns="https://developers.google.com/blockly/xml">
                       <variables>
                         <variable id="/AEWVRh+Lt$Y9I@F87=k">farbe</variable>
                         <variable id="@3I1[ojTf5.NM)#n9F#M">ein</variable>
                       </variables>
                       <block type="on" id="eaW_bKnAgk]}(DPp,.^U" x="62" y="-87">
                         <field name="OID">0_userdata.0.Blockly.Tuer</field>
                         <field name="CONDITION">ne</field>
                         <field name="ACK_CONDITION"></field>
                         <statement name="STATEMENT">
                           <block type="procedures_callnoreturn" id="Eh}U9t-+S~f!e=UpCWsi">
                             <mutation name="LED"></mutation>
                           </block>
                         </statement>
                         <next>
                           <block type="on" id="~*}7+xYP^,0H-)p~SCSG">
                             <field name="OID">0_userdata.0.Blockly.Status</field>
                             <field name="CONDITION">ne</field>
                             <field name="ACK_CONDITION"></field>
                             <statement name="STATEMENT">
                               <block type="procedures_callnoreturn" id=")xt![a_^6-(%mi~oED4t">
                                 <mutation name="LED"></mutation>
                                 <next>
                                   <block type="control" id=":vgb:qMW0|4zK*ZFy)xK">
                                     <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                     <field name="OID">Object ID</field>
                                     <field name="WITH_DELAY">FALSE</field>
                                     <value name="VALUE">
                                       <block type="logic_ternary" id="AUz+{@lxzKt1{Ws;:i$)">
                                         <value name="IF">
                                           <block type="on_source" id=":9=Mz*9g;|=Wd7s~Mmu[">
                                             <field name="ATTR">state.val</field>
                                           </block>
                                         </value>
                                         <value name="THEN">
                                           <block type="text" id="95dhl(#0X6Nw|VDnDT~*">
                                             <field name="TEXT">Backofen eingeschaltet</field>
                                           </block>
                                         </value>
                                         <value name="ELSE">
                                           <block type="text" id="@0,9x!pubLaw3olbxtOV">
                                             <field name="TEXT">Backofen ausgeschaltet</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                   </block>
                                 </next>
                               </block>
                             </statement>
                           </block>
                         </next>
                       </block>
                       <block type="procedures_defnoreturn" id="*y2p~o.ZG$.}DHl2EHoe" x="263" y="-87">
                         <field name="NAME">LED</field>
                         <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                         <statement name="STACK">
                           <block type="variables_set" id="c_ba-Bft:u=o|%(Tf};d">
                             <field name="VAR" id="/AEWVRh+Lt$Y9I@F87=k">farbe</field>
                             <value name="VALUE">
                               <block type="logic_ternary" id="S6+JzDi(viZL*a_WEKPq">
                                 <value name="IF">
                                   <block type="get_value" id="WY~Y*2B/5Mh+BRaYQ|T;">
                                     <field name="ATTR">val</field>
                                     <field name="OID">0_userdata.0.Blockly.Tuer</field>
                                   </block>
                                 </value>
                                 <value name="THEN">
                                   <block type="math_number" id="0$%i#3/?y2#$1,@g}/F}">
                                     <field name="NUM">4</field>
                                   </block>
                                 </value>
                                 <value name="ELSE">
                                   <block type="math_number" id="9gC-6M5#iDVA+1#=/O~s">
                                     <field name="NUM">1</field>
                                   </block>
                                 </value>
                               </block>
                             </value>
                             <next>
                               <block type="variables_set" id="KHN!jGp87NH~^E1Go%Al">
                                 <field name="VAR" id="@3I1[ojTf5.NM)#n9F#M">ein</field>
                                 <value name="VALUE">
                                   <block type="logic_operation" id="0C1D-/YoeGmsOjU=:t[v" inline="false">
                                     <field name="OP">OR</field>
                                     <value name="A">
                                       <block type="get_value" id="kH{q]axh%imMNken/O0+">
                                         <field name="ATTR">val</field>
                                         <field name="OID">0_userdata.0.Blockly.Status</field>
                                       </block>
                                     </value>
                                     <value name="B">
                                       <block type="logic_compare" id=",rP/qCwywor)LO$s}@,[">
                                         <field name="OP">EQ</field>
                                         <value name="A">
                                           <block type="variables_get" id="z{M~Nr*=%R.HDrWreGBO">
                                             <field name="VAR" id="/AEWVRh+Lt$Y9I@F87=k">farbe</field>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <block type="math_number" id="R0=SeY;?]`lfa1X$V(P9">
                                             <field name="NUM">4</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                                 <next>
                                   <block type="control" id=",30v;$XzA*;HDK/zA0Ng">
                                     <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                     <field name="OID">Object ID</field>
                                     <field name="WITH_DELAY">FALSE</field>
                                     <value name="VALUE">
                                       <block type="variables_get" id="s;nYu{(Wcqy!)(0I@GS`">
                                         <field name="VAR" id="/AEWVRh+Lt$Y9I@F87=k">farbe</field>
                                       </block>
                                     </value>
                                     <next>
                                       <block type="control" id="N^@1WmGg}26NGv7z[|:t">
                                         <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                         <field name="OID">Object ID</field>
                                         <field name="WITH_DELAY">FALSE</field>
                                         <value name="VALUE">
                                           <block type="variables_get" id="Ef=drLc3F5^3dq9TVz~3">
                                             <field name="VAR" id="@3I1[ojTf5.NM)#n9F#M">ein</field>
                                           </block>
                                         </value>
                                       </block>
                                     </next>
                                   </block>
                                 </next>
                               </block>
                             </next>
                           </block>
                         </statement>
                       </block>
                      </xml>
                      

                      "LED" ist eine Funktion, "farbe" und "ein" sind selbst erstellte Variablen.

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

                      Support us

                      ioBroker
                      Community Adapters
                      Donate

                      689
                      Online

                      32.0k
                      Users

                      80.4k
                      Topics

                      1.3m
                      Posts

                      2
                      9
                      202
                      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