Hi folks,
I have sensor data from an ESP32 being sent to node-red through an MQTT broker.
Out of the 38 values been sent from the ESP32, 6 of them will require to be sent to the Prometheus interface and then eventually to Grafana. I have successfully sent one value ("ambient") to Prometheus using the 'Prometheus out node' with the function node below. Is there a way to include additional values in this function, or should I create a function for each value that seems to be a tedious job?
Below is the complete object list of values from the ESP32.
msg.payload = {
"op": "set",
"val": parseInt(msg.payload.ambient),
"Labels": {
"tag_1": "Ambient",
}
}
return msg;
{"controllertype":"mySQM+","firmware":127,"uptime":"03:15:52","date":"01/01/1900","time":"00:00:00","sqm":17.25,"nelm":3.32,"lux":0.0136,"ambient":23.74,"humidity":44.2,"dewpoint":10.85,"pressure":1011.4,"slpressure":1012.24,"bme280alt":7,"skyambient":20,"skyobject":20,"skystate":1,"cloudcover":100,"raining":0,"rvout":0,"rainprevhr":0,"raincurrhr":0,"raincurrday":0,"windspd":0,"windavg":0,"windgust":0,"windchill":100,"beaufort":0,"winddir":0,"gpsdate":"01/01/1900","gpstime":"00:00:00","gpslat":"-77 00 00 S","gpslon":"166 00 00 E","gpsalt":0,"gpssat":0,"gpsfix":0,"mac":"78:E3:6D:0A:24:14","makehay":16.37}
Thanks in advance for any help.