We learned here how to send notification using Pushbullet. In most cases this should be enough but in my case I wanted a little more.

With Telegram and Node-RED you can receive and send messages/photos/videos from and to your automation system.

Get your own Node-RED in the cloud! Free for iotwithus.com users!

In this article I will show you how to send a message from Node-RED to your phone using Telegram, let’s begin:

1.Creating a Telegram bot

Open Telegram and search for “BotFather”. Using this bot you can create, delete and manage all your bots.

Start creating your bot using the /newbot command.

You will receive a token that will be used by Node-RED to access Telegram

2. Install Telegram plugin to Node-RED

Click on the menu icon on the top right corner then “Manage Palette”.

Search for “telegrambot” and click Install.

You will now have 5 more nodes in the left palette.

3. Configure your bot

Add a Telegram sender node to your flow and click on it.

Click the pencil icon to add a new bot to your Node-RED

Next we have to enter a “Bot-Name” and a “Token”. You created them in step 1.

All done. Your bot is ready!

4. Find your Telegram ID

We created a bot that could tell you your Telegram ID. Ask it for your ID using /myid command.

Click here to chat with our bot.

5. Send your first message!

First you have to start your bot. Search for it in Telegram and click on Start.

To send a message to Telegram, add an inject node and an function node. You should have something like this:

In the function node we have to create the message. It should contain:

msg.payload = {}
msg.payload.chatId = your-id-here
msg.payload.type = ‘message’
msg.payload.content = ‘hello from node-red!’
return msg;

You can now click on the left of the inject node to send your first message!