Hi Paul,
Thank you for the reply.
I do have a working flow taking data directly from the 'OpenWeatherMap' node and going directly to an InfluxDB node, which works perfectly. (There are other nodes coming off them to other graphs and gauges on the Node Red dashboard).
The structure of that is like this...
{"_msgid":"b004ccb4.51f3f","topic":"","payload":{"weather":"Rain","detail":"moderate rain","icon":"10d","tempk":291.6,"tempc":18.4,"temp_maxc":20,"temp_minc":16.6,"humidity":72,"......... etc
So, I have been looking at this structure and trying to mimic it, this is where I am failing badly.
When using the wildcard on the MQTT node 'particle/#' and take it to the InfluxDB database, then I get the same thing, everything is recorded but under still under one value.
Time _______________ Value
1559587458347197296 0.00
1559587468997830053 1.00
1559587469102725981 1.00
1559587469104598577 1.00
1559587469105442636 1.00
1559587469105462480 1.00
1559587469106944193 1.00
1559587469107932001 342.00
1559587469108782154 98.00
1559587469110881833 10.00
1559587469111741882 0.00
1559587469111741986 0.00
1559587469113259271 0.00
What I would like is to see something like this.....
Time .............................. PM 1...... PM 2.5......PM 10.... 0.3um..... 0.5um..... etc....
1559587469107932001... 0.00.........1.00..........1.00.........342..........98........... etc...
(Ignore the dots, spaces don't register on here for some reason)
Anyway this is why I am thinking that I need to change the format and some how have the ALL the data in one message, hence the JSON string (I stand corrected about script/sting ) .
I will be adding more sensors to the ESP and adding those to the string too, but once I crack this, then adding more should not be a problem.
Ah well, another late night..
EDIT.....
Just for info, this is the part in my sketch to publish the data..
char pm10string[8];
dtostrf(data.pm10_standard, 1, 2, pm10string);
client.publish("particle/standard/PM10", pm10string);
char pm25string[8];
dtostrf(data.pm25_standard, 1, 2, pm25string);
client.publish("particle/standard/PM25", pm25string);
char pm100string[8];
dtostrf(data.pm100_standard, 1, 2, pm100string);
client.publish("particle/standard/PM100", pm100string);
char pm10string_env[8];
dtostrf(data.pm10_env, 1, 2, pm10string_env);
client.publish("particle/env/PM10", pm10string_env);
char pm25string_env[8];
dtostrf(data.pm25_env, 1, 2, pm25string_env);
client.publish("particle/env/PM25", pm25string_env);
char pm100string_env[8];
dtostrf(data.pm100_env, 1, 2, pm100string_env);
client.publish("particle/env/PM100", pm100string_env);
char p03[8];
dtostrf(data.particles_03um, 1, 2, p03);
client.publish("particle/0.3", p03);
char p05[8];
dtostrf(data.particles_05um, 1, 2, p05);
client.publish("particle/0.5", p05);
char p10[8];
dtostrf(data.particles_10um, 1, 2, p10);
client.publish("particle/1.0", p10);
char p25[8];
dtostrf(data.particles_25um, 1, 2, p25);
client.publish("particle/2.5", p25);
char p50[8];
dtostrf(data.particles_50um, 1, 2, p50);
client.publish("particle/5.0", p50);
char p100[8];
dtostrf(data.particles_100um, 1, 2, p100);
client.publish("particle/10.0", p100);
Thanks
Martin