Telegram bot does not receive messages from the channel

Hi,
I’m running OH 2.5 on Raspberry Pi.
Using the latest version of Telegram binding.

My thing:
Thing telegram:telegramBot:smarthome_telegrambot [ chatIds="-xxxxx","yyyyy", botToken="myToken"]

My item:
String telegramMessage "Telegram Message" { channel = "telegram:telegramBot:smarthome_telegrambot:lastMessageText" }

When I send a message directly to the chat bot chatIds=“yyyyy”, it changes the state of my item.

But when I send the message to the channel chatIds="-xxxxx", the state of the item becomes Null.

I read the documentation https://www.openhab.org/addons/bindings/telegram/ I can not find a solution to this problem.

Bot added by admin to channel chatIds="-xxxxx".
In bot settings, parameter /setprivacy = DISABLED

What to do to receive the message from the channel chatIds="-xxxxx"?

Hi Vitaly,

have you found a solution for the problem you’ve mentioned? I’ve the same issue…

Best regards
Andreas

Hi, Andreas

After a little study of Telegram, I found out that there are two types of ID:

  1. 2222222 - id of the user who wrote the message
  2. -33333333 - group-chat id

I still can’t send messages to the chat 2.
Perhaps this is a Telegram binding limitation

But it is not all that bad. I can send messages to my bot in the chat.
This is enough for my tasks.

Here are my thing:

Thing telegram:telegramBot:smarthome_telegrambot   [ chatIds="x11111111","x22222222","x3333333", botToken="yyyyyyyyy:zzzzzzzzzzzzzzzzzzzzzzzzzzzz"]

“chatIds” - id of users who can send commands to the bot
“botToken” - your Telegram bot token

The bot logic was done according to the Telegram binding documentation.

To get the user id, did this:

  1. The user sent a command to the bot in the Telegram.
  2. Opened the Openhab log.
  3. Found a Telegram binding message. The user is not allowed to send commands to the bot.
  4. Copied the user ID from this message and pasted it into the thing

Best regards
Vitaliy

Hi Vitaly,

many thanks for your answer!
I feared that communicating via a channel is not possible due to some Telegram sited issues…
Ok, then I’ll do it as you’ve mentioned.
Hoped, that there is any hidden secret to communicate with the bot via a channel, that I’ve overlooked.

Best regards
Andreas

Hi, I opened a PR to address this issue.

sending messages to a channel via a bot works for me. Just add the getIDsBot to your channel and get the channel-ID from him. Your can remove the bot afterwards. The rest works just as described in the docs of the binding.

things.getActions(‘telegram’, ‘telegram:telegramBot:Telegram-Bot’).sendTelegram(-123456, ‘message’);
I have not tried to receive messages (no use case yet).