I actually solved my idea in a different way than having 2 bots.
I have 1 bot but two telegram groups.
1 group for generic notifications and the other for urgent notifications.
I added the chat id’s of those 2 groups to the allowed chat ids:
So now in an automation I can send it to either of the 2.
If you also add (both under telegram_bot as under notify) for instance the chatid of your own telegram account (so not the groups but your private one), you can also send notifications only to yourself instead of the groups. I did that because my wife is in the groups but some notifications really only need to go to myself.
Having groups you will see messages arriving from different “users” in telegram android/iphone app correct?
Will investigate how to do these different groups, and use also @clyra idea of mqtt, I like way more of doing changes without having all the time to restart HASS
I had the same problem. I want a “standard bot” for info and a small chat app I created (turn lights on/off, set cover position, get gas prices…), but I wanted another bot for urgent alarm messages (water leakage…). It didn’t work with groups for me, because I want my fitness tracker (Mi Band) to vibrate aggressively in an urgent case, and I didn’t manage to set up “Tools & Mi Band” (an app) to distinguish between the groups, as both messages come from the same contact/bot.
That’s why I extended my appdaemon app, that I wrote a long time ago when I had an unstable internet connection (that’s why all the ping and check stuff is in the app. I could remove that one day…).
It listenes for an event called “custom_notify”. Any automation (or appdaemon app) can send it. If you provide a target that is defined in configuration.yaml, it will send the message to that target. If traget == “special_bot”, you have to provide the token of that bot (I accidently called it api_key) and the chat_id it should be sent to.
By that, I can send a message via every bot I want, and I do not disturb the “standard bot” configuration of home assistant.
You are just a GENIUS! Thank you so much!
I do not understand why this is not a very popular topic.
I think this is a very important issue.
You need a channel for regular notifications, for history, and you need a separate channel for the most important notifications. Type of alarm.
Just awesome! Thanks again!
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.