Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • 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

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    22
    1
    1.2k

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    9.2k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    14
    1
    2.4k

time of the last change of a data point.

Geplant Angeheftet Gesperrt Verschoben JavaScript
9 Beiträge 3 Kommentatoren 1.6k Aufrufe 2 Watching
  • Ä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
                    Antworten
                    • In einem neuen Thema antworten
                    Anmelden zum Antworten
                    • Älteste zuerst
                    • Neuste zuerst
                    • Meiste Stimmen


                    Support us

                    ioBroker
                    Community Adapters
                    Donate

                    679

                    Online

                    32.5k

                    Benutzer

                    81.7k

                    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