totolino
(totolino)
May 11, 2018, 4:15pm
1
Hi guys.
I am using Telegram a lot for my home assistant setup.
My first bot is working very well. My second bot also when I delete the first one. So everything is fine except when I try to run both together.
How can I do this?
Other Threads did not help me.
telegram_bot:
- platform: polling
api_key: 1111111111333:asdfasdfasdfasdfasdfasdfasdfsaf
#secondaccount api_key: 222222222333:asdfasdfasdfasdfasdfasdfasdfasf
allowed_chat_ids:
- 11111111111
- 2222222222
notify:
- name: homeassistantbotname
platform: telegram
chat_id: 11111111111
- name: homeassistantbotname2
platform: telegram
chat_id: 2222222222
telegram_bot:
- platform: polling
api_key: 1111111111333:asdfasdfasdfasdfasdfasdfasdfsaf
allowed_chat_ids:
- 11111111111
- platform: polling
api_key: 222222222333:asdfasdfasdfasdfasdfasdfasdfasf
allowed_chat_ids:
- 2222222222
maurizio53
(Maurizio Fabiani)
May 11, 2018, 6:29pm
3
How to set a second chat_id?
telegram_bot:
- platform: polling
api_key: 1111111111333:asdfasdfasdfasdfasdfasdfasdfsaf
allowed_chat_ids:
- 11111111111
- AAAAAAAAA
- platform: polling
api_key: 222222222333:asdfasdfasdfasdfasdfasdfasdfasf
allowed_chat_ids:
- BBBBBBBBB
- 2222222222
maurizio53
(Maurizio Fabiani)
May 11, 2018, 6:52pm
5
Yes ok, but i was meaning in terms of creating a new api_key…
Tbh there’s no reason two (or more) people can’t use one bot, but basically you would generate a different bot from the second user and generate that api_key.
1 Like
totolino
(totolino)
May 11, 2018, 7:04pm
7
With a new phone number. In my case it’s for my girlfriend.
Yeah, but there’s no reason your girlfriend can’t use the same bot. We only have one bot here, with 3 of us using it in 3 separate chats
totolino
(totolino)
May 11, 2018, 7:35pm
9
Okay. Would be fine for me.
Could you post your confit than. Cuz it does not work for me with only one api
telegram_bot:
platform: polling
api_key: !secret telegram_bot_api_key
parse_mode: html
allowed_chat_ids:
- !secret telegram_bot_chat_id_mf
- !secret telegram_bot_chat_id_ls
- !secret telegram_bot_chat_id_cg
notify:
- platform: telegram
name: mf
chat_id: !secret telegram_bot_chat_id_mf
- platform: telegram
name: ls
chat_id: !secret telegram_bot_chat_id_ls
- platform: telegram
name: cg
chat_id: !secret telegram_bot_chat_id_cg
totolino
(totolino)
May 12, 2018, 9:09am
11
This does not work for me.
When I use the api of chatid1 it won’t work with chatid2 getting this error:
Error sending message: Chat not found. Args: (560....chatid, 'Testmessage!'), kwargs: {'parse_mode': 'HTML', 'disable_notification': False, 'disable_web_page_preview': None, 'reply_to_message_id': None, 'reply_markup': None, 'timeout': None}
11:07 AM components/telegram_bot/__init__.py (ERROR)
When I change it back to the API of chatid2 it works only with chatid2
Api_keys are for the bots, the chat_id is for the user that is interactive with the bot.
So, basically, you need to start a chat between your girlfriend and your bot.