MQTT Time Stamp Error

Dear to All,
I am receive from a Mqqt Broker a correct Json Object. But I have attached error about the time stamp.

What is it mean?

It means what it says , it expected an numeric time stamp, but received an ISO time string.

You will need to put a function or change node and convert the value.

just a couple of minutes ago i solved this same Problem
you add a function node with

msg.payload = {
id: msg.payload.id,
model: msg.payload.model,
temperature_C: msg.payload.temperature_C,
humidity: msg.payload.humidity
}
return msg;

so you just give a id and from the originalPayload you copy the information, start with temperature and then add on by on

Thanks for the support,
I am try the following function, but what I need to write, in replace field ?
Thanks

[{"id":"5d7bf8ba.18af5","type":"inject","z":"8d22ae29.7df6d","name":"","props":[{"p":"payload[0][0].time","v":"2021-01-08T12:34:34.779Z","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":2940,"wires":[["a959787b.07cef"]]},{"id":"a959787b.07cef","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"payload[0][0].time","pt":"msg","to":"$toMillis(payload[0][0].time)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":2940,"wires":[["4dff0770.25d2c"]]},{"id":"4dff0770.25d2c","type":"debug","z":"8d22ae29.7df6d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":670,"y":2860,"wires":[]}]

A simple example

Thanks E1cid, It is works!!!.

But the problem is that now influx DB doesn't show any measuraments, because is not present the databese time...

Are you trying to add a record for the current time? If so then you don't need to put the timestamp in at all, just delete it from the payload.

Also show us what is in the other element of the array.

OK!!, It is working, Tnx to all

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.