Pushing data from MQTT to influxdb

I am trying out a simple scenario, reading sensor data from mqtt (json formatted), and pushing it into an influxdb bucket.
messages look like this:

{"time": "2022-03-12T07:19:32Z", "temperature": 19.1875, "sensors": 3, "humidity": null}

on the mqtt node I have the output set as "a parsed json object" and indeed I see this as an object in a a debug node.

However when I pipe this into an InfluxDB node I get the following message:

"HttpError: unable to parse 'house sensors=3,temperature=19.20833 2022-03-12T07:17:32Z': bad timestamp"

The measurement is called "house".
Any suggestions on how to get this working?

If the timestamp is the current time then remove that from the data, influx will automatically add the record at the current time for you.

If you do want include the timestamp then I think you have to provide it as a number in the units specified in the node (milliseconds for example).

Also I am not sure that you are allowed to have null elements. If you haven't got a value then don't include it in the data.

Thanks @Colin I ended up using a change node to select attributes in the object, and feeding the data into influxdb piecemeal

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