NEWS
time of the last change of a data point.
-
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. -
let lc = getState(id).lc; // Trigger: on(id, function(dp) { let lc = dp.state.lc; }); -
@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.
-
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.- you insert a node "iobroker in"
- select your datapoint as topic
- select object in payload
- 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
-
- you insert a node "iobroker in"
- select your datapoint as topic
- select object in payload
- 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
-
@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(); // --- -
- you insert a node "iobroker in"
- select your datapoint as topic
- select object in payload
- 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
@oliverio
Hi Oliver Thank you for quick response. it worksthis 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(); // --- -
let lc = getState(id).lc; // Trigger: on(id, function(dp) { let lc = dp.state.lc; });@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(); // ---
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