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]Zahl aus erst. DP in Blockly vergl. mit "akt. Zeit"

    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

    [gelöst]Zahl aus erst. DP in Blockly vergl. mit "akt. Zeit"

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

      Hallo Leute,

      ich habe einen DP erstellt mit dem ich eine Zahl (1-24) über Icons in meiner VIS um +1 oder -1 erhöhe oder verringere (soll ganze Stunden darstellen). Wie kann ich in Blockly diese Zahl im DP mit "aktueller Uhrzeit" vergleichen? Wenn ich den Baustein mit "WERT von Objekt ID" nehme funktioniert das nicht, auch wenn ich "aktuelle Zeit" als anwenderformatiert mit SS einstelle.

      JoJo58 Codierknecht haus-automatisierung 3 Replies Last reply Reply Quote 0
      • JoJo58
        JoJo58 @Peter666666 last edited by Homoran

        @peter666666

        Moin, ich hatte gestern eine ähnliche Situation und da fiel mir das Video von Matthias Kleine wieder ein. Sieh es dir mal an, schätze das du dein Problem dann lösen kannst. Zeitdifferenzen formatieren im ioBroker: https://www.youtube.com/watch?v=sxkz3O6nfFQ&t=407s

        Johannes

        P 1 Reply Last reply Reply Quote 2
        • P
          Peter666666 @JoJo58 last edited by

          @jojo58 danke werde ich mir ansehen

          N 1 Reply Last reply Reply Quote 0
          • Codierknecht
            Codierknecht Developer Most Active @Peter666666 last edited by

            @peter666666 sagte in Zahl aus erst. DP in Blockly vergleichen mit "aktuelle Zeit":

            Wie kann ich in Blockly

            Zeig mal was Du schon hast.

            https://forum.iobroker.net/topic/51555/hinweise-für-gute-forenbeiträge

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

              @peter666666 sagte in Zahl aus erst. DP in Blockly vergleichen mit "aktuelle Zeit":

              Wie kann ich in Blockly diese Zahl im DP mit "aktueller Uhrzeit" vergleichen?

              In dem Datenpunkt steht 0-23 ? (1-24 ergibt ja keinen Sinn). Dann nimmst Du diesen Baustein und subtrahierst die Werte. Die Frage: Was genau willst Du als Ergebnis sehen? 🙂

              Screenshot 2024-01-23 at 12.49.53.png

              1 Reply Last reply Reply Quote 0
              • N
                Nordischerjung @Peter666666 last edited by

                @peter666666 Müsste es nicht auch so funktionieren?

                a39a807c-d658-435b-ad2b-c67ac3a659c3-image.png

                Codierknecht 1 Reply Last reply Reply Quote 0
                • Codierknecht
                  Codierknecht Developer Most Active @Nordischerjung last edited by

                  @nordischerjung
                  Ja. Aber was soll die 24?
                  Es gibt doch nur die Stunden von 0-23. Eine "24" im Zusammenhang mit "Stunde des Tages" ist ziemlich sinnbefreit.

                  Aber zunächst sollt @Peter666666 mal zeigen was er schon hat.
                  Dann kann man besser beurteilen was da noch zu tun ist.

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

                    Habe es dank dem Video hinbekommen. Ich starte die Warmwasseraufbereitung mit dem günstigen Spotpreis, möchte aber wenn der Preis über ein paar Stunden gleich bleibt natürlich die letzt mögliche Stunde nehmen was ich in dem DP von 0-23 einstelle über meine Visualisierung (1-24 oben war natürlich falsch).

                    Bild 23.01.24 um 17.23.jpeg

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

                      @peter666666 sagte in Zahl aus erst. DP in Blockly vergleichen mit "aktuelle Zeit":

                      Habe es dank dem Video hinbekommen

                      Ah, nach diesem Video also... und nach welchem genau ?

                      P 1 Reply Last reply Reply Quote 0
                      • P
                        Peter666666 @DJMarc75 last edited by

                        @djmarc75 Sorry, aus dem zweiten Beitrag.

                        1 Reply Last reply Reply Quote 0
                        • P
                          Peter666666 @Codierknecht last edited by Peter666666

                          @codierknecht so sieht es aus. Wahrscheinlich nicht perfekt wie ich es gemacht habe 😊 . Aber es funktioniert.

                          <xml xmlns="https://developers.google.com/blockly/xml">
                            <block type="schedule" id="{,VRQB`ND9!QV3ith@C`" x="-412" y="88">
                              <field name="SCHEDULE">1,6,11,16,21,26,31,36,41,46,59 * * * *</field>
                              <statement name="STATEMENT">
                                <block type="controls_if" id="t{p,Rg7~Y:wj:/cDSIQT">
                                  <mutation elseif="1"></mutation>
                                  <value name="IF0">
                                    <block type="logic_operation" id="y-+yCFY9!H1,$xi)()Dg" inline="false">
                                      <field name="OP">AND</field>
                                      <value name="A">
                                        <block type="logic_compare" id="^{:UliR#/uh2HXMcv6}d">
                                          <field name="OP">EQ</field>
                                          <value name="A">
                                            <block type="get_value" id="5%j)[,.4*q|xLHH^H)yN">
                                              <field name="ATTR">val</field>
                                              <field name="OID">0_userdata.0.Blockly.WWbilligerStrompreis</field>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <block type="logic_boolean" id="yv#6{:.WW7yn88z^p~2v">
                                              <field name="BOOL">TRUE</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <block type="logic_operation" id="1vz^Z}6]Q(I(%b8`F(kM">
                                          <field name="OP">AND</field>
                                          <value name="A">
                                            <block type="logic_compare" id="T(KQY6N-[2iu8P3v~]$A">
                                              <field name="OP">EQ</field>
                                              <value name="A">
                                                <block type="get_value" id="oX4}ykCbL0:H)z=YUpXS">
                                                  <field name="ATTR">val</field>
                                                  <field name="OID">0_userdata.0.Blockly.Brauchwasser_AKTIV</field>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="logic_boolean" id="Gyj1q|vMM=70?Qc7dx,4">
                                                  <field name="BOOL">TRUE</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <block type="logic_compare" id="@8XIbDd2Go7|1R7inW.i">
                                              <field name="OP">GT</field>
                                              <value name="A">
                                                <block type="get_value" id="qQapD$$36AJfj5^uusis">
                                                  <field name="ATTR">val</field>
                                                  <field name="OID">shelly.0.shellyplus1#0cdc7ef6fa04#1.Ext.temperature100C</field>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="math_number" id="GG.LMmK2~*yO#N%aW*YY">
                                                  <field name="NUM">57.2</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <statement name="DO0">
                                    <block type="comment" id="Za:p]T;0mSn,l,YgM{-/">
                                      <field name="COMMENT">Warmwasser AUS Temperatur erreicht</field>
                                      <next>
                                        <block type="control" id="i,nI,[q,z}$4?zn{vSL,">
                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                          <field name="OID">shelly.0.SHSW-1#349454791026#1.Relay0.Switch</field>
                                          <field name="WITH_DELAY">FALSE</field>
                                          <value name="VALUE">
                                            <block type="logic_boolean" id="=t^S1g+j1*`-V`(gcMhF">
                                              <field name="BOOL">TRUE</field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="update" id="jUQV.$PuG7k:I{z)0gEe">
                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                              <field name="OID">0_userdata.0.Blockly.Brauchwasser_AKTIV</field>
                                              <field name="WITH_DELAY">FALSE</field>
                                              <value name="VALUE">
                                                <block type="logic_boolean" id="NBY8Xkrevc80xB:Fmu]%">
                                                  <field name="BOOL">FALSE</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="update" id="RC~?L,16jKb;,@9gybqC">
                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                  <field name="OID">0_userdata.0.Blockly.WWbilligerStrompreis_AKTIV</field>
                                                  <field name="WITH_DELAY">FALSE</field>
                                                  <value name="VALUE">
                                                    <block type="logic_boolean" id="_T3%f-FLYVrP)k|_pXp`">
                                                      <field name="BOOL">FALSE</field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="pushover" id="$UMpoqnM~`t(a;49avX9">
                                                      <field name="INSTANCE">.0</field>
                                                      <field name="SOUND"></field>
                                                      <field name="PRIORITY">0</field>
                                                      <field name="LOG"></field>
                                                      <value name="MESSAGE">
                                                        <shadow type="text" id="oAW]9EF2S_Hq0q9Re$^s">
                                                          <field name="TEXT">Warmwasser AUS Temperatur erreicht</field>
                                                        </shadow>
                                                      </value>
                                                      <value name="SOUND_CUSTOM">
                                                        <shadow type="text" id="[9GdUOfQYkt|Al{8db~4">
                                                          <field name="TEXT"></field>
                                                        </shadow>
                                                      </value>
                                                      <value name="TITLE">
                                                        <block type="text" id=";ZcUTCkLoVwJ|,ppy]jL">
                                                          <field name="TEXT">Spot Strompreis</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </statement>
                                  <value name="IF1">
                                    <block type="logic_operation" id="|pE#$IE0A+h7M+A;H`::" inline="false">
                                      <field name="OP">AND</field>
                                      <value name="A">
                                        <block type="logic_operation" id="kWQBMk:s^UPN_r+}^P,t" inline="false">
                                          <field name="OP">AND</field>
                                          <value name="A">
                                            <block type="logic_operation" id="L=wK.4TmqFlP=F3,{+u+" inline="false">
                                              <field name="OP">AND</field>
                                              <value name="A">
                                                <block type="logic_operation" id="G=PX]on~RAIsD!sY=DP;">
                                                  <field name="OP">AND</field>
                                                  <value name="A">
                                                    <block type="logic_compare" id="IPpzUa6RO`#u{a94xk*?">
                                                      <field name="OP">EQ</field>
                                                      <value name="A">
                                                        <block type="get_value" id="E#0w|SA3_:$ASd/}C_.T">
                                                          <field name="ATTR">val</field>
                                                          <field name="OID">0_userdata.0.Blockly.WWbilligerStrompreis</field>
                                                        </block>
                                                      </value>
                                                      <value name="B">
                                                        <block type="logic_boolean" id="+bQ.8RnRB67OxJJD(N53">
                                                          <field name="BOOL">TRUE</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <block type="logic_compare" id="BEl[!7a1,70|!mq.W)+%">
                                                      <field name="OP">EQ</field>
                                                      <value name="A">
                                                        <block type="get_value" id="qEFcg~pq}^xXPs~d)dv,">
                                                          <field name="ATTR">val</field>
                                                          <field name="OID">0_userdata.0.Blockly.Brauchwasser_AKTIV</field>
                                                        </block>
                                                      </value>
                                                      <value name="B">
                                                        <block type="logic_boolean" id="B;9TGNYscj%c$So)?*6)">
                                                          <field name="BOOL">FALSE</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="logic_compare" id="MwKNZKL*xAmwM6Fk##s-">
                                                  <field name="OP">LTE</field>
                                                  <value name="A">
                                                    <block type="get_value" id="o~SIULpr!_98sGxtiWHn">
                                                      <field name="ATTR">val</field>
                                                      <field name="OID">shelly.0.shellyplus1#0cdc7ef6fa04#1.Ext.temperature100C</field>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <block type="math_number" id="_K+RW^__m,.LKUt~*~9Z">
                                                      <field name="NUM">54</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <block type="logic_compare" id="McyM`]]AQ}ekgE98QrJ6">
                                              <field name="OP">LTE</field>
                                              <value name="A">
                                                <block type="get_value" id=".|RZ5FL9fG7$Ad.]e/GE">
                                                  <field name="ATTR">val</field>
                                                  <field name="OID">0_userdata.0.Blockly.StromPreisStunde</field>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="get_value" id="qZs-)MD,bPX^9$W9Diu*">
                                                  <field name="ATTR">val</field>
                                                  <field name="OID">0_userdata.0.Blockly.Start_WW_Strompreis</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <block type="logic_compare" id="p@,H_{*1)crKQUup4`mU">
                                          <field name="OP">EQ</field>
                                          <value name="A">
                                            <block type="convert_from_date" id="YQ;5GRH8W]=_,#FdK3Ee">
                                              <mutation xmlns="http://www.w3.org/1999/xhtml" format="true" language="false"></mutation>
                                              <field name="OPTION">custom</field>
                                              <field name="FORMAT">SS</field>
                                              <value name="VALUE">
                                                <block type="time_get" id="3/%0m!h36Pj~n!YWT+$f">
                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                  <field name="OPTION">object</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <block type="get_value" id="Aq+#:oM!SSXK@2,a;Mg}">
                                              <field name="ATTR">val</field>
                                              <field name="OID">0_userdata.0.Blockly.WWbilligerStrompreisStart</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <statement name="DO1">
                                    <block type="control" id="V^ENbxiy2?OGz!3kt7=H">
                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                      <field name="OID">shelly.0.SHSW-1#3494547AED63#1.Relay0.Switch</field>
                                      <field name="WITH_DELAY">FALSE</field>
                                      <value name="VALUE">
                                        <block type="logic_boolean" id="H~B@W:_!M_]Ay+~m!/2b">
                                          <field name="BOOL">TRUE</field>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="update" id="9$%hAbqqcUD%)6lSxnk?">
                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                          <field name="OID">0_userdata.0.Blockly.Brauchwasser_AKTIV</field>
                                          <field name="WITH_DELAY">FALSE</field>
                                          <value name="VALUE">
                                            <block type="logic_boolean" id="dbC$*uDabEg]/uKb+NZ%">
                                              <field name="BOOL">TRUE</field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="update" id="sZw^5#QLm#GpeA*m+3ab">
                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                              <field name="OID">0_userdata.0.Blockly.WWbilligerStrompreis_AKTIV</field>
                                              <field name="WITH_DELAY">FALSE</field>
                                              <value name="VALUE">
                                                <block type="logic_boolean" id="x~y]AE=_om[OMLA^R#Rm">
                                                  <field name="BOOL">TRUE</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="pushover" id="_p-OWXpNWR`Xs)Rewt_{">
                                                  <field name="INSTANCE">.0</field>
                                                  <field name="SOUND"></field>
                                                  <field name="PRIORITY">0</field>
                                                  <field name="LOG"></field>
                                                  <value name="MESSAGE">
                                                    <shadow type="text" id="xoucP2nAu,s9:Bx;W.ZX">
                                                      <field name="TEXT">Warmwasser EIN Spot Strompreis</field>
                                                    </shadow>
                                                  </value>
                                                  <value name="SOUND_CUSTOM">
                                                    <shadow type="text" id="7.2)RK]EM}KAYCE`ecLi">
                                                      <field name="TEXT"></field>
                                                    </shadow>
                                                  </value>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </statement>
                                </block>
                              </statement>
                            </block>
                          </xml>
                          
                          DJMarc75 1 Reply Last reply Reply Quote 0
                          • DJMarc75
                            DJMarc75 @Peter666666 last edited by

                            @peter666666 bitte auch nicht nur Code vom Blockly hier zeigen sondern Screenshots !
                            Nicht jeder kann den Code einfügen da u.U. nicht Deine Adapter installiert sind.

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

                              @peter666666 sagte: was ich in dem DP von 0-23 einstelle über meine Visualisierung

                              Bei diesem Vergleich muss der DP einen String mit einer führenden 0 vor 10 Uhr enthalten. Vergleiche besser so:

                              Blockly_temp.JPG

                              P 1 Reply Last reply Reply Quote 1
                              • P
                                Peter666666 @DJMarc75 last edited by

                                @djmarc75

                                Bild 23.01.24 um 17.51.jpeg
                                Bild 23.01.24 um 17.52.jpeg

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

                                  @paul53 ok danke. Stell ich um!

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

                                  Support us

                                  ioBroker
                                  Community Adapters
                                  Donate

                                  939
                                  Online

                                  31.9k
                                  Users

                                  80.2k
                                  Topics

                                  1.3m
                                  Posts

                                  7
                                  15
                                  710
                                  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