How to send messages by telegram when a condition is met

hello guys I have this project, but I want to add a function that sends me a message by telegram when the capacity is full I'm a newbie in this I hope you can help me

Hello and welcome to the forum.

The contents of your function node looks fine to me. One thing I would do is change the test to >=5, otherwise it will only send a message when the capacity is exactly 5.

Have you tried a simple test-flow with an Inject node, your function and the Telegram sender node?

This is my test flow - that works fine on my Raspberry Pi.

I don't know if the chatId you show is your actual chatId. If it is I suggest you edit it or remove it, otherwise people could send you spurious messages. I'm using a global for my chatId in the function node.

I've also introduced a 'Rate Limit' (an option in the delay node) as I'm sure your next question (once you get your flow working) will be "I only want to send a single message, not loads of messages".

node-red-answer_C

Hope this helps you get your flow working.

1 Like

thank you very much for your help, it works fine

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.