I'm trying to use telegram to advise a high temperature from my sensor and I have two doubts. Firstly I need to do a function to filter out temperatures up to 30. Secondly in Telegram I can't solve the problem about ChatID, I put the firsts numbers of my token and it doesn't work, after it I send a message from Telegram to my Node-Red and I copied the chatID, but not works.
Somebody knows how I can solve that? I attach an image with explanations but the newest Telegram explanation is in this text.
You can find your chatID with the telegram-receiver-node. Just connect it to a debug node. Now, go to telegram, find your bot, and start a conversation with f.e. "Hi". In nodered you should see the debug output which includes your chatID
In the future please copy/paste the code (using the </> option) instead of a screen shot
You are getting the red X, on line 3, because you haven't defined the variable Message. Since you are referencing msg.Message on line 9, line 3 should be 'msg.Message'
Well finally the correct function in my case is the next. Thanks to all for your help. @greengolfer I've tried with & but it doesn't works, the Message is incorrect.
if (msg.payload.temp_ext >= 20)
msg.Message = 'Alert, The sensor with ' + msg.payload.deveui + ' its burning';
msg.payload = {
chatId: 1439100392,
type: "message",
content: msg.Message
}
return msg;
Yeah, we have all been there, first time. The error you made, I just asked myself if this was the first time you were writing javascript. There are many good sources online for free