everything has worked so far, but now I have no idea.
Given: A thermometer sending data via wifi and mqtt. I want to display that in Grafana. Works fine with "mqtt in", my InfluxDB and Grafana. The data format (displayed with mosquitto):
****/*****/Garden/status/humidity:0 {"id":0,"rh":65.6}
The devices also send the voltage of the batteries, format (with mosquitto) is this:
****/*****/Garten/status/devicepower:0 {"id": 0,"battery":{"V":6.18, "percent":100},"external":{"present ":false}}
Unfortunately there is this error:
Error: A 400 Bad Request error occurred: {"error":"unable to parse 'SpannungGarten battery=[object Object],external=[object Object],id=0': invalid boolean"}
Is the error coming from an influxdb Out node? If you click on the node id above the error message it should take you to the relevant node. Even better, if you have named all your nodes then the name will appear in the debug pane.
If it is coming from an Influxdb Out node then the problem is that the payload you have shown is not valid for writing to influxdb. If you look at the help text for the node it tells you the valid payload formats. Influx cannot cope with structured data (objects within objects) it must only have fields and tags.
Influx cannot cope with structured data (objects within objects) it must only have fields and tags.
The problem is the battery object
{
"id": 0,
"battery": {
"V": 6.17,
"percent": 100
},
"external": {
"present": false
}
}
Is there a way to preprocess the data, e.g. by filtering just for the V (for voltage) object like I would do it using jq (jq .battery.V)? Or an other solution?
Can you post the actual message actually sent the InfuxDB Input Node?
Add a Debug Node and then, from the right hand sidebar in the Debug Window enclose a copy of the complete message between </> so that we get an exact copy. We can then work on that.
Have a look at the node red docs Working with Messages. That should get you started.
If you are a beginner then I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.