• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Node-RED FUNCTION node

Q&A Forum › Category: Home Automation › Node-RED FUNCTION node
0 Vote Up Vote Down
Gaétan Bourgeois asked 2 years ago

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?

Question Tags: Node-Red
3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
Can you show me a printscreen of your flow?
And the settings of each node?
 
To share a picture, you need to upload it first to google drive, dropbox or imgur, for example and then, share a link to the files.
 
Regards,
Sara

0 Vote Up Vote Down
Gaétan Bourgeois answered 2 years ago

Hi Sara,
I found a work around so this issue is resolved.
Thanks

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Great!.
I’ll mark this issue as resolved.
If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.