Telegram not working

in configuration.yaml, i have:

  - platform: polling
    api_key: 63841xxx1:AAGWXNfs1xXzhhd77gAnIqxxxxxxxxxxxxxx
    allowed_chat_ids:
    - 546xxx152

notify:
  - name: telegram2
    platform: telegram
    chat_id: 546xxx152

when i try it out in dev-service:

i get this error: ERROR (SyncWorker_9) [homeassistant.components.telegram_bot] Error sending message: Chat not found. Args: (546xxx152, ‘test15’), kwargs: {‘parse_mode’: ‘Markdown’, ‘disable_notification’: False, ‘disable_web_page_preview’: None, ‘reply_to_message_id’: None, ‘reply_markup’: None, ‘timeout’: None}

any idea of what went wrong?

If your chat gets upgraded to super chat the chat id changes. Check the chat id again.

i have not upgrade. i followed this guy’s tutorial https://www.youtube.com/watch?v=lWPy2EYxfJ8

in the comments, he says i have to initiate the chat with the bot but i have no idea if i did it correctly or not. i went here https://web.telegram.org/#/im?p=@myidbot
and started typing away but still nothing sent from HA

I have the same problem, ideas?

i played around with the bots ids. finally got it to work so here’s an example of my configuration.yaml

telegram_bot:
  - platform: polling
    api_key: 692400A:AAE26GA2yx4_wARUNRsPBygZ7OUPxxxxx
    allowed_chat_ids:
      - 692400A
      - 546415B

notify:
 - platform: telegram
   name: telegram
   chat_id: 546415B

Tnx, you r the best
Now works :+1:t2::+1:t2::+1:t2:

I configured it the same way but I still get the error.

“Error sending message: Chat not found. Args: (994600999, ‘TEST MESSAGE\nThis is a test!’), kwargs: {‘parse_mode’: ‘Markdown’, ‘disable_notification’: False, ‘disable_web_page_preview’: None, ‘reply_to_message_id’: None, ‘reply_markup’: None, ‘timeout’: None}”

Connection lost. Reconnecting…

in configuration.yaml:

telegram_bot:
  - platform: polling
    api_key: 977862175:AAHsyg_iLJh9O0ueskRX0x2126D7eNecbaA
    allowed_chat_ids:
      - 994600999


notify:
 - platform: telegram
   name: telegram
   chat_id: 994600999

in sricp:

test_telegram:
  alias: 'test_telegram'
  sequence:
    - service: notify.telegram
      data:
        title: TEST MESSAGE
        message: 'This is a test!'

can you help me

look at my example above. you are missing numbers.
so your configuration.yaml should be:

telegram_bot:
  - platform: polling
    api_key: 977862175:AAHsyg_iLJh9O0ueskRX0x2126D7eNecbaA
    allowed_chat_ids:
      - 977862175
      - 994600999

Thanks!
I configured it the same your way but I still get the same error.
have you ideal

Have also struggled with the telegram setting, my problem was the initiation of the bot. In the telegram app, on the left column where you have all your chats you have to search for your bot by the name you gave it, click the bot and type a message. Initsiation complete, everything started to work.

5 Likes

Thanks for the simple but useful tip ! It unlocked my problem.

I will share my experience - maybe it will help someone.

When sending messages to a group chat, the same error appeared: “Chat not found”.

At the same time - when sending a message to a personal chat - there were no problems.

The problem turned out to be that the “-” sign at the beginning of the group ID was missing in configuration.yaml (in two places.). Working config looks like this:

telegram_bot:
  - platform: polling
    api_key: 123456789:abcdefghijklmnopqrstuvwxyzabcdefghijklmnopq
    allowed_chat_ids:
      - -100123456789

notify:
  - name: telegram_group_for_masage
    platform: telegram
    chat_id: -100123456789
1 Like

I had the same problem… Disabled IPv6 and worked smoothly