Telegram problem with 2 bots

Hello,

i created a second bot, for other infos than the first one, but i cant get it to work correctly, he always post the messages in one bot, not how i set it in the second one.

my config:

telegram_bot:
  - platform: polling
    api_key: XXXX
    allowed_chat_ids:
      - 123456
  - platform: polling
    api_key: XXXXX
    allowed_chat_ids:
      - 123456

and

notify:
  - name: HA_Messenger
    platform: telegram
    chat_id: 123456
    api_key: xxxxx
  
  - name: HA_Messenger_spritpreise
    platform: telegram
    chat_id: 123456
    api_key: xxxxx

the problem is i have overall the same chat id?
why send he all messages now to one bot?

thank you

EDIT

i tried it over groups but how can i get the chatid of the group?

This is how I do it:

Configuration.yaml

telegram_bot:
  - platform: webhooks
    api_key: !secret telegram_api_key
    allowed_chat_ids:
      - !secret telegram_general_chat_group_id
      - !secret telegram_system_chat_group_id
      - !secret telegram_tom_id
    trusted_networks:
      - 149.154.160.0/20
      - 91.108.4.0/22

notify:
  - platform: telegram
    name: telegram_general
    chat_id: !secret telegram_general_chat_group_id

  - platform: telegram
    name: telegram_system
    chat_id: !secret telegram_system_chat_group_id

Invite the @GetIDs bot to your group to get the group id.

i created a group, then invited homeassitant (my regular bot) and the GetIds bot.

then i went to the webpage and get die chat id of the group. for example 01234

then i go to configuration.yaml and add this to my config

telegram_bot:
  - platform: polling
    api_key: 
    allowed_chat_ids:
      -  the old one 
      - 01234

notify:
  - name: HA_Messenger
    platform: telegram
    chat_id: 
  - name: telegram_group_spritpreise
    platform: telegram
    chat_id: 01234

but when i try to send a notifycation to the groups id, it cones nothing,

have you perhaps a “- symbol” before your group chat id?

Yes both my group chat ids have a dash in front of them. Try putting your chat ids in single quotes.

1 Like

wow after searching and searching, i found the poblem, at the front of the group chat id must be a - (minus) symbol

:scream: :scream: :scream: :scream: