Weiter zum Inhalt
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Hell
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dunkel
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. English
  3. Scripting / Logic
  4. JavaScript
  5. time of the last change of a data point.

NEWS

  • Neuer ioBroker-Blog online: Monatsrückblick März/April 2026
    BluefoxB
    Bluefox
    8
    1
    796

  • Verwendung von KI bitte immer deutlich kennzeichnen
    HomoranH
    Homoran
    10
    1
    594

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    18
    1
    1.1k

time of the last change of a data point.

Geplant Angeheftet Gesperrt Verschoben JavaScript
9 Beiträge 3 Kommentatoren 1.9k Aufrufe 2 Beobachtet
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • F Offline
    F Offline
    franzda
    schrieb am zuletzt editiert von
    #1

    is there a way in javascript (for node-red) to query the time of the last change of a data point.
    The system "knows" this because the time is displayed in the object list.

    paul53P OliverIOO 2 Antworten Letzte Antwort
    0
    • F franzda

      is there a way in javascript (for node-red) to query the time of the last change of a data point.
      The system "knows" this because the time is displayed in the object list.

      paul53P Offline
      paul53P Offline
      paul53
      schrieb am zuletzt editiert von
      #2

      @franzda

      let lc = getState(id).lc;
      // Trigger:
      on(id, function(dp) {
         let lc = dp.state.lc;
      });
      

      Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
      Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

      F 2 Antworten Letzte Antwort
      0
      • paul53P paul53

        @franzda

        let lc = getState(id).lc;
        // Trigger:
        on(id, function(dp) {
           let lc = dp.state.lc;
        });
        
        F Offline
        F Offline
        franzda
        schrieb am zuletzt editiert von
        #3

        @paul53 Hi Paul thank you for very quick response. The question ist how can I access to the ts property. I mien ts is the value I am looking for.

        paul53P 1 Antwort Letzte Antwort
        0
        • F franzda

          @paul53 Hi Paul thank you for very quick response. The question ist how can I access to the ts property. I mien ts is the value I am looking for.

          paul53P Offline
          paul53P Offline
          paul53
          schrieb am zuletzt editiert von
          #4

          @franzda sagte: how can I access to the ts property.

          .ts instead of .lc.

          Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
          Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

          1 Antwort Letzte Antwort
          0
          • F franzda

            is there a way in javascript (for node-red) to query the time of the last change of a data point.
            The system "knows" this because the time is displayed in the object list.

            OliverIOO Offline
            OliverIOO Offline
            OliverIO
            schrieb am zuletzt editiert von
            #5

            @franzda

            1. you insert a node "iobroker in"
            2. select your datapoint as topic
            3. select object in payload
            4. then you select a function node with the following code
            msg.payload=msg.payload.lc; //or msg.payload.ts
            return msg;
            

            5 for testing purpose you can connect the function node with a debug node

            Meine Adapter und Widgets
            TVProgram, SqueezeboxRPC, OpenLiga, RSSFeed, MyTime,, pi-hole2, vis-json-template, skiinfo, vis-mapwidgets, vis-2-widgets-rssfeed
            Links im Profil

            F 2 Antworten Letzte Antwort
            0
            • OliverIOO OliverIO

              @franzda

              1. you insert a node "iobroker in"
              2. select your datapoint as topic
              3. select object in payload
              4. then you select a function node with the following code
              msg.payload=msg.payload.lc; //or msg.payload.ts
              return msg;
              

              5 for testing purpose you can connect the function node with a debug node

              F Offline
              F Offline
              franzda
              schrieb am zuletzt editiert von
              #6

              @oliverio Hi Oliver Thank you for quick response. it works

              F 1 Antwort Letzte Antwort
              1
              • F franzda

                @oliverio Hi Oliver Thank you for quick response. it works

                F Offline
                F Offline
                franzda
                schrieb am zuletzt editiert von
                #7

                @franzda said in time of the last change of a data point.:

                @oliverio Hi Oliver Thank you for quick response. it works

                this is my code thank you for helping: (two different formats for testing)

                   // ---  
                  sensor.neulcT = (new Date(msg.payload[i].lc)).toLocaleTimeString();
                  sensor.neulc =  (new Date(msg.payload[i].lc)).toLocaleString();
                  // ---
                
                1 Antwort Letzte Antwort
                0
                • OliverIOO OliverIO

                  @franzda

                  1. you insert a node "iobroker in"
                  2. select your datapoint as topic
                  3. select object in payload
                  4. then you select a function node with the following code
                  msg.payload=msg.payload.lc; //or msg.payload.ts
                  return msg;
                  

                  5 for testing purpose you can connect the function node with a debug node

                  F Offline
                  F Offline
                  franzda
                  schrieb am zuletzt editiert von
                  #8

                  @oliverio
                  Hi Oliver Thank you for quick response. it works

                  this is my code thank you for helping: (two different formats for testing)

                     // ---  
                    sensor.neulcT = (new Date(msg.payload[i].lc)).toLocaleTimeString();
                    sensor.neulc =  (new Date(msg.payload[i].lc)).toLocaleString();
                    // ---
                  
                  1 Antwort Letzte Antwort
                  0
                  • paul53P paul53

                    @franzda

                    let lc = getState(id).lc;
                    // Trigger:
                    on(id, function(dp) {
                       let lc = dp.state.lc;
                    });
                    
                    F Offline
                    F Offline
                    franzda
                    schrieb am zuletzt editiert von
                    #9

                    @paul53 hi Paul Thank you for quick response. it works

                    this is my code thank you for helping: (two different formats for testing)

                       // ---  
                      sensor.neulcT = (new Date(msg.payload[i].lc)).toLocaleTimeString();
                      sensor.neulc =  (new Date(msg.payload[i].lc)).toLocaleString();
                      // ---
                    
                    1 Antwort Letzte Antwort
                    0

                    Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.

                    Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.

                    Mit deinem Input könnte dieser Beitrag noch besser werden 💗

                    Registrieren Anmelden
                    Antworten
                    • In einem neuen Thema antworten
                    Anmelden zum Antworten
                    • Älteste zuerst
                    • Neuste zuerst
                    • Meiste Stimmen


                    Support us

                    ioBroker
                    Community Adapters
                    Donate

                    317

                    Online

                    32.8k

                    Benutzer

                    82.9k

                    Themen

                    1.3m

                    Beiträge
                    Community
                    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                    ioBroker Community 2014-2025
                    logo
                    • Anmelden

                    • Du hast noch kein Konto? Registrieren

                    • Anmelden oder registrieren, um zu suchen
                    • Erster Beitrag
                      Letzter Beitrag
                    0
                    • Home
                    • Aktuell
                    • Tags
                    • Ungelesen 0
                    • Kategorien
                    • Unreplied
                    • Beliebt
                    • GitHub
                    • Docu
                    • Hilfe