[HowTo] Setting up a Telegram Bot for all your Home Automation messages

Thanks for this guide, it was super helpful. I have it working for the most part except I cannot get the log file to work for the life of me. I have the file located in /www/telegram/telegram.log and I have tried using /local/telegram/telegram.log and even /shared/ and /config/ but none of them seem to work.

Also I’m unable to send something to two different users using the same bot. I added both user id’s separated with a comma to the config but only my phone gets the message. Anyone have this working?

Same question here, cant get the logfile working.
And some google-fu is not helping

I figured out the location for the log file. I have /config/www/telegram/telegram.log and that works fine for me. You just need to create the file first and point the node to the correct location. I wish the documentation was a little more clear.

1 Like

Whenever I open Edit Button node I am getting a pop up:

Also not of my buttons are saving for some reason.

Hi ne0ark,

do you still need help?
How does your “nodered addon” configuration part look like?
please remove secrets

Thanks for this, I’m looking to set a log file up myself, can I ask what OS you are using?

Need some help with what should be relatively simple. I have Telegram bot set-up in Node Red, able to send static message through when triggered, however I am not clear how to pass msg contents (topic and payload) from Node Red flow into the message node for telegram. I think this sits with the need to add a function node or set formatting in the telegram message noe, but need help with formatting to get contents through to telegram.

Thanks in advance.

Can you give an example of what you want to send? I have some running and might be able to help.

Thanks. I have a location entity state (from iOS app) sent from HA into Node Red and Node Red picks this up and parses a locale based on some processing that winds up completing with a msg.payload:

{"topic":"Location Alert","payload":"Joe is at work.","data":{"entity_id":"device_tracker.xxxxx","old_state":{"entity_id":"device_tracker.xxxx","state":"work","attributes":....}

I want to just send the message payload “Joe is at work” through to Telegram through the Telegram_Sender node. I can set up a separate “Text” message node for each different payload, however would rather just send the payload from one of many through a single flow if that makes sense?

HI, can you try to make a function node with:

msg.payload = {}
msg.payload.chatId = YOURCHATID
msg.payload.type = "message"
msg.payload.content = msg.payload
return msg;

Sorry for the late reply. I’m using a Ubuntu virtual machine on my Windows PC.

No problem, thanks for the reply. I managed to find it in the end :slight_smile:

Hello,

I have this running for a very long time very successfully.

But now it is time to multiply… I want an extra phone to receive the same messages.

I use:

Read all documentation, googled, tried with chatids, usernames, etc. But I can’t get my head around it.
What do I need to do to send a flow-outcome to multiple phones? Where do I need to “multiply”?

Depends how you want to setup Telegram on the second phone, a separate/dedicated Telegram account (for use by another individual) or a shared Telegram account for both phones (only used by you).

If you use a separate Telegram account, for example, you can add a second Telegram configuration node in Node-RED.

As far as I known you also can add the second user ID in the existing Telegram bot configuration node.

Documentation:

Also beware, as far I understand, using Telegram in HA (by configuration made in configuration.yaml) is separated from the Node-RED configuration, so don’t mix that up.

Documentation:

I didn’t tried this myself, I have an other setup (dedicated Node-RED config on a dedicated Node-RED server) so maybe someone else could chime in.

EDIT: Also you can check @gerard33 solution if it is suitable for you:

and/or

https://community.home-assistant.io/t/telegram-bot-group-chat-to-control-garden-lights-with-inline-keyboard

Hi all,

I don’t know why but for months all my node-red-contrib-chatbot nodes had the same look, and recently nothing work any more and it refused to update in node-red add-on.

I found the working trick here below and now I have the newest nodes withe the adequate illustrations ands hopefully it works !

1 Like

Hi guys, I know this is an older post but I find suitable for some of my projects. I can’t figure out where to find this node.node Can some one provide the exact name of this particular node or its replacement?

Thanks in advance.

I’d guess that it would be the same node that is linked in the very first post.

@Domoticon is it possible to use variables in button node? i cant get it working…
image

Sorry for the late respond.
I don’t know for sure, but I think you need an upstream function node to construct a msg.payload as input for the button.
Check the button node inside help:

Buttons can be created programmatically by an upstream Function node passing array of buttons in the message payload: …

Thank you tremendously for this method of determining the chatid for my Telegram bot. It worked perfectly!