[SOLVED] Telegram Multiple chatbots

Hi all,

I’m new to HA (migrating from Domoticz to HA)
I’m trying to setup HA to sent me notifications/messages.
At this moment I still use Domoticz and migrating to HA.
In Domoticz I use 3 Telegram chatbots:

  1. Notifications
  2. Garage
  3. Frontdoor

I sent different messages to the different chatbots.
Example:
chatbot Notification: Daily Solarpower production
chatbot Garage: automated snapshots when movement is detected by camera
chatbot Frontdoor: automated snapshots when movement is detected by an other camera, and also snapshot by camera when doorbell is pressed.

I have created (for now) 2 automations:

  1. Sent solar production to chatbot Notifications
  2. Sent picture from camera on movement to chatbot frontdoor

In config.yaml I have:

telegram_bot:
  - platform: polling
    api_key: "key of chatbot Notification" 
    allowed_chat_ids:
      - 123456789 (example!)
  - platform: polling
    api_key: "key of chatbot frontdoor"
    allowed_chat_ids:
      - 123456789 (example!) (exactly the same as obove, I only have 1 chat ID)

notify:
  - platform: telegram
    name: "Notifications"
    chat_id: 123456789 
  - platform: telegram
    name: "Frontdoor"
    chat_id: 123456789 

So automation 1 should deliver message to chatbot Notifications
and automation 2 should deliver message (picture) to chatbot Frontdoor.

Automation 1 works but delivers messages to Frontdoor and notifications doesn’t work at all.

What am I doing wrong?

I hope somebody can help.

Regards!

I use four chat groups and only need one api key:

telegram_bot:
  - platform: webhooks
    api_key: !secret telegram_api_key
    parse_mode: html
    allowed_chat_ids:
      - !secret telegram_general_chat_group_id
      - !secret telegram_nvr_chat_group_id
      - !secret telegram_ping_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
      - 127.0.0.1/32

notify:
  - platform: telegram
    name: telegram_general
    unique_id: 40b0937a-ae1c-4f60-89b6-b3c4d9915e67
    chat_id: !secret telegram_general_chat_group_id

  - platform: telegram
    name: telegram_nvr
    unique_id: 9f8937a5-4be8-4d4e-8076-b70430e76831
    chat_id: !secret telegram_nvr_chat_group_id

  - platform: telegram
    name: telegram_ping
    unique_id: f735d58d-bb4d-4134-8850-d8d995d765b9
    chat_id: !secret telegram_ping_chat_group_id

  - platform: telegram
    name: telegram_system
    unique_id: 9926af3b-ef60-4873-b646-e7a8b7b37037
    chat_id: !secret telegram_system_chat_group_id

Hi Tom,

Ok. So in Telegram just 1 bot with 1 API key and then create groups and add the created bot to the group? Then in config.yaml the configuration of the groups with the groupID.

In my old chats I had for each chatbot an seperate chatID, but I can’t get/find the chatID’s anymore of the seperated chatbots anymore.Has Telegram stopped with ChatID’s of chatbots?

Honestly it’s ages since I set this up and can’t remember exactly how I did it, however I do remember this post being a great help: Telegram bot notifications and communication

Thank you for your responds, Will have a look at that, For now I managed to fixed what I wanted based on groups in Telegram.