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

latest telegram bot node-red-contrib-chatbot 0.17.5 has issues with HA ( it’s not working ).
I suggest, until fixed and you if updated by mistake, to try node-red-contrib-telegrambot-home that is working fine with HA.
it needs to reconfigure every telegram node but at least telegram will work again.

Yeah, don’t update. I’ve had to resort to using call-service nodes and the telegram_bot service to send notifications for the time being.

Yes, I can’t select the transport and Bot Configuration in the Conversation node! Drop-down lists are empty! node-red-contrib-chatbot ver. 0.17.8. Node-Red installed in hassio in the Community Hass.io Add-ons Node-RED addon

That’s the issue, not fixed as of now. Hope it will, but for now use the other telegram bot, for me it’s working fine at least.

I’m on 0.17.8, sender and receiver seems working fine. didn’t try other nodes yet.

Thats right for “clean” Node-Red instal, not for Docker with Hassio

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