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] Schreiben alter Werte funktioniert nicht

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    [Gelöst] Schreiben alter Werte funktioniert nicht

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

      Hallo,

      ich versuche bei einem Objekt (RGB LED) die aktuellen Werte in Variablen zu schreiben. Anschließend setze ich neue Werte um mittels der Variablen sie auf den Wert zuvor zu setzen. Leider klappt der letzte Schritt nicht. Die Variablen bleiben zur Laufzeit unverändert.
      Wo ist mein Fehler?
      LED.JPG

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id="?bm=lC3m:`88Pb=#]K6,">Lampe</variable>
          <variable id="W[@+jJ4~]*qf[E}#]8`.">Dimmer</variable>
          <variable id="4M|!x~Vt#)j0f;dLs)nA">RGB</variable>
        </variables>
        <block type="procedures_defnoreturn" id="d;U:-Qq|fc:Jx%fW.]NJ" x="38" y="63">
          <field name="NAME">output</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="debug" id="Y#3+[c_Bk%wVIoiWT5We">
              <field name="Severity">warn</field>
              <value name="TEXT">
                <shadow type="text" id="!-z^(J2L$Dk*AV?OV3hT">
                  <field name="TEXT">test</field>
                </shadow>
                <block type="variables_get" id="aG*dVejPWS+|W^v;q_lK">
                  <field name="VAR" id="?bm=lC3m:`88Pb=#]K6,">Lampe</field>
                </block>
              </value>
              <next>
                <block type="debug" id="2Z2H4l6L9Di#C!dbv7dW">
                  <field name="Severity">warn</field>
                  <value name="TEXT">
                    <shadow type="text" id="!-z^(J2L$Dk*AV?OV3hT">
                      <field name="TEXT">test</field>
                    </shadow>
                    <block type="variables_get" id="/w8(;`2rQHvU5K9~a|+5">
                      <field name="VAR" id="W[@+jJ4~]*qf[E}#]8`.">Dimmer</field>
                    </block>
                  </value>
                  <next>
                    <block type="debug" id="5[l5H2F|)Q.1@;f8-b45">
                      <field name="Severity">warn</field>
                      <value name="TEXT">
                        <shadow type="text" id="!-z^(J2L$Dk*AV?OV3hT">
                          <field name="TEXT">test</field>
                        </shadow>
                        <block type="variables_get" id="urrGI0deRnfyL*Z4U{-T">
                          <field name="VAR" id="4M|!x~Vt#)j0f;dLs)nA">RGB</field>
                        </block>
                      </value>
                      <next>
                        <block type="debug" id="Ah-7YV_*xyXg^U{GqfUt">
                          <field name="Severity">error</field>
                          <value name="TEXT">
                            <shadow type="text" id="!-z^(J2L$Dk*AV?OV3hT">
                              <field name="TEXT">test</field>
                            </shadow>
                          </value>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
        <block type="procedures_defnoreturn" id="u=CLh:kdv.#AiN3byBoi" x="288" y="63">
          <field name="NAME">set</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="variables_set" id="/+2cvh^1@E$w8{]tdn8z">
              <field name="VAR" id="?bm=lC3m:`88Pb=#]K6,">Lampe</field>
              <value name="VALUE">
                <block type="get_value" id="juGmbN=#omB^h/j^`u@z">
                  <field name="ATTR">val</field>
                  <field name="OID">tuya.0.bff8dc4831a92142125gnf.20</field>
                </block>
              </value>
              <next>
                <block type="variables_set" id="*F59U]0UMPhiZ:biCo-K">
                  <field name="VAR" id="W[@+jJ4~]*qf[E}#]8`.">Dimmer</field>
                  <value name="VALUE">
                    <block type="get_value" id="O-Lk=GgK]Qd@tMsA_{G1">
                      <field name="ATTR">val</field>
                      <field name="OID">tuya.0.bff8dc4831a92142125gnf.22</field>
                    </block>
                  </value>
                  <next>
                    <block type="variables_set" id="}xSlJOTO/l*n~H#{$!yH">
                      <field name="VAR" id="4M|!x~Vt#)j0f;dLs)nA">RGB</field>
                      <value name="VALUE">
                        <block type="get_value" id="(R54,)m6C(_EuCvAKu*F">
                          <field name="ATTR">val</field>
                          <field name="OID">tuya.0.bff8dc4831a92142125gnf.24-rgb</field>
                        </block>
                      </value>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
        <block type="procedures_defnoreturn" id=";21bxg7OTlzj9eSIb/dp" x="288" y="213">
          <field name="NAME">recall</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="control_ex" id="CVo_c=0__zt|wBhJv#-X" inline="true">
              <field name="TYPE">false</field>
              <field name="CLEAR_RUNNING">FALSE</field>
              <value name="OID">
                <shadow type="field_oid" id="*%6uYB~J{4aOE[Uc7`I=">
                  <field name="oid">tuya.0.bff8dc4831a92142125gnf.20</field>
                </shadow>
              </value>
              <value name="VALUE">
                <shadow type="logic_boolean" id="Dyn*G@7T3MlXl-^!#nCy">
                  <field name="BOOL">TRUE</field>
                </shadow>
                <block type="variables_get" id="L6Z;xSzFWAlvko1pG|mn">
                  <field name="VAR" id="?bm=lC3m:`88Pb=#]K6,">Lampe</field>
                </block>
              </value>
              <value name="DELAY_MS">
                <shadow type="math_number" id="SD1#;IWL*xrp;c,=EjmH">
                  <field name="NUM">0</field>
                </shadow>
              </value>
              <value name="EXPIRE">
                <shadow type="math_number" id="j!xh|s;muBBP_?xnd]6d">
                  <field name="NUM">0</field>
                </shadow>
              </value>
              <next>
                <block type="control_ex" id="[h*C^P3^~wMm:w9Ql7T@" inline="true">
                  <field name="TYPE">false</field>
                  <field name="CLEAR_RUNNING">FALSE</field>
                  <value name="OID">
                    <shadow type="field_oid" id="3)=p(-I_btAk7qZ#-V(!">
                      <field name="oid">tuya.0.bff8dc4831a92142125gnf.22</field>
                    </shadow>
                  </value>
                  <value name="VALUE">
                    <shadow type="logic_boolean" id="izT*nG+eO(u}ZcWzJe,]">
                      <field name="BOOL">TRUE</field>
                    </shadow>
                    <block type="variables_get" id="*vxBg%u[d/33mq`72NLt">
                      <field name="VAR" id="W[@+jJ4~]*qf[E}#]8`.">Dimmer</field>
                    </block>
                  </value>
                  <value name="DELAY_MS">
                    <shadow type="math_number" id=")YY-n58hNR:v[+bK$g4T">
                      <field name="NUM">0</field>
                    </shadow>
                  </value>
                  <value name="EXPIRE">
                    <shadow type="math_number" id="8uq15|LtM7[PFGjssQfm">
                      <field name="NUM">0</field>
                    </shadow>
                  </value>
                  <next>
                    <block type="control_ex" id="[tpqc=Lw9J$$5=6nmgWO" inline="true">
                      <field name="TYPE">false</field>
                      <field name="CLEAR_RUNNING">FALSE</field>
                      <value name="OID">
                        <shadow type="field_oid" id="D04gv~!e8/ds?Lz,UYLR">
                          <field name="oid">tuya.0.bff8dc4831a92142125gnf.24-rgb</field>
                        </shadow>
                      </value>
                      <value name="VALUE">
                        <shadow type="logic_boolean" id="lZ/N2MpT)~h2W}5cdY`@">
                          <field name="BOOL">TRUE</field>
                        </shadow>
                        <block type="variables_get" id="iVwZVD=W.%,n|:t0VxTW">
                          <field name="VAR" id="4M|!x~Vt#)j0f;dLs)nA">RGB</field>
                        </block>
                      </value>
                      <value name="DELAY_MS">
                        <shadow type="math_number" id="%_;blq:;WOe}9K#Kk4+(">
                          <field name="NUM">0</field>
                        </shadow>
                      </value>
                      <value name="EXPIRE">
                        <shadow type="math_number" id=":tz=kZ^G|Qai#Y9aefN6">
                          <field name="NUM">0</field>
                        </shadow>
                      </value>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
        <block type="procedures_callnoreturn" id="w5]n8W0V7uW|1~3b;CyU" x="63" y="363">
          <mutation name="set"></mutation>
          <next>
            <block type="procedures_callnoreturn" id="1p^ynXa;#r9[b4(.Cd2K">
              <mutation name="output"></mutation>
              <next>
                <block type="timeouts_wait" id="r4jU{[mWVn.?4}+1ZlX%">
                  <field name="DELAY">5000</field>
                  <field name="UNIT">ms</field>
                  <next>
                    <block type="procedures_callnoreturn" id="++T*_T-mI^zU^}CaPc*L">
                      <mutation name="write"></mutation>
                      <next>
                        <block type="procedures_callnoreturn" id="Lyc$T,671R@uJM;3~|eC">
                          <mutation name="output"></mutation>
                          <next>
                            <block type="timeouts_wait" id="QQy/c3r?n[PXu^]iZ}-H">
                              <field name="DELAY">5000</field>
                              <field name="UNIT">ms</field>
                              <next>
                                <block type="procedures_callnoreturn" id="zH-,WZ9!I@~EB%e(8=^U">
                                  <mutation name="recall"></mutation>
                                  <next>
                                    <block type="procedures_callnoreturn" id="up_+TE}P_B0b@d[0!Eou">
                                      <mutation name="output"></mutation>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </next>
        </block>
        <block type="procedures_defnoreturn" id="rGe.`tb9x7i9s$lR$jYm" x="288" y="438">
          <field name="NAME">write</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="control_ex" id=")uA47ejLlX$pW?sT.WOA" inline="true">
              <field name="TYPE">false</field>
              <field name="CLEAR_RUNNING">FALSE</field>
              <value name="OID">
                <shadow type="field_oid" id="nmS%:^}c5[DB=ks7W:~i">
                  <field name="oid">tuya.0.bff8dc4831a92142125gnf.20</field>
                </shadow>
              </value>
              <value name="VALUE">
                <shadow type="logic_boolean" id="t~2`td.E4cG8{NoDA$*r">
                  <field name="BOOL">TRUE</field>
                </shadow>
              </value>
              <value name="DELAY_MS">
                <shadow type="math_number" id="7DKh)/)g8S1Vs#[W=@K0">
                  <field name="NUM">0</field>
                </shadow>
              </value>
              <value name="EXPIRE">
                <shadow type="math_number" id="SUIG%^~-X1b4nw833zJ.">
                  <field name="NUM">0</field>
                </shadow>
              </value>
              <next>
                <block type="control_ex" id="_!%8b`kjJIJg;J;SLdTY" inline="true">
                  <field name="TYPE">false</field>
                  <field name="CLEAR_RUNNING">FALSE</field>
                  <value name="OID">
                    <shadow type="field_oid" id="Rl5L+eIl:EyY^G%]e6+)">
                      <field name="oid">tuya.0.bff8dc4831a92142125gnf.22</field>
                    </shadow>
                  </value>
                  <value name="VALUE">
                    <shadow type="logic_boolean" id="izT*nG+eO(u}ZcWzJe,]">
                      <field name="BOOL">TRUE</field>
                    </shadow>
                    <block type="math_number" id="u0J!f?wvD%myJuu3l=LS">
                      <field name="NUM">100</field>
                    </block>
                  </value>
                  <value name="DELAY_MS">
                    <shadow type="math_number" id="0GCpSLxix}PwW$!5QN`$">
                      <field name="NUM">0</field>
                    </shadow>
                  </value>
                  <value name="EXPIRE">
                    <shadow type="math_number" id="|uN/,TGDcgY6D*w%R:Jm">
                      <field name="NUM">0</field>
                    </shadow>
                  </value>
                  <next>
                    <block type="control_ex" id=":9rGHMp*8Pa+(E6X2sh]" inline="true">
                      <field name="TYPE">false</field>
                      <field name="CLEAR_RUNNING">FALSE</field>
                      <value name="OID">
                        <shadow type="field_oid" id="]ozGBeSwK9Nzta?AlJrf">
                          <field name="oid">tuya.0.bff8dc4831a92142125gnf.24-rgb</field>
                        </shadow>
                      </value>
                      <value name="VALUE">
                        <shadow type="logic_boolean" id="lZ/N2MpT)~h2W}5cdY`@">
                          <field name="BOOL">TRUE</field>
                        </shadow>
                        <block type="text" id="]dNyZ8bXjvp5_l`:z8h,">
                          <field name="TEXT">000000</field>
                        </block>
                      </value>
                      <value name="DELAY_MS">
                        <shadow type="math_number" id="YRRz)U:[XGKOxbo7y)q[">
                          <field name="NUM">0</field>
                        </shadow>
                      </value>
                      <value name="EXPIRE">
                        <shadow type="math_number" id="$pu;dq8;LmT.^Cv=wbT@">
                          <field name="NUM">0</field>
                        </shadow>
                      </value>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
      </xml>
      
      
      

      VG

      Krodon

      Lösung:

      Die LED hat die Variable work_mode, sie springt von colour auf white, wenn ich diese auch setze klappt es 🙂

      schalter.JPG

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

        @krodon wo sind da irgendwelche Trigger?

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

          @homoran wozu Trigger?
          Dies ist ein Testscript, dass das eigentliche Problem extrahiert.
          Die Funktionen werden außerhalb eines Triggers aufgerufen und werden nacheinander, bei jedem Neustart, ausgeführt.

          VG

          Krodon

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

            @krodon sagte in [Gelöst] Schreiben alter Werte funktioniert nicht:

            bei jedem Neustart,

            aber Variablen überleben keinen Neustart

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

              @homoran ist ja auch die Absicht, sonst hätte ich Datenpunkte genommen

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

              Support us

              ioBroker
              Community Adapters
              Donate

              829
              Online

              31.7k
              Users

              79.6k
              Topics

              1.3m
              Posts

              2
              5
              138
              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