Node-RED FUNCTION node
Hi,
I have a problem with my Node-RED flow;
I want to receive a message through telegam when the value from the sensor coming from MQTT is less than 3000.
In the flow, right after the MQTT receive node, I have a function with the following code:
const value = msg.payload
if (value < 3000){
msg = {
“chatid”: “6127774265”,
“type”: “message”,
“content”:”Water”
}
}
return msg;
The debug message from the DEBUG node which is right after the FUNCTION is:
undefined…
While the TELEGRAM node message, which is in parallel with the debug node, have this message in the debug pane:
msg.payload is empty
Could you help me to solve this issue?
Read more here: Source link
