Telegram Bot - Incoming message is not allowed while receiving commands

My configuration uses the Telegram Bot polling mechanism and it works fine with the notify service
I’m not trying to integrate the Telegram Bot into an alarm automation scenario and keep getting these errors while issuing commands to the bot :

2018-09-28 14:18:32 ERROR (MainThread) [homeassistant.components.telegram_bot] Incoming message is not allowed ({‘message_id’: 49, ‘from’: {‘id’: MY_ID, ‘is_bot’: False, ‘first_name’: ‘Ohad’, ‘last_name’: ‘Benita’, ‘username’: ‘MY_USER’}, ‘chat’: {‘id’: MY_CHAT_ID, ‘title’: ‘MY_TITLE’, ‘type’: ‘group’, ‘all_members_are_administrators’: True}, ‘date’: 1538133512, ‘text’: ‘/commands’, ‘entities’: [{‘offset’: 0, ‘length’: 9, ‘type’: ‘bot_command’}]})

Any ideas what should be done would be appreciated

I have the same problem also.
I am using platform: polling and have my API and I have 3 chat_ids.

I make sure that the chat_id that sends the response from the button is allowed in the chat_id but no… :confused:

Me too, just started with telegram and I get this

I am also getting this same message when trying to setup a ping responder.

- id: 'testmessage'
  alias: "Telegram Test"
  hide_entity: true
  trigger:
    platform: event
    event_type: telegram_command
    event_data:
      command: '/ping'
  action:
    - service: notify.telegram
      data:
        message: 'pong'

Are there any clues to what the problem is? Thanks!

OK, at least I can answer my own question regarding responding to telegram_command events. I had just a group chat_id (negative number) in my telegram_bot configuration, that wasn’t working to receive command, but when I added my user id as a chat_id, that allowed the above testmessage automation to work, it would seem the commands are validated by user, not group chat. Example:

telegram_bot:
  - platform: polling
    api_key: "ABC:XYZ"
    allowed_chat_ids:
      - -XXXXX # group chat id with my bot - not good enough for /commands
      - YYYYYY # my user id - required for accepting /commands reasonable, but directions unclear
3 Likes

Hi @ohadbenita
use ' works for me.

example:

telegram_bot:
  - platform: polling
    api_key: "ABC:XYZ"
    allowed_chat_ids:
      - -XXXXXX # telegram group
      - YYYYYY #  telegram userchatid

notify:
  - name: telegrambot
    platform: telegram
    chat_id: '-XXXXXX' # telegram group using quotes

:beers:

Hello, I think your problem, that you need write to command to the bot, not a group. You need to config yaml the telegram gorup and bot ID. And If you write to your bot you can receive the messege to group.