Is it possible to get multiple telegram bots?

Well this still works fine for me (and it’s without appdeamon): Is it possible to get multiple telegram bots?

Yeah, but with the groups, and I’d rather like to avoid that. But thanks, I guess that will be the fallback :confused:

What are you after? I don’t think I understand.

Using two bots, to send directly to my telegram user. But I cant select which bot to send from.

1 Like

Same problem. I want to avoid seeing the “message arrived” warnings in HASS when using two different groups with a single bot.

The only way I have found to do this is through node-red, which works great.

This does not work for me, I get yaml configuration error. There apparently can be only one entry per platform in notify:

I’m on version core-2021.1.5 and this still works:

notify:
  - name: telegrambot 
    platform: telegram
    chat_id: !secret telegram_chatid1
  - name: telegramboturgent
    platform: telegram
    chat_id: !secret telegram_chatid2
  - name: telegramlwerk
    platform: telegram
    chat_id: !secret telegram_chatid3

On which version are you where this is not working (anymore)?

Same problem here. Any solution yet on how to use multiple telegram bots to send messages?

EDIT: I made the according feature request here:

1 Like

Why do you need to bots?

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.

1 Like

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

im afraid this method does not work in 2022.09. basically, i want to send alerts to other people’s Telegram account. has anyone figured out a way?

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.

This is my notifiers.yaml:

  - name: tg_house_group
    platform: telegram
    chat_id: -123456789
  - name: tg_house_andy
    platform: telegram
    chat_id: 987654321
  - name: tg_house_larry
    platform: telegram
    chat_id: 567894321

configuration.yaml:

telegram_bot:
  - platform: broadcast
    api_key: !secret telegram_bot_api
    allowed_chat_ids:
      - -123456789
      - 987654321
      - 567894321

Because it’s using the broadcast platform, it cannot receive messages back from telegram.

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.

This is how my config looks like

@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

telegram_bot:
  - platform: polling
    api_key: !secret api_telegram_token
    allowed_chat_ids:
      - !secret userid_telegram    
      
telegram_bot:
  - platform: polling
    api_key: !secret security_telegram_token
    allowed_chat_ids:
      - !secret security_userid_telegram  

notify.yaml:

  - name: my-ha
    platform: telegram
    chat_id: !secret userid_telegram
  - name: my-security
    platform: telegram
    chat_id: !secret security_userid_telegram

When i send notification for either notify.my_sequrity or notify_my_ha
it actually send both to group_a chat .

I started a new configuration changed nothing and all of a sudden it works.