remaing seconds to end time

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • J V
    LoxBus Spammer
    • 28.08.2015
    • 367

    #1

    remaing seconds to end time

    Hello,

    A schedule can give some remaining time in seconds (output Rt) if an override was made. Is there an easy way to convert this number of remaing seconds to the time at which it will end?

    I've found a way to convert seconds to hours, minutes, seconds ( https://www.loxone.com/enen/question...format-hhmmss/ ), but it still is remaining time rather then the time it will end. Of course it is possible with a number of formulas and mods and divs... or by converting the current time to seconds, adding up and converting back but I wonder if perhaps I'm not missing a functionality that it already present somewhere...

    Thanks,

    Jörg
    Zuletzt geändert von J V; 08.10.2022, 22:16.
  • Tico
    Lox Guru
    • 31.08.2016
    • 1035

    #2
    I don't think you're missing a functionality that will do it simply. Notwithstanding, here is a formula that will do it with a minimum of blocks -

    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: EIB Time.png
Ansichten: 516
Größe: 18,8 KB
ID: 360205
    Code:
    ((I1* 65536)+(I2* 256)+I3)+(INT(I4/60/60)*256*256 + INT(I4/60 - INT(I4/60/60)*60)*256 + (I4 - INT(I4/60)*60))

    The 'seconds remaining' goes into AI4 of the Formula block. This gives the time at the end of the override, but unfortunately it will revert to the current time when AI4 reaches 0.
    Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

    Kommentar

    • J V
      LoxBus Spammer
      • 28.08.2015
      • 367

      #3
      Thanks!
      Quite an elegant formula - basically adding up the seconds to the current time, but at the same time converting to EIB-time.... Nice!


      The fact that it reverts to current time when AI4 reaches 0 is logical, and if desired easily changed in the status block (add it as another input).
      Zuletzt geändert von J V; 09.10.2022, 16:31.

      Kommentar

      • J V
        LoxBus Spammer
        • 28.08.2015
        • 367

        #4
        It works nice, but starts getting difficult once you pass a number of days... I want to use it for a timer on a heating setting (e.g. holiday), so an end date would be nice. Seeing the miniserver has little information on the number of days in a month and so, it will get very elaborate to make it show the end date. I may do this in time, but for now I will use the countdown translated to days, hours, minutes, seconds using the formula from the first link (I will post the modification to add the days counter but don't have it here now).

        Kommentar


        • J V
          J V kommentierte
          Kommentar bearbeiten
          Just to post the formula that removes anything above 24 hours: INT(I1/60/60-INT(I1/60/60/24)*24) *256*256 + INT(I1/60 - INT(I1/60/60)*60)*256 + (I1 - INT(I1/60)*60)
      • Tico
        Lox Guru
        • 31.08.2016
        • 1035

        #5
        The unit <v.u> in a Virtual Status might help -

        Klicke auf die Grafik für eine vergrößerte Ansicht

Name: Loxone Epoch.png
Ansichten: 460
Größe: 26,0 KB
ID: 366366
        Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

        Kommentar

        • J V
          LoxBus Spammer
          • 28.08.2015
          • 367

          #6
          I did not know about the virtual status (the documentation is quite lacking on that one: https://www.loxone.com/enus/kb/virtual-status/ )... thanks!

          While it won't be integrated with the status block that shows other things, but I think I can make it work visually anyway (using a linked block).

          Kommentar

          • klexi
            Smart Home'r
            • 05.01.2020
            • 44

            #7
            Hi, I would like to add the value of the time counter to the log file. If I connect the status block (<v1.m>) directly to the time counter, the resulted value is not correct. If I split the value of the time counter to hours/minutes/seconds and use the result as inputs to the status block (<v1>h:<v2>m:<v3>s), the value will be correct.

            Kommentar

            • Tico
              Lox Guru
              • 31.08.2016
              • 1035

              #8
              The Status Block with <v1.m> can't use seconds as a direct input. The <v1.m> uses EIB format, which groups a time value into three distinct bytes. The attached picture shows how to convert current time to EIB time.You will see the value from the Time Formula changing every second. But this is not 'seconds' per se, but a related value.


              Klicke auf die Grafik für eine vergrößerte Ansicht

Name: Sequence.gif
Ansichten: 445
Größe: 35,2 KB
ID: 369063
              Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

              Kommentar

              • klexi
                Smart Home'r
                • 05.01.2020
                • 44

                #9
                Hi, I do not understand. What do I have to change in order to show the correct time?

                Klicke auf die Grafik für eine vergrößerte Ansicht

Name: image.png
Ansichten: 388
Größe: 19,0 KB
ID: 369237

                Angehängte Dateien

                Kommentar

                • Tico
                  Lox Guru
                  • 31.08.2016
                  • 1035

                  #10
                  The output of 'To' needs to be in seconds. ie. Set the Time Unit (Tu) in the Operating Time block to 0.

                  The seconds value needs to be manipulated to a value suitable for use by the Status Block and the EIB format <v1.m>. The formula is as follows -

                  Code:
                  INT(I1/60/60)*256*256 + INT(I1/60 - INT(I1/60/60)*60)*256 + (I1 - INT(I1/60)*60)
                  This works fine except when the 'To' output becomes greater than 1 day. When this occurs, Loxone adds a day description in front of the Hr:Min:Sec. This is pictured in the second Operating Time Counter that has run for many days.

                  Klicke auf die Grafik für eine vergrößerte Ansicht  Name: EIB Format.png Ansichten: 0 Größe: 35,3 KB ID: 369248
                  Zuletzt geändert von Tico; 02.12.2022, 00:23.
                  Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

                  Kommentar

                  • snehvid
                    Extension Master
                    • 24.03.2022
                    • 123

                    #11
                    Hey,

                    I don't get it. I have a mistake in it, but I can't see it. Maybe it's too late... I would expect 01:09:01 instead of 25:09:01...

                    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: 1.png
Ansichten: 277
Größe: 18,6 KB
ID: 399477

                    Kommentar


                    • snehvid
                      snehvid kommentierte
                      Kommentar bearbeiten
                      Formula: ((I1* 65536)+(I2* 256)+I3)+(INT(I4/60/60)*256*256 + INT(I4/60 - INT(I4/60/60)*60)*256 + (I4 - INT(I4/60)*60))
                  Lädt...