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 für Dummy gesucht (gelöst)

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Hilfe für Dummy gesucht (gelöst)

    This topic has been deleted. Only users with topic management privileges can see it.
    • Asgothian
      Asgothian Developer @ps1304 last edited by

      @ps1304 Ja, dann nimm den Baustein.
      Screenshot 2021-06-17 at 14.55.43.png

      Umbenennen sollte einfach sein. Über das Zahnrad kannst du auch den "Übergabeparameter" UV Index definieren.Screenshot 2021-06-17 at 14.55.08.png

      A.

      1 Reply Last reply Reply Quote 0
      • P
        ps1304 last edited by

        @asgothian perfekt Danke für Deine Hilfe und "Motivation" :-)) - habe mal etwas gebastelt und getestet. Warte mal heute den Tag ab, ob das jetzt so funktioniert.

        Das ist jetzt mein Bloky Script
        Blocky-UV-neu.PNG
        Das Objekt "uv-index" beinhaltet die Zahl des UV-Wertes und wird per 2.tem Script gefüllt
        Das Objekt "uv-text" wird mit dem Blocky berechnet und gefüllt

        Mal schauen ob das so läuft

        BBTown 1 Reply Last reply Reply Quote 0
        • BBTown
          BBTown @ps1304 last edited by

          @ps1304
          wenn Du den Datenpunkt "UV-index" schreibfähig machst ("write" = "true") dann kannst Du das auch testen indem Du manuell Werte einträgst

          P 1 Reply Last reply Reply Quote 0
          • P
            ps1304 @BBTown last edited by

            @bbtown hab ich gestern auch schon probiert - danke trotzdem. Das Script funktioniert :-))

            UV-Index.png

            Horst Böttcher Asgothian 2 Replies Last reply Reply Quote 0
            • Horst Böttcher
              Horst Böttcher @ps1304 last edited by

              @ps1304
              Ich ab schon vor Tagen versucht etwas ähnliches zu machen

              <xml xmlns="https://developers.google.com/blockly/xml">
                <variables>
                  <variable id="=^M8DHr?F3o8992onF=}">UV-Wert</variable>
                  <variable id="Qk1eJXH})rn~U0!-L?a,">UV-Text</variable>
                </variables>
                <block type="on_ext" id="W(z,yg-Ow^f7t{8WQK(s" x="-88" y="-62">
                  <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                  <field name="CONDITION">ne</field>
                  <field name="ACK_CONDITION"></field>
                  <value name="OID0">
                    <shadow type="field_oid" id="E?[HmCB=0[zmvV},7AEX">
                      <field name="oid">openuv.0.UV</field>
                    </shadow>
                  </value>
                  <statement name="STATEMENT">
                    <block type="variables_set" id="]qaB]m_Yc-OjQ*Gk,ax]">
                      <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                      <value name="VALUE">
                        <block type="field_oid" id="970QW1O:HdPiSIX-~SyE">
                          <field name="oid">openuv.0.UV</field>
                        </block>
                      </value>
                      <next>
                        <block type="controls_if" id="~j(!-iB/(W{x-w];CU%!" collapsed="true">
                          <value name="IF0">
                            <block type="logic_compare" id="w|,#7kYfgC{6)M-gf$Uk">
                              <field name="OP">LTE</field>
                              <value name="A">
                                <block type="variables_get" id="+lIBZWO|,6^BK+Q?P.O">
                                  <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                </block>
                              </value>
                              <value name="B">
                                <block type="math_number" id="LEx,%HhAw#ccBEPP(v1b">
                                  <field name="NUM">2</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <statement name="DO0">
                            <block type="variables_set" id="b-lOXQ^1?%h(b,E!x;3r">
                              <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                              <value name="VALUE">
                                <block type="text" id="RS{m|vjt~Vm2y?CYh(.">
                                  <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#C0FFA0; text-align:center;"&gt;0–2&lt;/td&gt;                 &lt;td&gt;niedrig&lt;/td&gt;                 &lt;td&gt;Kein Schutz erforderlich.                 &lt;/td&gt;&lt;/tr&gt;</field>
                                </block>
                              </value>
                            </block>
                          </statement>
                          <next>
                            <block type="controls_if" id="KoQO160P*4oN$4^@?nNp" collapsed="true">
                              <value name="IF0">
                                <block type="logic_compare" id="$eZ?.YAkm~bEp+h+w]gs">
                                  <field name="OP">LTE</field>
                                  <value name="A">
                                    <block type="variables_get" id=".13r0{C67=xSeH,7x$Bu">
                                      <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <block type="math_number" id="HJr,Ly?CF7cw2grc{HF_">
                                      <field name="NUM">5</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <statement name="DO0">
                                <block type="variables_set" id="rP~[TTmnAL*sGDKD3o@1">
                                  <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                  <value name="VALUE">
                                    <block type="text" id="(d0%*O9JE}@mrr.-3[gv">
                                      <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#F8F040; text-align:center;"&gt;3–5&lt;/td&gt;                 &lt;td&gt;mäßig&lt;/td&gt;                 &lt;td&gt;Schutz erforderlich: Hut, T-Shirt, Sonnenbrille, Sonnencreme                 &lt;/td&gt;&lt;/tr&gt;</field>
                                    </block>
                                  </value>
                                </block>
                              </statement>
                              <next>
                                <block type="controls_if" id="P#IQTmD,zx*1Afe.N+@x" collapsed="true">
                                  <value name="IF0">
                                    <block type="logic_compare" id="Sz_cu})85D~1E,/MHaF1">
                                      <field name="OP">LTE</field>
                                      <value name="A">
                                        <block type="variables_get" id="ZjNx~U=Np42A6$$bvge=">
                                          <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <block type="math_number" id="3)8EF{g./R;q,sjm4h@O">
                                          <field name="NUM">7</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <statement name="DO0">
                                    <block type="variables_set" id="#/,!3jwQbulyWS4J}H3(">
                                      <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                      <value name="VALUE">
                                        <block type="text" id="q~n/yM+Y/!LLH{1l?ap">
                                          <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#F87820; text-align:center;"&gt;6–7&lt;/td&gt;                 &lt;td&gt;hoch&lt;/td&gt;                 &lt;td&gt;Schutz erforderlich: Hut, T-Shirt, Sonnenbrille, Sonnencreme.&lt;br&gt; Mittagssonne meiden.                 &lt;/td&gt;&lt;/tr&gt;</field>
                                        </block>
                                      </value>
                                    </block>
                                  </statement>
                                  <next>
                                    <block type="controls_if" id="5aY6UDu1g(*_,~8y0)Z[" collapsed="true">
                                      <value name="IF0">
                                        <block type="logic_compare" id="JJm@T!hf4IfCa7YvZ/*w">
                                          <field name="OP">LTE</field>
                                          <value name="A">
                                            <block type="variables_get" id="Mh}Hdf#:%VJ;P:TrFi%P">
                                              <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <block type="math_number" id="MGFd}fUFz[D3x8TXGe3%">
                                              <field name="NUM">10</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <statement name="DO0">
                                        <block type="variables_set" id="y-)%r2HB6!^GOIm2/40q">
                                          <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                          <value name="VALUE">
                                            <block type="text" id="79M;KP(7:`,R1=iKOPdo">
                                              <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#D80020; text-align:center;"&gt;8–10&lt;/td&gt;                 &lt;td&gt;sehr hoch&lt;/td&gt;                 &lt;td&gt;zusätzlicher Schutz erforderlich: Aufenthalt im Freien möglichst vermeiden&lt;br&gt;                 &lt;p&gt;Den Aufenthalt im Freien zwischen 11 und 15 Uhr vermeiden; auch im Schatten gehören ein sonnendichtes Oberteil, lange Hosen, Sonnencreme, Sonnenbrille und ein breitkrempiger Hut zum sonnengerechten Verhalten.                 &lt;/p&gt;                 &lt;/td&gt;&lt;/tr&gt;</field>
                                            </block>
                                          </value>
                                        </block>
                                      </statement>
                                      <next>
                                        <block type="controls_if" id="LMpBq7kdOi+%%6{3-0%m" collapsed="true">
                                          <value name="IF0">
                                            <block type="logic_compare" id="}_I?*{?[DIl_.@dPkYu)">
                                              <field name="OP">LTE</field>
                                              <value name="A">
                                                <block type="variables_get" id="zLI]@$|?ml3_wNKO)v8@">
                                                  <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="math_number" id="#AbcvOG19]fPmt6Bt#?G">
                                                  <field name="NUM">11</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <statement name="DO0">
                                            <block type="variables_set" id="y!2guum{^*z|e/^r]!lN">
                                              <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                              <value name="VALUE">
                                                <block type="text" id=")%/Z3Z)tLv)C*wAL7Z%D">
                                                  <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#A80080; text-align:center;"&gt;≥ 11&lt;/td&gt;                 &lt;td&gt;extrem&lt;/td&gt;                 &lt;td&gt;zusätzlicher Schutz erforderlich: Aufenthalt im Freien möglichst vermeiden&lt;br&gt;                 &lt;p&gt;Die WHO rät, zwischen 11 und 15 Uhr im Schutz eines Hauses zu bleiben und auch außerhalb dieser Zeit unbedingt Schatten zu suchen. Auch im Schatten gelten ein sonnendichtes Oberteil, lange Hosen, Sonnencreme, Sonnenbrille und ein breitkrempiger Hut als unerlässlich.                 &lt;/p&gt;                 &lt;/td&gt;&lt;/tr&gt;</field>
                                                </block>
                                              </value>
                                            </block>
                                          </statement>
                                          <next>
                                            <block type="control_ex" id=".V|0VVOY)Pf$w!21)S+L">
                                              <field name="TYPE">true</field>
                                              <field name="CLEAR_RUNNING">TRUE</field>
                                              <value name="OID">
                                                <shadow type="field_oid" id="lnv)UkZ70(0@KYW:f(Qj">
                                                  <field name="oid">0_userdata.0.Eigenescripte.uv</field>
                                                </shadow>
                                              </value>
                                              <value name="VALUE">
                                                <shadow type="logic_boolean" id=";;ei{w51%hYrLQU6!~ZH">
                                                  <field name="BOOL">TRUE</field>
                                                </shadow>
                                                <block type="variables_get" id="3$%I1Ju.xh%}W#dn)-+0">
                                                  <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                                </block>
                                              </value>
                                              <value name="DELAY_MS">
                                                <shadow type="math_number" id="(,_HlvXu1sk5?*OcLZ@">
                                                  <field name="NUM">100</field>
                                                </shadow>
                                              </value>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </statement>
                </block>
              </xml>
              

              in der objekten komme ich nur die meldung
              d5efd6c97704ef78990f27a725a29ebf.png

              paul53 P 2 Replies Last reply Reply Quote 0
              • paul53
                paul53 @Horst Böttcher last edited by paul53

                @horst-böttcher sagte: versucht etwas ähnliches zu machen

                UV-Wert muss den Wert (unter "Trigger") des Datenpunktes erhalten, nicht die ID. Die Prüfung muss in dieser Reihenfolge auf > erfolgen, nicht auf <=.

                Bild_2021-06-18_172101.png

                <xml xmlns="https://developers.google.com/blockly/xml">
                 <variables>
                   <variable id="=^M8DHr?F3o8992onF=}">UV-Wert</variable>
                   <variable id="Qk1eJXH})rn~U0!-L?a,">UV-Text</variable>
                 </variables>
                 <block type="on_ext" id="W(z,yg-Ow^f7t{8WQK(s" x="-88" y="-62">
                   <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                   <field name="CONDITION">ne</field>
                   <field name="ACK_CONDITION"></field>
                   <value name="OID0">
                     <shadow type="field_oid" id="E?[HmCB=0[zmvV},7AEX">
                       <field name="oid">openuv.0.UV</field>
                     </shadow>
                   </value>
                   <statement name="STATEMENT">
                     <block type="variables_set" id="]qaB]m_Yc-OjQ*Gk,ax]">
                       <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                       <value name="VALUE">
                         <block type="on_source" id="J}T{tJY(4iwQMYA.60$5">
                           <field name="ATTR">state.val</field>
                         </block>
                       </value>
                       <next>
                         <block type="variables_set" id="b-lOXQ^1?%h(b,E!x;3r">
                           <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                           <value name="VALUE">
                             <block type="text" id="RS{m|vjt~Vm2y?CYh(.">
                               <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#C0FFA0; text-align:center;"&gt;0–2&lt;/td&gt;                 &lt;td&gt;niedrig&lt;/td&gt;                 &lt;td&gt;Kein Schutz erforderlich.                 &lt;/td&gt;&lt;/tr&gt;</field>
                             </block>
                           </value>
                           <next>
                             <block type="controls_if" id="~j(!-iB/(W{x-w];CU%!">
                               <value name="IF0">
                                 <block type="logic_compare" id="w|,#7kYfgC{6)M-gf$Uk">
                                   <field name="OP">GT</field>
                                   <value name="A">
                                     <block type="variables_get" id="+lIBZWO|,6^BK+Q?P.O">
                                       <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                     </block>
                                   </value>
                                   <value name="B">
                                     <block type="math_number" id="LEx,%HhAw#ccBEPP(v1b">
                                       <field name="NUM">2</field>
                                     </block>
                                   </value>
                                 </block>
                               </value>
                               <statement name="DO0">
                                 <block type="variables_set" id="rP~[TTmnAL*sGDKD3o@1">
                                   <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                   <value name="VALUE">
                                     <block type="text" id="(d0%*O9JE}@mrr.-3[gv">
                                       <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#F8F040; text-align:center;"&gt;3–5&lt;/td&gt;                 &lt;td&gt;mäßig&lt;/td&gt;                 &lt;td&gt;Schutz erforderlich: Hut, T-Shirt, Sonnenbrille, Sonnencreme                 &lt;/td&gt;&lt;/tr&gt;</field>
                                     </block>
                                   </value>
                                 </block>
                               </statement>
                               <next>
                                 <block type="controls_if" id="KoQO160P*4oN$4^@?nNp">
                                   <value name="IF0">
                                     <block type="logic_compare" id="$eZ?.YAkm~bEp+h+w]gs">
                                       <field name="OP">GT</field>
                                       <value name="A">
                                         <block type="variables_get" id=".13r0{C67=xSeH,7x$Bu">
                                           <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                         </block>
                                       </value>
                                       <value name="B">
                                         <block type="math_number" id="HJr,Ly?CF7cw2grc{HF_">
                                           <field name="NUM">5</field>
                                         </block>
                                       </value>
                                     </block>
                                   </value>
                                   <statement name="DO0">
                                     <block type="variables_set" id="#/,!3jwQbulyWS4J}H3(">
                                       <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                       <value name="VALUE">
                                         <block type="text" id="q~n/yM+Y/!LLH{1l?ap">
                                           <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#F87820; text-align:center;"&gt;6–7&lt;/td&gt;                 &lt;td&gt;hoch&lt;/td&gt;                 &lt;td&gt;Schutz erforderlich: Hut, T-Shirt, Sonnenbrille, Sonnencreme.&lt;br&gt; Mittagssonne meiden.                 &lt;/td&gt;&lt;/tr&gt;</field>
                                         </block>
                                       </value>
                                     </block>
                                   </statement>
                                   <next>
                                     <block type="controls_if" id="P#IQTmD,zx*1Afe.N+@x">
                                       <value name="IF0">
                                         <block type="logic_compare" id="Sz_cu})85D~1E,/MHaF1">
                                           <field name="OP">GT</field>
                                           <value name="A">
                                             <block type="variables_get" id="ZjNx~U=Np42A6$$bvge=">
                                               <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                             </block>
                                           </value>
                                           <value name="B">
                                             <block type="math_number" id="3)8EF{g./R;q,sjm4h@O">
                                               <field name="NUM">7</field>
                                             </block>
                                           </value>
                                         </block>
                                       </value>
                                       <statement name="DO0">
                                         <block type="variables_set" id="y-)%r2HB6!^GOIm2/40q">
                                           <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                           <value name="VALUE">
                                             <block type="text" id="79M;KP(7:`,R1=iKOPdo">
                                               <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#D80020; text-align:center;"&gt;8–10&lt;/td&gt;                 &lt;td&gt;sehr hoch&lt;/td&gt;                 &lt;td&gt;zusätzlicher Schutz erforderlich: Aufenthalt im Freien möglichst vermeiden&lt;br&gt;                 &lt;p&gt;Den Aufenthalt im Freien zwischen 11 und 15 Uhr vermeiden; auch im Schatten gehören ein sonnendichtes Oberteil, lange Hosen, Sonnencreme, Sonnenbrille und ein breitkrempiger Hut zum sonnengerechten Verhalten.                 &lt;/p&gt;                 &lt;/td&gt;&lt;/tr&gt;</field>
                                             </block>
                                           </value>
                                         </block>
                                       </statement>
                                       <next>
                                         <block type="controls_if" id="5aY6UDu1g(*_,~8y0)Z[">
                                           <value name="IF0">
                                             <block type="logic_compare" id="JJm@T!hf4IfCa7YvZ/*w">
                                               <field name="OP">GT</field>
                                               <value name="A">
                                                 <block type="variables_get" id="Mh}Hdf#:%VJ;P:TrFi%P">
                                                   <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                                 </block>
                                               </value>
                                               <value name="B">
                                                 <block type="math_number" id="MGFd}fUFz[D3x8TXGe3%">
                                                   <field name="NUM">10</field>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                           <statement name="DO0">
                                             <block type="variables_set" id="y!2guum{^*z|e/^r]!lN">
                                               <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                               <value name="VALUE">
                                                 <block type="text" id=")%/Z3Z)tLv)C*wAL7Z%D">
                                                   <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#A80080; text-align:center;"&gt;≥ 11&lt;/td&gt;                 &lt;td&gt;extrem&lt;/td&gt;                 &lt;td&gt;zusätzlicher Schutz erforderlich: Aufenthalt im Freien möglichst vermeiden&lt;br&gt;                 &lt;p&gt;Die WHO rät, zwischen 11 und 15 Uhr im Schutz eines Hauses zu bleiben und auch außerhalb dieser Zeit unbedingt Schatten zu suchen. Auch im Schatten gelten ein sonnendichtes Oberteil, lange Hosen, Sonnencreme, Sonnenbrille und ein breitkrempiger Hut als unerlässlich.                 &lt;/p&gt;                 &lt;/td&gt;&lt;/tr&gt;</field>
                                                 </block>
                                               </value>
                                             </block>
                                           </statement>
                                           <next>
                                             <block type="control_ex" id=".V|0VVOY)Pf$w!21)S+L">
                                               <field name="TYPE">true</field>
                                               <field name="CLEAR_RUNNING">TRUE</field>
                                               <value name="OID">
                                                 <shadow type="field_oid" id="lnv)UkZ70(0@KYW:f(Qj">
                                                   <field name="oid">0_userdata.0.Eigenescripte.uv</field>
                                                 </shadow>
                                               </value>
                                               <value name="VALUE">
                                                 <shadow type="logic_boolean" id=";;ei{w51%hYrLQU6!~ZH">
                                                   <field name="BOOL">TRUE</field>
                                                 </shadow>
                                                 <block type="variables_get" id="3$%I1Ju.xh%}W#dn)-+0">
                                                   <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                                 </block>
                                               </value>
                                               <value name="DELAY_MS">
                                                 <shadow type="math_number" id="(,_HlvXu1sk5?*OcLZ@">
                                                   <field name="NUM">100</field>
                                                 </shadow>
                                               </value>
                                             </block>
                                           </next>
                                         </block>
                                       </next>
                                     </block>
                                   </next>
                                 </block>
                               </next>
                             </block>
                           </next>
                         </block>
                       </next>
                     </block>
                   </statement>
                 </block>
                </xml>
                

                1 Reply Last reply Reply Quote 1
                • Asgothian
                  Asgothian Developer @ps1304 last edited by

                  @ps1304 sagte in Hilfe für Dummy gesucht:

                  @bbtown hab ich gestern auch schon probiert - danke trotzdem. Das Script funktioniert :-))

                  Freut mich das es funktioniert. Ich hoffe das das selber Bauen Dir auch etwas gebracht hat. Wenn du deinem Post jetzt noch ein [gelöst] mitgeben kannst wäre das toll 🙂

                  A.

                  P 1 Reply Last reply Reply Quote 0
                  • P
                    ps1304 @Asgothian last edited by

                    @asgothian gerne - wie macht man das ?

                    1 Reply Last reply Reply Quote 0
                    • P
                      ps1304 @Horst Böttcher last edited by

                      @horst-böttcher bei mir funktioniert das Blocky jetzt. Folgendes Setup:
                      2 Datenpunkte: uv-index und uv-text
                      Den DP uv-index befülle ich mit einem anderen Script
                      Das aktuelle UV-Text Blocky als Bild und Code:
                      Blocky-UV-neu.PNG


                      <xml xmlns="https://developers.google.com/blockly/xml">
                      <variables>
                      <variable id="=^M8DHr?F3o8992onF=}">UV-Wert</variable>
                      <variable id="Qk1eJXH})rn~U0!-L?a,">UV-Text</variable>
                      </variables>
                      <block type="comment" id="K.rfIskkC92GV5jo[=B" x="13" y="-2937">
                      <field name="COMMENT">Schleife zur Berechnung des Schutz-Textes</field>
                      </block>
                      <block type="procedures_defreturn" id="{E{kBl$;YA
                      0QmyXKcW" x="13" y="-2912">
                      <mutation>
                      <arg name="UV-Wert" varid="=^M8DHr?F3o8992onF=}"></arg>
                      </mutation>
                      <field name="NAME">UV-Text berechnen</field>
                      <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                      <statement name="STACK">
                      <block type="variables_set" id="sGgM;C,DVf+d
                      kr(|,y)">
                      <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                      <value name="VALUE">
                      <block type="text" id="RS{m|vjt~Vm2y?CYh(.">
                      <field name="TEXT">Kein Schutz notwendig oder bei (Null) keine Daten vorhanden</field>
                      </block>
                      </value>
                      <next>
                      <block type="controls_if" id="~j(!-iB/(W{x-w];CU%!">
                      <value name="IF0">
                      <block type="logic_compare" id="w|,#7kYfgC{6)M-gf$Uk">
                      <field name="OP">GT</field>
                      <value name="A">
                      <block type="variables_get" id="+lIBZWO|,6^BK+Q?P.O">
                      <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                      </block>
                      </value>
                      <value name="B">
                      <block type="math_number" id="LEx,%HhAw#ccBEPP(v1b">
                      <field name="NUM">2</field>
                      </block>
                      </value>
                      </block>
                      </value>
                      <statement name="DO0">
                      <block type="variables_set" id="b-lOXQ^1?%h(b,E!x;3r">
                      <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                      <value name="VALUE">
                      <block type="text" id="(d0%O9JE}@mrr.-3[gv">
                      <field name="TEXT">Schutz erforderlich: Hut, T-Shirt, Sonnenbrille, Sonnencreme</field>
                      </block>
                      </value>
                      </block>
                      </statement>
                      <next>
                      <block type="controls_if" id="KoQO160P
                      4oN$4^@?nNp">
                      <value name="IF0">
                      <block type="logic_compare" id="$eZ?.YAkm~bEp+h+w]gs">
                      <field name="OP">GT</field>
                      <value name="A">
                      <block type="variables_get" id=".13r0{C67=xSeH,7x$Bu">
                      <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                      </block>
                      </value>
                      <value name="B">
                      <block type="math_number" id="HJr,Ly?CF7cw2grc{HF_">
                      <field name="NUM">5</field>
                      </block>
                      </value>
                      </block>
                      </value>
                      <statement name="DO0">
                      <block type="variables_set" id="rP~[TTmnALsGDKD3o@1">
                      <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                      <value name="VALUE">
                      <block type="text" id="q~n/yM+Y/!LLH{1l?ap">
                      <field name="TEXT">Schutz erforderlich: Hut, T-Shirt, Sonnenbrille, Sonnencreme. Die WHO empfiehlt, mittags den Schatten zu suchen. </field>
                      </block>
                      </value>
                      </block>
                      </statement>
                      <next>
                      <block type="controls_if" id="P#IQTmD,zx
                      1Afe.N+@x">
                      <value name="IF0">
                      <block type="logic_compare" id="Sz_cu})85D~1E,/MHaF1">
                      <field name="OP">GT</field>
                      <value name="A">
                      <block type="variables_get" id="ZjNx~U=Np42A6$$bvge=">
                      <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                      </block>
                      </value>
                      <value name="B">
                      <block type="math_number" id="3)8EF{g./R;q,sjm4h@O">
                      <field name="NUM">7</field>
                      </block>
                      </value>
                      </block>
                      </value>
                      <statement name="DO0">
                      <block type="variables_set" id="#/,!3jwQbulyWS4J}H3(">
                      <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                      <value name="VALUE">
                      <block type="text" id="6[7:R|~91D6.15?%xg#">
                      <field name="TEXT">zusätzlicher Schutz erforderlich: Aufenthalt im Freien möglichst vermeiden Die WHO empfiehlt, den Aufenthalt im Freien zwischen 11 und 15 Uhr zu vermeiden; auch im Schatten gehören ein sonnendichtes Oberteil, lange Hosen, Sonnencreme, Sonnenbrille und ein breitkrempiger Hut zum sonnengerechten Verhalten. </field>
                      </block>
                      </value>
                      </block>
                      </statement>
                      <next>
                      <block type="controls_if" id="-o:-WW!*|kol6I$NuB5D">
                      <value name="IF0">
                      <block type="logic_compare" id="dP{+mRH2=I}1vQixDmJ"> <field name="OP">GT</field> <value name="A"> <block type="variables_get" id="NyQLu-Y]7@5^qjU^=@p-"> <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field> </block> </value> <value name="B"> <block type="math_number" id="^X|BbvE)jUeyrZt!441R"> <field name="NUM">11</field> </block> </value> </block> </value> <statement name="DO0"> <block type="variables_set" id="AIO/FMg1?{O,J.+Cn!G!"> <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field> <value name="VALUE"> <block type="text" id="fnTfvmXh#Zp~b2%Othul"> <field name="TEXT">zusätzlicher Schutz erforderlich: Aufenthalt im Freien möglichst vermeiden Die WHO rät, zwischen 11 und 15 Uhr im Schutz eines Hauses zu bleiben und auch außerhalb dieser Zeit unbedingt Schatten zu suchen. Auch im Schatten gelten ein sonnendichtes Oberteil, lange Hosen, Sonnencreme, Sonnenbrille und ein breitkrempiger Hut als unerlässlich. </field> </block> </value> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <value name="RETURN"> <block type="variables_get" id="Fx5J|,2m0gb+_O^^+Xk">
                      <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                      </block>
                      </value>
                      </block>
                      <block type="comment" id="0:
                      PN#0$+C8o]zCNrzf" x="13" y="-2487"> <field name="COMMENT">Trigger Update Schutztextes, "uv-index" wird von einem 2.ten Script befüllt</field> <next> <block type="update" id="|_^w6/@XKd,Tz)0pUyqp"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation> <field name="OID">0_userdata.0.uv.uv-text</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">1000</field> <field name="UNIT">ms</field> <field name="CLEAR_RUNNING">FALSE</field> <value name="VALUE"> <block type="procedures_callreturn" id="-ko5Hhf{-p5=WSpJg?r">
                      <mutation name="UV-Text berechnen">
                      <arg name="UV-Wert"></arg>
                      </mutation>
                      <value name="ARG0">
                      <block type="get_value" id="T6U/a]AP#p5QYH$LPfp?">
                      <field name="ATTR">val</field>
                      <field name="OID">0_userdata.0.uv.uv-index</field>
                      </block>
                      </value>
                      </block>
                      </value>
                      <next>
                      <block type="comment" id="F2Q$JDis6(3y+$/:`v:5">
                      <field name="COMMENT">Trigger-ist "uv-index" geändert?</field>
                      <next>
                      <block type="on" id="lMenhSHOGKfWB|isVq_3">
                      <field name="OID">0_userdata.0.uv.uv-index</field>
                      <field name="CONDITION">ne</field>
                      <field name="ACK_CONDITION"></field>
                      <statement name="STATEMENT">
                      <block type="comment" id="S+m9)ld4rL~Z6Zq8ex|V">
                      <field name="COMMENT">"uv-text" Update mit Ergebnis Schleife</field>
                      <next>
                      <block type="update" id="IZyLnqU$q6AvPjtUE(FA">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                      <field name="OID">0_userdata.0.uv.uv-text</field>
                      <field name="WITH_DELAY">TRUE</field>
                      <field name="DELAY_MS">1000</field>
                      <field name="UNIT">ms</field>
                      <field name="CLEAR_RUNNING">FALSE</field>
                      <value name="VALUE">
                      <block type="procedures_callreturn" id="k:+t7T$zsS,Fn)16sv">
                      <mutation name="UV-Text berechnen">
                      <arg name="UV-Wert"></arg>
                      </mutation>
                      <value name="ARG0">
                      <block type="on_source" id="#;X-;3BWR1qE{#Rw0k19">
                      <field name="ATTR">state.val</field>
                      </block>
                      </value>
                      </block>
                      </value>
                      </block>
                      </next>
                      </block>
                      </statement>
                      </block>
                      </next>
                      </block>
                      </next>
                      </block>
                      </next>
                      </block>
                      </xml>

                      Horst Böttcher 1 Reply Last reply Reply Quote 0
                      • Horst Böttcher
                        Horst Böttcher @ps1304 last edited by

                        @ps1304

                        bei mir jetzt auch
                        @paul53 sagte in Hilfe für Dummy gesucht (gelöst):

                        @horst-böttcher sagte: versucht etwas ähnliches zu machen

                        UV-Wert muss den Wert (unter "Trigger") des Datenpunktes erhalten, nicht die ID. Die Prüfung muss in dieser Reihenfolge auf > erfolgen, nicht auf <=.

                        Bild_2021-06-18_172101.png

                        <xml xmlns="https://developers.google.com/blockly/xml">
                         <variables>
                           <variable id="=^M8DHr?F3o8992onF=}">UV-Wert</variable>
                           <variable id="Qk1eJXH})rn~U0!-L?a,">UV-Text</variable>
                         </variables>
                         <block type="on_ext" id="W(z,yg-Ow^f7t{8WQK(s" x="-88" y="-62">
                           <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                           <field name="CONDITION">ne</field>
                           <field name="ACK_CONDITION"></field>
                           <value name="OID0">
                             <shadow type="field_oid" id="E?[HmCB=0[zmvV},7AEX">
                               <field name="oid">openuv.0.UV</field>
                             </shadow>
                           </value>
                           <statement name="STATEMENT">
                             <block type="variables_set" id="]qaB]m_Yc-OjQ*Gk,ax]">
                               <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                               <value name="VALUE">
                                 <block type="on_source" id="J}T{tJY(4iwQMYA.60$5">
                                   <field name="ATTR">state.val</field>
                                 </block>
                               </value>
                               <next>
                                 <block type="variables_set" id="b-lOXQ^1?%h(b,E!x;3r">
                                   <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                   <value name="VALUE">
                                     <block type="text" id="RS{m|vjt~Vm2y?CYh(.">
                                       <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#C0FFA0; text-align:center;"&gt;0–2&lt;/td&gt;                 &lt;td&gt;niedrig&lt;/td&gt;                 &lt;td&gt;Kein Schutz erforderlich.                 &lt;/td&gt;&lt;/tr&gt;</field>
                                     </block>
                                   </value>
                                   <next>
                                     <block type="controls_if" id="~j(!-iB/(W{x-w];CU%!">
                                       <value name="IF0">
                                         <block type="logic_compare" id="w|,#7kYfgC{6)M-gf$Uk">
                                           <field name="OP">GT</field>
                                           <value name="A">
                                             <block type="variables_get" id="+lIBZWO|,6^BK+Q?P.O">
                                               <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                             </block>
                                           </value>
                                           <value name="B">
                                             <block type="math_number" id="LEx,%HhAw#ccBEPP(v1b">
                                               <field name="NUM">2</field>
                                             </block>
                                           </value>
                                         </block>
                                       </value>
                                       <statement name="DO0">
                                         <block type="variables_set" id="rP~[TTmnAL*sGDKD3o@1">
                                           <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                           <value name="VALUE">
                                             <block type="text" id="(d0%*O9JE}@mrr.-3[gv">
                                               <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#F8F040; text-align:center;"&gt;3–5&lt;/td&gt;                 &lt;td&gt;mäßig&lt;/td&gt;                 &lt;td&gt;Schutz erforderlich: Hut, T-Shirt, Sonnenbrille, Sonnencreme                 &lt;/td&gt;&lt;/tr&gt;</field>
                                             </block>
                                           </value>
                                         </block>
                                       </statement>
                                       <next>
                                         <block type="controls_if" id="KoQO160P*4oN$4^@?nNp">
                                           <value name="IF0">
                                             <block type="logic_compare" id="$eZ?.YAkm~bEp+h+w]gs">
                                               <field name="OP">GT</field>
                                               <value name="A">
                                                 <block type="variables_get" id=".13r0{C67=xSeH,7x$Bu">
                                                   <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                                 </block>
                                               </value>
                                               <value name="B">
                                                 <block type="math_number" id="HJr,Ly?CF7cw2grc{HF_">
                                                   <field name="NUM">5</field>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                           <statement name="DO0">
                                             <block type="variables_set" id="#/,!3jwQbulyWS4J}H3(">
                                               <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                               <value name="VALUE">
                                                 <block type="text" id="q~n/yM+Y/!LLH{1l?ap">
                                                   <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#F87820; text-align:center;"&gt;6–7&lt;/td&gt;                 &lt;td&gt;hoch&lt;/td&gt;                 &lt;td&gt;Schutz erforderlich: Hut, T-Shirt, Sonnenbrille, Sonnencreme.&lt;br&gt; Mittagssonne meiden.                 &lt;/td&gt;&lt;/tr&gt;</field>
                                                 </block>
                                               </value>
                                             </block>
                                           </statement>
                                           <next>
                                             <block type="controls_if" id="P#IQTmD,zx*1Afe.N+@x">
                                               <value name="IF0">
                                                 <block type="logic_compare" id="Sz_cu})85D~1E,/MHaF1">
                                                   <field name="OP">GT</field>
                                                   <value name="A">
                                                     <block type="variables_get" id="ZjNx~U=Np42A6$$bvge=">
                                                       <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                                     </block>
                                                   </value>
                                                   <value name="B">
                                                     <block type="math_number" id="3)8EF{g./R;q,sjm4h@O">
                                                       <field name="NUM">7</field>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                               <statement name="DO0">
                                                 <block type="variables_set" id="y-)%r2HB6!^GOIm2/40q">
                                                   <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                                   <value name="VALUE">
                                                     <block type="text" id="79M;KP(7:`,R1=iKOPdo">
                                                       <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#D80020; text-align:center;"&gt;8–10&lt;/td&gt;                 &lt;td&gt;sehr hoch&lt;/td&gt;                 &lt;td&gt;zusätzlicher Schutz erforderlich: Aufenthalt im Freien möglichst vermeiden&lt;br&gt;                 &lt;p&gt;Den Aufenthalt im Freien zwischen 11 und 15 Uhr vermeiden; auch im Schatten gehören ein sonnendichtes Oberteil, lange Hosen, Sonnencreme, Sonnenbrille und ein breitkrempiger Hut zum sonnengerechten Verhalten.                 &lt;/p&gt;                 &lt;/td&gt;&lt;/tr&gt;</field>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </statement>
                                               <next>
                                                 <block type="controls_if" id="5aY6UDu1g(*_,~8y0)Z[">
                                                   <value name="IF0">
                                                     <block type="logic_compare" id="JJm@T!hf4IfCa7YvZ/*w">
                                                       <field name="OP">GT</field>
                                                       <value name="A">
                                                         <block type="variables_get" id="Mh}Hdf#:%VJ;P:TrFi%P">
                                                           <field name="VAR" id="=^M8DHr?F3o8992onF=}">UV-Wert</field>
                                                         </block>
                                                       </value>
                                                       <value name="B">
                                                         <block type="math_number" id="MGFd}fUFz[D3x8TXGe3%">
                                                           <field name="NUM">10</field>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </value>
                                                   <statement name="DO0">
                                                     <block type="variables_set" id="y!2guum{^*z|e/^r]!lN">
                                                       <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                                       <value name="VALUE">
                                                         <block type="text" id=")%/Z3Z)tLv)C*wAL7Z%D">
                                                           <field name="TEXT">&lt;tr&gt;                 &lt;td style="background:#A80080; text-align:center;"&gt;≥ 11&lt;/td&gt;                 &lt;td&gt;extrem&lt;/td&gt;                 &lt;td&gt;zusätzlicher Schutz erforderlich: Aufenthalt im Freien möglichst vermeiden&lt;br&gt;                 &lt;p&gt;Die WHO rät, zwischen 11 und 15 Uhr im Schutz eines Hauses zu bleiben und auch außerhalb dieser Zeit unbedingt Schatten zu suchen. Auch im Schatten gelten ein sonnendichtes Oberteil, lange Hosen, Sonnencreme, Sonnenbrille und ein breitkrempiger Hut als unerlässlich.                 &lt;/p&gt;                 &lt;/td&gt;&lt;/tr&gt;</field>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </statement>
                                                   <next>
                                                     <block type="control_ex" id=".V|0VVOY)Pf$w!21)S+L">
                                                       <field name="TYPE">true</field>
                                                       <field name="CLEAR_RUNNING">TRUE</field>
                                                       <value name="OID">
                                                         <shadow type="field_oid" id="lnv)UkZ70(0@KYW:f(Qj">
                                                           <field name="oid">0_userdata.0.Eigenescripte.uv</field>
                                                         </shadow>
                                                       </value>
                                                       <value name="VALUE">
                                                         <shadow type="logic_boolean" id=";;ei{w51%hYrLQU6!~ZH">
                                                           <field name="BOOL">TRUE</field>
                                                         </shadow>
                                                         <block type="variables_get" id="3$%I1Ju.xh%}W#dn)-+0">
                                                           <field name="VAR" id="Qk1eJXH})rn~U0!-L?a,">UV-Text</field>
                                                         </block>
                                                       </value>
                                                       <value name="DELAY_MS">
                                                         <shadow type="math_number" id="(,_HlvXu1sk5?*OcLZ@">
                                                           <field name="NUM">100</field>
                                                         </shadow>
                                                       </value>
                                                     </block>
                                                   </next>
                                                 </block>
                                               </next>
                                             </block>
                                           </next>
                                         </block>
                                       </next>
                                     </block>
                                   </next>
                                 </block>
                               </next>
                             </block>
                           </statement>
                         </block>
                        </xml>
                        

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        702
                        Online

                        32.0k
                        Users

                        80.5k
                        Topics

                        1.3m
                        Posts

                        6
                        16
                        524
                        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