Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Blockly zum umrechnen von Sekunden in Minuten

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    Blockly zum umrechnen von Sekunden in Minuten

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

      Hallo, ich suche ein Blockly Skript zum umrechnen von Sekunden in Minuten.
      Die Ausgabe sollte 00:00 sein. Wie müsste so ein Skript aussehen?

      paul53 haus-automatisierung 2 Replies Last reply Reply Quote 0
      • paul53
        paul53 @TimoWald last edited by

        @timowald sagte: Die Ausgabe sollte 00:00 sein.

        "hh:mm" oder "mm:ss" ?

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

          @paul53 mm:SS

          paul53 1 Reply Last reply Reply Quote 0
          • haus-automatisierung
            haus-automatisierung Developer Most Active @TimoWald last edited by

            @timowald Was ist denn die höchste Zahl an Minuten, welche Du erwartest? Kleiner 60? Dann z.B. so

            Screenshot 2022-07-07 at 15.00.00.png

            <xml xmlns="https://developers.google.com/blockly/xml">
              <variables>
                <variable id="-mEB]D,lbl1x@AO4!pH}">sec</variable>
              </variables>
              <block type="variables_set" id="YdL!Q|u|A?_$(M:^yplZ" x="37" y="113">
                <field name="VAR" id="-mEB]D,lbl1x@AO4!pH}">sec</field>
                <value name="VALUE">
                  <block type="math_number" id="`m_|f=4-/YhQKX{%MS+F">
                    <field name="NUM">534</field>
                  </block>
                </value>
                <next>
                  <block type="debug" id="yEE=c/Hiz*V3,e!.~bVo">
                    <field name="Severity">log</field>
                    <value name="TEXT">
                      <shadow type="text" id="0[ebT;:NHz/9E[-|XFx[">
                        <field name="TEXT">test</field>
                      </shadow>
                      <block type="convert_from_date" id="2-+$NSZL[S!uQ!A#]EF:">
                        <mutation xmlns="http://www.w3.org/1999/xhtml" format="true" language="false"></mutation>
                        <field name="OPTION">custom</field>
                        <field name="FORMAT">mm:ss</field>
                        <value name="VALUE">
                          <block type="math_arithmetic" id="20a`|9DG7v+(C:iSYzB%">
                            <field name="OP">MULTIPLY</field>
                            <value name="A">
                              <shadow type="math_number" id="[X_?ArtxH(v(}M~!$+-O">
                                <field name="NUM">1</field>
                              </shadow>
                              <block type="variables_get" id="c}n+]RcwnTxz4vHQop~!">
                                <field name="VAR" id="-mEB]D,lbl1x@AO4!pH}">sec</field>
                              </block>
                            </value>
                            <value name="B">
                              <shadow type="math_number" id="^r3~BT6^U-|{8$On1+)X">
                                <field name="NUM">1</field>
                              </shadow>
                              <block type="math_number" id="lAWPMrxvgm`824Uy|-W:">
                                <field name="NUM">1000</field>
                              </block>
                            </value>
                          </block>
                        </value>
                      </block>
                    </value>
                  </block>
                </next>
              </block>
            </xml>
            
            1 Reply Last reply Reply Quote 0
            • paul53
              paul53 @TimoWald last edited by

              @timowald sagte: mm:SS

              Bild_2022-07-07_150143864.png

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

                @paul53 Könntest du es mir mal exportieren?

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

                  @timowald sagte: exportieren?

                  <xml xmlns="https://developers.google.com/blockly/xml">
                   <variables>
                     <variable id="Y)u;_2rlmHlU;rW}d`_Q">sekunden</variable>
                   </variables>
                   <block type="text_join" id="Ogwr.u}3+mou}@]m@gi#" x="62" y="63">
                     <mutation items="3"></mutation>
                     <value name="ADD0">
                       <block type="math_round" id="BlJ$(V#[tqDf{ED{b=RW">
                         <field name="OP">ROUNDDOWN</field>
                         <value name="NUM">
                           <shadow type="math_number" id="6.#itG.umUS3dw6=!=6Q">
                             <field name="NUM">3.1</field>
                           </shadow>
                           <block type="math_arithmetic" id="vM=L6Cf56V$+udnmp/I5">
                             <field name="OP">DIVIDE</field>
                             <value name="A">
                               <shadow type="math_number" id="~u%b_%7#N@ehcPe?a][_">
                                 <field name="NUM">1</field>
                               </shadow>
                               <block type="variables_get" id="*?kA$lWbAdvWRJ*(7)#q">
                                 <field name="VAR" id="Y)u;_2rlmHlU;rW}d`_Q">sekunden</field>
                               </block>
                             </value>
                             <value name="B">
                               <shadow type="math_number" id="DTh7G^Cxkm7$t|gfb~lv">
                                 <field name="NUM">60</field>
                               </shadow>
                             </value>
                           </block>
                         </value>
                       </block>
                     </value>
                     <value name="ADD1">
                       <block type="text" id="c84)ux;!*C`xZjCgYIO#">
                         <field name="TEXT">:</field>
                       </block>
                     </value>
                     <value name="ADD2">
                       <block type="logic_ternary" id="hFN9T/9^!;N;`#=_ds*^">
                         <value name="IF">
                           <block type="logic_compare" id="UP3i/1e*N%}Sa!^c$gfe">
                             <field name="OP">LT</field>
                             <value name="A">
                               <block type="math_modulo" id="/}zEB|Y)e)dx_EI787+/">
                                 <value name="DIVIDEND">
                                   <shadow type="math_number" id="JL}JCJsE4B{4~)Lub-M,">
                                     <field name="NUM">64</field>
                                   </shadow>
                                   <block type="variables_get" id="-acNw$mE3..OJANU.xUN">
                                     <field name="VAR" id="Y)u;_2rlmHlU;rW}d`_Q">sekunden</field>
                                   </block>
                                 </value>
                                 <value name="DIVISOR">
                                   <shadow type="math_number" id="O%HDV0;GQ5,V-)F?[L}:">
                                     <field name="NUM">60</field>
                                   </shadow>
                                 </value>
                               </block>
                             </value>
                             <value name="B">
                               <block type="math_number" id="a(=5mS%4u^wt7r;HID.w">
                                 <field name="NUM">10</field>
                               </block>
                             </value>
                           </block>
                         </value>
                         <value name="THEN">
                           <block type="text_join" id="yBSIC-2dRb_3s75cvqS@" inline="true">
                             <mutation items="2"></mutation>
                             <value name="ADD0">
                               <block type="text" id="#eeuUQfUGaFDpwQRBh{q">
                                 <field name="TEXT">0</field>
                               </block>
                             </value>
                             <value name="ADD1">
                               <block type="math_modulo" id="6p`cD[G+EQ2Am(I`=VC,">
                                 <value name="DIVIDEND">
                                   <shadow type="math_number">
                                     <field name="NUM">64</field>
                                   </shadow>
                                   <block type="variables_get" id="p8BY@GzBGfF5ZSgI7IMY">
                                     <field name="VAR" id="Y)u;_2rlmHlU;rW}d`_Q">sekunden</field>
                                   </block>
                                 </value>
                                 <value name="DIVISOR">
                                   <shadow type="math_number" id=")xNxW.2@7SnksL$`h/z6">
                                     <field name="NUM">60</field>
                                   </shadow>
                                 </value>
                               </block>
                             </value>
                           </block>
                         </value>
                         <value name="ELSE">
                           <block type="math_modulo" id="yiQ8JEU[^6Ma+]|_#nA4">
                             <value name="DIVIDEND">
                               <shadow type="math_number">
                                 <field name="NUM">64</field>
                               </shadow>
                               <block type="variables_get" id="]8,mveap*F9tH4K,3Qyy">
                                 <field name="VAR" id="Y)u;_2rlmHlU;rW}d`_Q">sekunden</field>
                               </block>
                             </value>
                             <value name="DIVISOR">
                               <shadow type="math_number" id=".*9v$qKRFz|C~cAC6z%H">
                                 <field name="NUM">60</field>
                               </shadow>
                             </value>
                           </block>
                         </value>
                       </block>
                     </value>
                   </block>
                  </xml>
                  

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

                    @paul53 Welchen Baustein bzw wo füge ich meinen Quelldatenpunkt und das Ergebnis ein?

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

                      @timowald sagte: wo füge ich meinen Quelldatenpunkt

                      Ersetze die Variable sekunden durch Wert aus den Trigger-Blöcken.

                      @timowald sagte in Blockly zum umrechnen von Sekunden in Minuten:

                      das Ergebnis ein?

                      Das Ergebnis schreibst Du mit "aktualisiere" in den eigenen Datenpunkt vom Typ "string".

                      <xml xmlns="https://developers.google.com/blockly/xml">
                       <variables>
                         <variable id="Y)u;_2rlmHlU;rW}d`_Q">sekunden</variable>
                       </variables>
                       <block type="on_ext" id="PnBoZ*3Dclc=6J%}oo_q" x="-12" y="-12">
                         <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="x4Of8Wu-DL_X6(6UJMjK">
                             <field name="oid">default</field>
                           </shadow>
                         </value>
                         <statement name="STATEMENT">
                           <block type="variables_set" id="wAmQuh+}:sE4or%1O;Jq">
                             <field name="VAR" id="Y)u;_2rlmHlU;rW}d`_Q">sekunden</field>
                             <value name="VALUE">
                               <block type="math_modulo" id="/}zEB|Y)e)dx_EI787+/">
                                 <value name="DIVIDEND">
                                   <shadow type="math_number" id="JL}JCJsE4B{4~)Lub-M,">
                                     <field name="NUM">64</field>
                                   </shadow>
                                   <block type="on_source" id="Ppuh14]Sq`JCD_)PM:|1">
                                     <field name="ATTR">state.val</field>
                                   </block>
                                 </value>
                                 <value name="DIVISOR">
                                   <shadow type="math_number" id="O%HDV0;GQ5,V-)F?[L}:">
                                     <field name="NUM">60</field>
                                   </shadow>
                                 </value>
                               </block>
                             </value>
                             <next>
                               <block type="update" id="6`u]6DCOdEj`7P]Qw#HP" inline="false">
                                 <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="text_join" id="Ogwr.u}3+mou}@]m@gi#">
                                     <mutation items="3"></mutation>
                                     <value name="ADD0">
                                       <block type="math_round" id="BlJ$(V#[tqDf{ED{b=RW">
                                         <field name="OP">ROUNDDOWN</field>
                                         <value name="NUM">
                                           <shadow type="math_number" id="6.#itG.umUS3dw6=!=6Q">
                                             <field name="NUM">3.1</field>
                                           </shadow>
                                           <block type="math_arithmetic" id="vM=L6Cf56V$+udnmp/I5">
                                             <field name="OP">DIVIDE</field>
                                             <value name="A">
                                               <shadow type="math_number" id="~u%b_%7#N@ehcPe?a][_">
                                                 <field name="NUM">1</field>
                                               </shadow>
                                               <block type="on_source" id="^pg)`N?sG~fysUB2]=lW">
                                                 <field name="ATTR">state.val</field>
                                               </block>
                                             </value>
                                             <value name="B">
                                               <shadow type="math_number" id="DTh7G^Cxkm7$t|gfb~lv">
                                                 <field name="NUM">60</field>
                                               </shadow>
                                             </value>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <value name="ADD1">
                                       <block type="text" id="c84)ux;!*C`xZjCgYIO#">
                                         <field name="TEXT">:</field>
                                       </block>
                                     </value>
                                     <value name="ADD2">
                                       <block type="logic_ternary" id="hFN9T/9^!;N;`#=_ds*^">
                                         <value name="IF">
                                           <block type="logic_compare" id="UP3i/1e*N%}Sa!^c$gfe">
                                             <field name="OP">LT</field>
                                             <value name="A">
                                               <block type="variables_get" id="C)kDec_Rm`#548[q_tN~">
                                                 <field name="VAR" id="Y)u;_2rlmHlU;rW}d`_Q">sekunden</field>
                                               </block>
                                             </value>
                                             <value name="B">
                                               <block type="math_number" id="a(=5mS%4u^wt7r;HID.w">
                                                 <field name="NUM">10</field>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
                                         <value name="THEN">
                                           <block type="text_join" id="yBSIC-2dRb_3s75cvqS@" inline="true">
                                             <mutation items="2"></mutation>
                                             <value name="ADD0">
                                               <block type="text" id="#eeuUQfUGaFDpwQRBh{q">
                                                 <field name="TEXT">0</field>
                                               </block>
                                             </value>
                                             <value name="ADD1">
                                               <block type="variables_get" id="p8BY@GzBGfF5ZSgI7IMY">
                                                 <field name="VAR" id="Y)u;_2rlmHlU;rW}d`_Q">sekunden</field>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
                                         <value name="ELSE">
                                           <block type="variables_get" id="]8,mveap*F9tH4K,3Qyy">
                                             <field name="VAR" id="Y)u;_2rlmHlU;rW}d`_Q">sekunden</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                               </block>
                             </next>
                           </block>
                         </statement>
                       </block>
                      </xml>
                      

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

                        @timowald sagte in Blockly zum umrechnen von Sekunden in Minuten:

                        @paul53 Welchen Baustein bzw wo füge ich meinen Quelldatenpunkt und das Ergebnis ein?

                        wo sind denn Quelle und Ergebnisdatenpunkte?

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate
                        FAQ Cloud / IOT
                        HowTo: Node.js-Update
                        HowTo: Backup/Restore
                        Downloads
                        BLOG

                        389
                        Online

                        31.9k
                        Users

                        80.3k
                        Topics

                        1.3m
                        Posts

                        4
                        10
                        360
                        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