Various Telegram Bots in HA [SOLVED]

Hi,

I would like to know how I could have various Telegram bots declared in HA.
For instance, one for general information, one for alerts.

In the configuration, one bot can be declared and then one or various notifiers can be set-up for this bot, but I don’t see a way in the notifiers of specifying a particular bot to use, therefore I understand that only one bot can be parameterized at the same time :

  - name: NOTIFIER_NAME
    platform: telegram
    chat_id: CHAT_ID_2

Anyone has successfully done this ?
I’ve seen a post of someone doing this using Node-Red, but I’d like to keep to simple HA for now.

Thanks.

I have several group chats for different notifications levels.
My single bot is a member in all of them.

How does that work ?
I currently have various Bots created in Telegram : named as an example homeInfo, homeAlert.
In other systems, I used each bot with the same chatID (my phone), to receive a message in one chat or the other, having muted the homeInfo, and having the homeAlert with sound in Telegram.
If there is another way of doing it I’m eager to know how.

Thanks.

They’re just different Chat IDs for the bot

You can have a look at my config:
Define the bot and allow it to send messages to several chat ids (can be users or groups):

Create several notification entries using the telegram platform:

You can now use the service e.g.:
notify.group_notifications or notify.kevin (This is the secret behind ‘user_one_name’)

Excellent, many thanks.
Now instead of having a dedicated bot for each communication type (info, alert), I have a single bot that sends messages to dedicated groups…
It’s working great :smiley:

Update : working great, but getting a lot of errors in logs :

ERROR (updater) [telegram.ext.updater] Error while getting Updates: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running (409)

Did you experience that ?
Saw in other posts something to do with Node-Red. I have Node-Red installed but nothing on it yet.

Thanks

Reading once again another thread I finally understood that the problem was coming from the use of the same bot on another server I have.

To resume :

  • A bot can only be used in one place.
  • A bot can be used inside various group chats.
  • Inside HA, there can only be one bot at once, use it in group chats to enable various notification types.

Thanks.