I participate in several Telegram groups, and I want each group to have its own bot.
Yes, I can have a single bot talking to different channels/groups, that’s what I do now, but I still think having separate bots is more elegant and better maintainable.
Indeed. And as @lugia already mentioned in the feature request, it’s just better readable and maintainable if you have the possibility to work with multiple Telegram bots as you can give them different names.
I just use different chat groups. The one home assistant bot can notify my General alert group that everyone has access to, or the System group that only I have access to.
I have a telegram group for all our family members. In this group go automated announcements (washing machine needs emptying, bins need taking out, etc.)
Variety is the spice of life so I use different telegram bots for different areas; health (“don’t forget to take your tablets”, “well done you’ve run 200km this month!”), household (“you’ve left home but the lights are still on”), gaming (“two of your steam friends are playing terraria, do you want to go join them?”).
I do this by using node-red. Node-red has a little hurdle to get to figure it out but once you do it’s brilliant. It has some great telegram nodes that you can use to interact with your bots and process information, requests, etc.
This is the best way I have found for having multiple telegram bots in Home Assistant
I’m waiting for a solution for multiple bots too. In domoticz I could use multiple bots and send message to my girlfriends phone through her bot and to my phone to my bot. I know I can use a group account but I dont want that. Hopefully someone figures it out.
I have now set it up to use groups, in the end better I have now a group called Home Assistant alerts with the logo so that is cool. So I created a group for me with my bot and one for my girlfriend with my bot. That worked so far. However when I use the notify.telegram_jd it is sending messages to both groups instead of only my group. I want notify.telegram_jd to sent to my group and notify.telegram_ca to my girlfriends group only.
@JDv1 - have u managed to fix it?
The things which little conusing me is that user_id ,
user_id is uniq (single one ) for each telegram account ,
where the chat_id is created for each group.
so i did the following
1.create Bot_X → added to new group_A → chat_id -8XXXXXXXX
1.create Bot_Y → added to new group_B → chat_id -8XXXXXXXX
The yaml is still the same as in the picture above. I have one bot and sen to two group ids. One group with bot for me and a group with bot for my girlfriend. One you created the groups add @IDbot to the group and it will give you the id. For me I gave me a number with a minus sign in front of it you have to include this in home assistant so -12345678
Telegram Account
Account -1 is on xxxxx mobile number (My 1st telegram account)
Account -2 is on yyyyy mobile number (my 2nd telegram account)
I want to configure telegram notification on xxxxx mobile number (chat id-111111) & able to push notifications to 1st telegram account on my mobile
I called to service name as abc in home assistant
my second number telegram account with the number yyyyy number and my chat id is 222222
I called to service name as xyz in home assistant
this chat id I added this a Yamal configuration. no configuration error in the home assistant when i check.
when I call service abc it’s not pushing the message to the telegram account with mobile number xxxx. when I call the service xyz for my second telegram account no mobile no yyyy it’s not pushing the message to my snd telegram account
please let me know how can add an additional account
I know this is an old thread, but I spent way too much time last night trying to figure this out. This configuration works perfectly for me, thanks for sharing it.
Thanks for this @PuckStar (post 13 in this thread). One Bot posting to two (or more) chats is good enough for me. Good to know Node-Red can do something if I want to use multiple Bots one day.
Maybe worth mentioning that adding “GetIDs Bot” as a user to your group (three dots / View Group info / Add Members) returns a message with the chat id.
Without the right chat id you get: [homeassistant.components.telegram_bot] Error sending message: Chat not found.
https://www.home-assistant.io/integrations/telegram/ refers to the GetIDs Bot on initial set-up. Other bots are available, but I need to get out of this rabbit hole. Last thing, I don’t know if it matters, in notify: that initial set-up page has platform followed by name, whereas this solution has name followed by platform.