Hi all,
New to Node-RED here, I would like to ask for advice with the following situation
Context:
I have a sensor that is throwing data to a mqtt broker, then is sent to Grafana cloud for real time monitoring, and I need the data to go to prometheus (also cloud) to generate historical data.
Today the data flow is:
“IoT device” -> brokemqtt in ec2 -> Grafana in cloud account.
I am wanting to set it up as follows:
“IoT device” -> brokermqtt -> node-red -> Prometheus in cloud account.
I managed to integrate the broker with node-red but when I run a test I get the following error from the http node, noticed the debug node connected directly to mqtt states an object and the debug mode connected to http request states a string, but im not really sure which would be the correct format.
8/6/2024, 21:23:22node: debug 147
test : msg.payload : string[51]
"{"code":"invalid","message":"error parsing points"}"
This is the output of debug node connected directly to mqtt in node:
8/6/2024, 21:23:22node: debug 146
test : msg.payload : Object
{ motion: "1" }
Adding the export of the flow im using
[
{
"id": "4948190ab7e83e81",
"type": "tab",
"label": "Flow 6",
"disabled": false,
"info": "",
"env": []
},
{
"id": "27546ba373b3314f",
"type": "http request",
"z": "4948190ab7e83e81",
"name": "",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "basic",
"senderr": false,
"headers": [],
"x": 1250,
"y": 340,
"wires": [
[
"487e21f982c5bc2b"
]
]
},
{
"id": "09385b9c1e9e223a",
"type": "debug",
"z": "4948190ab7e83e81",
"name": "debug 2491",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1250,
"y": 220,
"wires": []
},
{
"id": "af66a5dfdfe263b7",
"type": "mqtt in",
"z": "4948190ab7e83e81",
"name": "",
"topic": "test",
"qos": "0",
"datatype": "auto-detect",
"broker": "d6bfc762efe92b49",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 250,
"y": 260,
"wires": [
[
"09385b9c1e9e223a",
"27546ba373b3314f"
]
]
},
{
"id": "487e21f982c5bc2b",
"type": "debug",
"z": "4948190ab7e83e81",
"name": "debug 2492",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1510,
"y": 340,
"wires": []
},
{
"id": "d6bfc762efe92b49",
"type": "mqtt-broker",
"name": "",
"broker": "127.0.0.1",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closeRetain": "false",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]
Any comments about this are welcome!
Regards.-