Compare UNIX vs EPOC timestamps

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • edipseamm
    Smart Home'r
    • 03.02.2020
    • 49

    #1

    Compare UNIX vs EPOC timestamps

    Hey Guys

    I'm trying to find the best way to compare UNIX vs EPOC timestamps for monitoring the last communication.

    I was looking for a function to make the EPOC only significant to 10 digits, but I am struggling with this.

    Any ideas?

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

Name: Capture-0604-0734-000491@2x.png
Ansichten: 24
Größe: 48,3 KB
ID: 459129

    TIA
  • edipseamm
    Smart Home'r
    • 03.02.2020
    • 49

    #2
    I tried to extract the extra digits via command recognition s\s10 command, then subtract them from the original value to give me the same 10 digits to compare also but end up with extra 0s now.


    Also you can see '000' being added at the start of the command recognition but then being dropped on the Lv output.

    Click image for larger version  Name:	Capture-0604-0819-000492@2x.png Views:	0 Size:	38.7 KB ID:	459133

    Kommentar

    • edipseamm
      Smart Home'r
      • 03.02.2020
      • 49

      #3
      I tried also to use a memory flag to pass the value in then use the output v.10 for example but this did not give me the result I was looking for

      Kommentar

      • duncan
        LoxBus Spammer
        • 28.08.2015
        • 319

        #4
        ive used the zigbee2mqtt timestamp (input via a virtual text input) /1000 to remove the 000 then compare to the inbuilt unix timestamp
        Zuletzt geändert von duncan; vor 19 Stunden.

        Kommentar

        • Jan W.
          Lox Guru
          • 30.08.2015
          • 1393

          #5
          A division by 1000 might be enough as duncan said. You may also use an "INT" function in a formula function block (after the division) to remove the fraction if you need to compare exact values (equal) instead of greater or smaller.
          Miniserver v14.5.12.7, 2x Ext., 2x Relay Ext., 2x Dimmer Ext., DMX Ext., 1-Wire Ext., Gira KNX Tastsensor 3 Komfort, Gira KNX Präsenzmelder, Fenster- und Türkontakte, Loxone Regen- und Windsensor, Gira Dual Q Rauchmelder vernetzt, 1x Relais-Modul
          Loxberry: SmartMeter, MS Backup, CamConnect, Weather4Lox
          Lüftung: Helios KWL EC 370W ET mit Modbus TCP - via Pico-C
          Heizung: Stiebel Eltron WPF 5 cool (Sole-Wasser WP) mit ISG, FB-Heizung mit 18 Kreisen, Erdsonde - via modbus/TCP
          Node-RED: IKEA Tradfri

          Kommentar

          • edipseamm
            Smart Home'r
            • 03.02.2020
            • 49

            #6
            Ahh yeah that worked. When I had tested this before i had not noticed the decimal point (.)

            Example for others. Monitoring if the time is greater than 1 day (86400)

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

Name: Capture-0604-1928-000493@2x.png
Ansichten: 0
Größe: 43,2 KB
ID: 459175
            Angehängte Dateien

            Kommentar

            • edipseamm
              Smart Home'r
              • 03.02.2020
              • 49

              #7
              Zitat von Jan W.
              A division by 1000 might be enough as duncan said. You may also use an "INT" function in a formula function block (after the division) to remove the fraction if you need to compare exact values (equal) instead of greater or smaller.
              Ahh yes the INT is what I needed. A simple INT(I1-I2) worked for me

              Kommentar

              • edipseamm
                Smart Home'r
                • 03.02.2020
                • 49

                #8
                And to simply further: INT(I1-(I2/1000))

                Thanks for these pointers

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

Name: Capture-0604-1933-000494@2x.png
Ansichten: 0
Größe: 40,7 KB
ID: 459178

                Kommentar

                Lädt...