Navigation

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

    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

    Stoppuhr

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

      Für Stunde

      <xml xmlns="http://www.w3.org/1999/xhtml">
      <variables>
      <variable type="undefined" id="Intervall">Intervall</variable>
      <variable type="" id="RJX#bCFN/lLc{/ML$d(C">counter22</variable>
      </variables>
      <block type="on_ext" id="nlX!8rCV~k.;9Xm#$t0S" x="-1087" y="-1287">
      <mutation items="2"></mutation>
      <field name="CONDITION">ne</field>
      <field name="ACK_CONDITION"></field>
      <value name="OID0">
      <shadow type="field_oid" id="ES``F{uHqW8J+/Y,X@P,">
      <field name="oid">vis.0.HansNOTAUS.Wasserzaehler2</field>
      </shadow>
      </value>
      <value name="OID1">
      <shadow type="field_oid" id="c1dm,W4lL4F/SCN/JXE[">
      <field name="oid">vis.0.HansNOTAUS.Wasserzaehler2.Stunden</field>
      </shadow>
      </value>
      <statement name="STATEMENT">
      <block type="controls_if" id="CjOQv-/z9yZw|+5]9~Ey">
      <mutation elseif="1"></mutation>
      <value name="IF0">
      <block type="logic_compare" id="mbvd~(W_.g}5*}=^oO~v">
      <field name="OP">EQ</field>
      <value name="A">
      <block type="get_value" id="jMiE]hV^DT%]ElNF/Ms">
      <field name="ATTR">val</field>
      <field name="OID">vis.0.HansNOTAUS.Wasserzaehler2</field>
      </block>
      </value>
      <value name="B">
      <block type="logic_boolean" id="_zD5z^Eg?Mp/(ND7]U/1">
      <field name="BOOL">TRUE</field>
      </block>
      </value>
      </block>
      </value>
      <statement name="DO0">
      <block type="timeouts_setinterval" id="@4#gh8ib?30YN]phECu"> <field name="NAME">Intervall</field> <field name="INTERVAL">60</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="math_change" id="ISrC8BYmAH[I|pL+%xZ">
      <field name="VAR" id="RJX#bCFN/lLc{/ML$d(C" variabletype="">counter22</field>
      <value name="DELTA">
      <shadow type="math_number" id="fRCT)TN8g
      |+PyckhQDs">
      <field name="NUM">1</field>
      </shadow>
      </value>
      <next>
      <block type="controls_if" id="e02eDw4RhcrUIFhfdw_.">
      <value name="IF0">
      <block type="logic_compare" id=";GfrwfY$+9p-)fDhUb$^">
      <field name="OP">EQ</field>
      <value name="A">
      <block type="variables_get" id="]b(I5apIK{$dp*qaHjv3">
      <field name="VAR" id="RJX#bCFN/lLc{/ML$d(C" variabletype="">counter22</field>
      </block>
      </value>
      <value name="B">
      <block type="math_number" id="eKpd|+UN.Vum}MTuDzQ">
      <field name="NUM">60</field>
      </block>
      </value>
      </block>
      </value>
      <statement name="DO0">
      <block type="update" id="bMO;21Gt^nL/r2CY@1
      t">
      <mutation delay_input="false"></mutation>
      <field name="OID">vis.0.HansNOTAUS.Wasserzaehler2.Stunden</field>
      <field name="WITH_DELAY">FALSE</field>
      <value name="VALUE">
      <block type="math_arithmetic" id="Vp#pAhCa-z%KT|(U:K+"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="j1N0n8@)2iYs00z3u#fB"> <field name="NUM">1</field> </shadow> <block type="get_value" id="+nhPP|Y:/v3J51YI:~1a"> <field name="ATTR">val</field> <field name="OID">vis.0.HansNOTAUS.Wasserzaehler2.Stunden</field> </block> </value> <value name="B"> <shadow type="math_number" id="(/_[7S|b%eWw1_/$Wu;m"> <field name="NUM">1</field> </shadow> </value> </block> </value> <next> <block type="timeouts_clearinterval" id="tB5ooe#rUd?S;~;+GFti"> <field name="NAME">Intervall22</field> <next> <block type="variables_set" id="Y3Rl?EUO8%)_wC#VErw">
      <field name="VAR" id="RJX#bCFN/lLc{/ML$d(C" variabletype="">counter22</field>
      <value name="VALUE">
      <block type="math_number" id="[kE?RAf~_i@=IdcO3N]Z">
      <field name="NUM">0</field>
      </block>
      </value>
      <next>
      <block type="controls_if" id="8.VKm@=a-,I7-x^meO@"> <value name="IF0"> <block type="logic_compare" id="YdKP=*uUGT9TP9v@0nu{"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="r{?aRDWm3%:*uWXQ4A~Z"> <field name="ATTR">val</field> <field name="OID">vis.0.HansNOTAUS.Wasserzaehler2.Stunden</field> </block> </value> <value name="B"> <block type="math_number" id="kzoG5Gd8[tKgkneVQeuq"> <field name="NUM">23</field> </block> </value> </block> </value> <statement name="DO0"> <block type="update" id="M@/~6vePwX4_JkTwL?Y">
      <mutation delay_input="false"></mutation>
      <field name="OID">vis.0.HansNOTAUS.Wasserzaehler2.Stunden</field>
      <field name="WITH_DELAY">FALSE</field>
      <value name="VALUE">
      <block type="math_number" id="Tt2P_gQaCts35x$$Wd[F">
      <field name="NUM">0</field>
      </block>
      </value>
      <next>
      <block type="timeouts_clearinterval" id=";MzYTKH52#jlPrjTBqeF">
      <field name="NAME">Intervall</field>
      <next>
      <block type="variables_set" id="lXuk(/~;a7txQ=,2~vg"> <field name="VAR" id="RJX#bCFN/lLc{/ML$d(C" variabletype="">counter22</field> <value name="VALUE"> <block type="math_number" id="tb7yE@DsV#Hqa:oAA7|Q"> <field name="NUM">0</field> </block> </value> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </statement> </block> </statement> <value name="IF1"> <block type="logic_compare" id="HZ*d)FAmc$T/gmUyaATz"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="Bgj{aa~3Rhl-J_{J,JEj"> <field name="ATTR">val</field> <field name="OID">vis.0.HansNOTAUS.Wasserzaehler2</field> </block> </value> <value name="B"> <block type="logic_boolean" id="z=?N^mXE=#b:f;PI7M@c"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> <statement name="DO1"> <block type="variables_set" id="P2H;X!(CVbMKDLqv34hT"> <field name="VAR" id="RJX#bCFN/lLc{/ML$d(C" variabletype="">counter22</field> <value name="VALUE"> <block type="math_number" id="l3z)Gn0Uy?}=Te48Ai[">
      <field name="NUM">0</field>
      </block>
      </value>
      <next>
      <block type="timeouts_clearinterval" id="TQ;:O)dZR;9m`8)[Ubq8">
      <field name="NAME">Intervall</field>
      </block>
      </next>
      </block>
      </statement>
      </block>
      </statement>
      </block>
      </xml>

      1 Reply Last reply Reply Quote 0
      • S
        Schlagschatten last edited by

        Tag

        <xml xmlns="http://www.w3.org/1999/xhtml">
        <variables>
        <variable type="undefined" id="Intervall33">Intervall33</variable>
        <variable type="" id="RJX#bCFN/lLc{/ML$d(C">counter33</variable>
        </variables>
        <block type="on_ext" id="nlX!8rCV~k.;9Xm#$t0S" x="-1112" y="-1337">
        <mutation items="2"></mutation>
        <field name="CONDITION">ne</field>
        <field name="ACK_CONDITION"></field>
        <value name="OID0">
        <shadow type="field_oid" id="ES``F{uHqW8J+/Y,X@P,">
        <field name="oid">vis.0.HansNOTAUS.Wasserzaehler2</field>
        </shadow>
        </value>
        <value name="OID1">
        <shadow type="field_oid" id="c1dm,W4lL4F/SCN/JXE[">
        <field name="oid">vis.0.HansNOTAUS.Wasserzaehler2.Tag</field>
        </shadow>
        </value>
        <statement name="STATEMENT">
        <block type="controls_if" id="CjOQv-/z9yZw|+5]9~Ey">
        <mutation elseif="1"></mutation>
        <value name="IF0">
        <block type="logic_compare" id="mbvd~(W_.g}5*}=^oO~v">
        <field name="OP">EQ</field>
        <value name="A">
        <block type="get_value" id="jMiE]hV^DT%]ElNF/Ms">
        <field name="ATTR">val</field>
        <field name="OID">vis.0.HansNOTAUS.Wasserzaehler2</field>
        </block>
        </value>
        <value name="B">
        <block type="logic_boolean" id="_zD5z^Eg?Mp/(ND7]U/1">
        <field name="BOOL">TRUE</field>
        </block>
        </value>
        </block>
        </value>
        <statement name="DO0">
        <block type="timeouts_setinterval" id="@4#gh8ib?30YN]phECu"> <field name="NAME">Intervall33</field> <field name="INTERVAL">1</field> <field name="UNIT">min</field> <statement name="STATEMENT"> <block type="math_change" id="ISrC8BYmAH[I|pL+%xZ">
        <field name="VAR" id="RJX#bCFN/lLc{/ML$d(C" variabletype="">counter33</field>
        <value name="DELTA">
        <shadow type="math_number" id="fRCT)TN8g
        |+PyckhQDs">
        <field name="NUM">1</field>
        </shadow>
        </value>
        <next>
        <block type="controls_if" id="e02eDw4RhcrUIFhfdw_.">
        <value name="IF0">
        <block type="logic_compare" id=";GfrwfY$+9p-)fDhUb$^">
        <field name="OP">EQ</field>
        <value name="A">
        <block type="variables_get" id="]b(I5apIK{$dpqaHjv3">
        <field name="VAR" id="RJX#bCFN/lLc{/ML$d(C" variabletype="">counter33</field>
        </block>
        </value>
        <value name="B">
        <block type="math_number" id="eKpd|+UN.Vum}MTuDzQ">
        <field name="NUM">1440</field>
        </block>
        </value>
        </block>
        </value>
        <statement name="DO0">
        <block type="update" id="bMO;21Gt^nL/r2CY@1
        t">
        <mutation delay_input="false"></mutation>
        <field name="OID">vis.0.HansNOTAUS.Wasserzaehler2.Tag</field>
        <field name="WITH_DELAY">FALSE</field>
        <value name="VALUE">
        <block type="math_arithmetic" id="Vp#pAhCa-z%KT|(U:K+"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="j1N0n8@)2iYs00z3u#fB"> <field name="NUM">1</field> </shadow> <block type="get_value" id="+nhPP|Y:/v3J51YI:~1a"> <field name="ATTR">val</field> <field name="OID">vis.0.HansNOTAUS.Wasserzaehler2.Tag</field> </block> </value> <value name="B"> <shadow type="math_number" id="(/_[7S|b%eWw1_/$Wu;m"> <field name="NUM">1</field> </shadow> </value> </block> </value> <next> <block type="timeouts_clearinterval" id="tB5ooe#rUd?S;~;+GFti"> <field name="NAME">Intervall33</field> <next> <block type="variables_set" id="Y3Rl?EUO8%)_wC#VErw">
        <field name="VAR" id="RJX#bCFN/lLc{/ML$d(C" variabletype="">counter33</field>
        <value name="VALUE">
        <block type="math_number" id="[kE?RAf~_i@=IdcO3N]Z">
        <field name="NUM">0</field>
        </block>
        </value>
        <next>
        <block type="controls_if" id="?mjZfBT8Xecb![V:#If#">
        <value name="IF0">
        <block type="logic_compare" id="IlY(^7|L^PL{#$Ef:0K7">
        <field name="OP">EQ</field>
        <value name="A">
        <block type="get_value" id="XG{iq+Iq:-PioU+|NIg8">
        <field name="ATTR">val</field>
        <field name="OID">vis.0.HansNOTAUS.Wasserzaehler2.Tag</field>
        </block>
        </value>
        <value name="B">
        <block type="math_number" id="y
        #0BBv2lF3l1eRR|TB$">
        <field name="NUM">150</field>
        </block>
        </value>
        </block>
        </value>
        <statement name="DO0">
        <block type="update" id="Ra[sDyz:[v~THw17*OB6">
        <mutation delay_input="false"></mutation>
        <field name="OID">vis.0.HansNOTAUS.Wasserzaehler2.Tag</field>
        <field name="WITH_DELAY">FALSE</field>
        <value name="VALUE">
        <block type="math_number" id=",W@U]?C~uk+N7:Z~H~Z"> <field name="NUM">0</field> </block> </value> <next> <block type="timeouts_clearinterval" id="+U[%E4VpEBy)9mDc,FtW"> <field name="NAME">Intervall33</field> <next> <block type="variables_set" id="2qecrhsfgE-R5[MWB5by"> <field name="VAR" id="RJX#bCFN/lLc{/ML$d(C" variabletype="">counter33</field> <value name="VALUE"> <block type="math_number" id="F8X}B-:T~5)nxFSE/69N"> <field name="NUM">0</field> </block> </value> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </statement> </block> </statement> <value name="IF1"> <block type="logic_compare" id="HZ*d)FAmc$T/gmUyaATz"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="Bgj{aa~3Rhl-J_{J,JEj"> <field name="ATTR">val</field> <field name="OID">vis.0.HansNOTAUS.Wasserzaehler2</field> </block> </value> <value name="B"> <block type="logic_boolean" id="z=?N^mXE=#b:f;PI7M@c"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> <statement name="DO1"> <block type="variables_set" id="P2H;X!(CVbMKDLqv34hT"> <field name="VAR" id="RJX#bCFN/lLc{/ML$d(C" variabletype="">counter33</field> <value name="VALUE"> <block type="math_number" id="l3z)Gn0Uy?}=Te48Ai[">
        <field name="NUM">0</field>
        </block>
        </value>
        <next>
        <block type="timeouts_clearinterval" id="TQ;:O)dZR;9m`8)[Ubq8">
        <field name="NAME">Intervall33</field>
        </block>
        </next>
        </block>
        </statement>
        </block>
        </statement>
        </block>
        </xml>

        1 Reply Last reply Reply Quote 0
        • S
          Schlagschatten last edited by

          Kann auch alles in ein Script

          liv-in-sky 1 Reply Last reply Reply Quote 0
          • liv-in-sky
            liv-in-sky @rantanplan last edited by liv-in-sky

            @rantanplan

            hättest du mal lust, mein (mit datenpunkten anlegen) script zu testen - im script ist auch ein testmodus der alle paar minuten läuft und die stoppuhr immer wieder startet - bei mir geht es - du müßtest also nicht mal start ode stopp drücken, da dies schon im test script vorhanden ist - nur die datenpunkte überwachen und evt. ein paar performance sachen feststellen.

            stoppuhr-mit-daternanlegen.txt

            1 Reply Last reply Reply Quote 0
            • rantanplan
              rantanplan @liv-in-sky last edited by

              @liv-in-sky sagte in Stoppuhr:

              ich habe nicht damit gerechnet, dass es gleich in die massenverarbeitung geht 🙂

              Wer die Geister ruft.....☺

              Hier mal ein kleines Beispiel wie ich das mit dem Initialieseren meine.
              Ich mache das z.B. bei meiner Heizungssteuerung so.
              Da ich jeden Raum einzeln steuer, hat das noch den Vorteil das ich die Scripte kopieren kann und nur an einer Stelle die Daten anpassen muss.

              Beispiel_001.png

              Du brauchst dann noch eine Funktion, die am Ende die Werte der lokalen Variablen in die Datenpunkte schreibt.

              liv-in-sky 1 Reply Last reply Reply Quote 0
              • liv-in-sky
                liv-in-sky @rantanplan last edited by

                @rantanplan

                habe das mit dem berechnen teil so gemacht - nkannst ja mal kucken - bitte - aber ich denke, ich habe es verstanden

                1 Reply Last reply Reply Quote 0
                • liv-in-sky
                  liv-in-sky @Schlagschatten last edited by

                  @Schlagschatten

                  zwischen unseren scripten, gibt es einen wichtigen unterschied

                  du zählst die sekunden oder minuten die ganze zeit und verbraucht die ganze zeit performance

                  meine scripte berechnen die sekunden alle z.b 30 sekunden - das spart die performance !!!!!!

                  1 Reply Last reply Reply Quote 0
                  • S
                    Schlagschatten last edited by

                    Das Script ist wesentlich einfacher augebaut, es Zählt eigentlich nur und damit bibt es Problem. In deinem Script z.b. wandels du Datum in Rechenwerte um und halt wieder zurück. Wenn ich das richtig verstanden habe. Und wofür braucht du das Objekt Momentan?

                    liv-in-sky 1 Reply Last reply Reply Quote 0
                    • S
                      Schlagschatten last edited by

                      Ein Zähler der nach 45min nicht mehr richtig zählt.

                      1 Reply Last reply Reply Quote 0
                      • liv-in-sky
                        liv-in-sky @Schlagschatten last edited by

                        @Schlagschatten

                        dein problem im script - was ist bei einem ausfall oder neustart des iobrokers - dann ist vorbei mit zählen oder du speicherst alle deine sekunden und minuten plus ob script aktiv ist - sonst geht das nicht

                        da du keine sekunden brauchst, kannst du meine scripte auch minütlich ausführen

                        1 Reply Last reply Reply Quote 0
                        • S
                          Schlagschatten last edited by

                          Können die Bausteine mit Sekunden im Script gelöscht werden?

                          liv-in-sky 1 Reply Last reply Reply Quote 0
                          • liv-in-sky
                            liv-in-sky @Schlagschatten last edited by liv-in-sky

                            @Schlagschatten

                            macht keinen sinn, da die grundlage in millisekunden ist - die sog. linuxzeit - würde nicht wirklich was bringen - ich mach jetzt noch mal einen längeren test

                            momentan laufen schon 3 scripte von mir - ich sehe absolut keine laufzeitdifferenz von 45 minuten - manchmal habe ich eine (EINS) sekunden abweichung

                            vielleicht hast du noch eine alte version - des scripts

                            rantanplan 1 Reply Last reply Reply Quote 0
                            • S
                              Schlagschatten last edited by

                              Zum Thema Neustart ist da keine Lösung vorhanden.
                              Die Frage die sich stellt, wie kommt der Pi mit all den Scripten und was man sonst noch läuft klar.

                              liv-in-sky 1 Reply Last reply Reply Quote 0
                              • liv-in-sky
                                liv-in-sky @Schlagschatten last edited by

                                @Schlagschatten ich glaube nicht, das der pi bei 8 scripten die nur alle minute oder so rechnen ein großes problem hat -

                                1 Reply Last reply Reply Quote 0
                                • S
                                  Schlagschatten last edited by

                                  Missverständnis. Bei meinem Script läuft die Zeit nach 45min weg. Bei Deinen läuft die Zeit korrekt, die Zeit startet nur 10 sek später. Nimm eine Stopuhr und dein Script und starte es gleichzeitig. Der Punkt ist unwichtig, sind nur 10 sek. danach läuft es.

                                  1 Reply Last reply Reply Quote 0
                                  • rantanplan
                                    rantanplan @liv-in-sky last edited by

                                    @liv-in-sky sagte in Stoppuhr:

                                    vielleicht hast du noch eine alte version - des scripts

                                    Deshalb sollte man immer den ersten Beitrag aktualisieren. Und nicht irgendwo mittendrin.

                                    liv-in-sky 1 Reply Last reply Reply Quote 0
                                    • liv-in-sky
                                      liv-in-sky @rantanplan last edited by

                                      @rantanplan ich weiß

                                      ich wollte nach der richtigen funktion einen eigenen thread mit dem script machen

                                      rantanplan 1 Reply Last reply Reply Quote 0
                                      • S
                                        Schlagschatten last edited by

                                        Habe gerade mal nachgeschaut, die geplante Anzahl an Scripten geht auf die 30 zu. Und was man sonst noch angeschlossen hat. Was an Performance nötig ist, kann ich nicht sagen, habe mir gestern abend den RPI-Monitor-Adapter installiert und die Werte sehen noch gut aus.
                                        Auch wieviel Leistung das Script von liv-in-sky braucht, keine Vorstellung, es sieht halt nur sehr umfangreich aus. Kann halt auch letztlich weniger Rechenleistung nutzten.

                                        1 Reply Last reply Reply Quote 0
                                        • rantanplan
                                          rantanplan @liv-in-sky last edited by

                                          @liv-in-sky sagte in Stoppuhr:

                                          @rantanplan ich weiß

                                          ich wollte nach der richtigen funktion einen eigenen thread mit dem script machen

                                          Guter Plan!

                                          Dein Anlegen von Datenpunkten scheint nicht richtig zu sein.
                                          Vom Script angelegt
                                          Beispiel_001.png

                                          {
                                            "from": "system.adapter.javascript.0",
                                            "user": "system.user.admin",
                                            "ts": 1558013055132,
                                            "common": {
                                              "name": "Reset",
                                              "desc": "Reset",
                                              "type": "boolean",
                                              "role": "state"
                                            },
                                            "native": {},
                                            "acl": {
                                              "object": 1636,
                                              "owner": "system.user.admin",
                                              "ownerGroup": "system.group.administrator",
                                              "state": 1636
                                            },
                                            "_id": "javascript.0.STOPPUHR.Steuerung.Reset",
                                            "type": "state"
                                          }
                                          

                                          Manuell angelegt
                                          Beispiel_002.png

                                          {
                                            "from": "system.adapter.admin.0",
                                            "user": "system.user.admin",
                                            "ts": 1558013264754,
                                            "common": {
                                              "name": "Test Objekt",
                                              "role": "",
                                              "type": "boolean",
                                              "desc": "Manuell erzeugt",
                                              "read": true,
                                              "write": true,
                                              "def": false
                                            },
                                            "native": {},
                                            "acl": {
                                              "object": 1636,
                                              "owner": "system.user.admin",
                                              "ownerGroup": "system.group.administrator",
                                              "state": 1636
                                            },
                                            "_id": "javascript.0.STOPPUHR.Steuerung.Test_Objekt",
                                            "type": "state"
                                          }
                                          
                                          liv-in-sky 1 Reply Last reply Reply Quote 0
                                          • liv-in-sky
                                            liv-in-sky @rantanplan last edited by liv-in-sky

                                            @rantanplan

                                            ja habe ich geseh - sollte aber kein thema sein - ich werd aber noch versuchen, die restlichen werte hinzuzufügen - ich habe das von jmd anderem aus dessen script kopiert - dises script legt die punkte auch so an,und läuft schon über ein jahr bei mir

                                            vielleicht probleme lönnten kommen, wenn man mit sowas wie aufzählungen arbeitet - weil man dann die punkte im "raw-tab" ändern müßte

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            931
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            4
                                            130
                                            10393
                                            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