NR+influxdb+grafana

Can you type in the influx command line show field keys and show us what the response is.

You have asked for a field called numbers whereas the field is called value as you can see from the influx output. There is no field called numbers so the query returns no data.

How to change it ?
show field keys:

You have to select the field value in the query, because that is what the field is called. However, as I also said earlier, that field is of type string so you can't put it on a chart. You must look at how you are writing the data into influx (presumably in node-red) and change it so that it is a number and not a string. You will have to delete the whole measurement and start again, after you have changed node-red so that it is writing numbers. If you don't understand what I mean then add a debug node showing what you are writing to influx and you will see that the data value is a string.

I just have to ask this question - Martin, why do you have a database called Humidity with a table in it called temp? Does temp really mean temperature? or is it just a temporary table?

If you are recording temperature and humidity, why not call the database something like weather_readings? Use meaningful names for your schema and draw it on a peice of paper so you can reference it.

I was going to get onto that once something was working, in order to keep it simple.

1 Like

About the NR configurations: i came across this flow, which use functions that change the value to number.
https://flows.nodered.org/flow/56e2df61fbab7bb9c8b20b114ce1ccd3

When i try to use it, i receive this error.

Can this flow fix the value-number problem?

About the names of the DB's - i use only example names for now

Did you read the error message? It says that it is trying to write a float value to a field that is of type string. As I said you need to delete the measurement and start again with an empty measurement. It is not possible to change the type of a field you have already written to.

I read it, but don't understand it.
Do i have to delete only the measurement or the whole DB?

As I have said several times you need to delete the measurement.
Would it not have been quicker to try it rather than ask?

I'm scared to not do a mistake. That's way sometimes i repeat my questions (sorry)

Since you are only experimenting with a temporary database anyway it would not matter what you did with it.

Funny, i use convert functions in NR and i've got some ''number'' measurement, but in InfluxDB the same measurement appear like ''value''. And i've got measurement only for humidity, but for temperature i've got error. In Grafana i've got nothing.

It is the room temperature node it is complaining about. You are trying to write a field called value to the measurement temp. The value is a float but the field already exists and is of type string (at least I assume that is what you have not shown us at the end of the error message). If you use the show field keys command as you did before you will be able to see that.

show field keys

> show field keys 


name: humid
fieldKey fieldType
-------- ---------
value    float

name: temp
fieldKey fieldType
-------- ---------
value    string
> 
Error: A 400 Bad Request error occurred: {"error":"partial write: field type conflict: input field \"value\" on measurement \"temp\" is type float, already exists as type string dropped=1"}

As I said, the field called value in measurement temp already has type string in the database. You must have written a string to that at some point. I don't know why you keep posting the same problem, you have already been told the fix and in fact you came back and asked for confirmation about whether to drop the measurement or to delete the whole database.

I delete the measurement and start again to collect data via the new flow , but the result is the same.

What result is the same? The error? Showing no data? If error then what error? If no data then, once again, post the influx command line output (including the database selection), and the query inspector output. We are not telepathic, if you don't give us information then we can't help.

[Edit] also what command did you use to delete the measurement?

The results are: No data in Grafana
Query inspector:

{
  "request": {
    "method": "GET",
    "url": "api/datasources/proxy/1/query",
    "params": {
      "db": "HUMIDITY",
      "q": "SELECT mean(\"numbers\") FROM \"humid\" WHERE time >= 1597571341360ms and time <= 1597744141368ms GROUP BY time(2m) fill(null)",
      "epoch": "ms"
    },
    "data": null,
    "precision": "ms"
  },
  "response": {
    "results": [
      {
        "statement_id": 0
      }
    ],
    "executedQueryString": "SELECT mean(\"numbers\") FROM \"humid\" WHERE time >= 1597571341360ms and time <= 1597744141368ms GROUP BY time(2m) fill(null)"
  }
}

In influx data is still ''value'' (i posted pic. above ) the command for delete measurement : >DROP MEASUREMENT

Post a snapshot of the grafana query page please, even if you think you posted it before.