Could you explain a Log Error with Telegram Messenger please

Hi,
could someone explain to me, why this rule works, although I get the error below?
The bot sends the message.

Here is the DSL rule:

val telegramAction = getActions("telegram","telegram:telegramBot:<mybotid1234567890>")
telegramAction.sendTelegram(Telegram_message_out.state.toString)

And here is the Error Log

==> /var/log/openhab/openhab.log <==
2021-12-17 08:32:41.464 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'd06233b996' failed: java.lang.NumberFormatException: Expected an int but was <mybotid1234567890> at line 1 column 62 path $.result.from.id

I checked that int means a number and my botid is a 10 digit number.

Just for understanding purposes, since the message goes out anyway.

Best regards,

Max

Did you try it without the <>?
My Telegram line looks like this (though ECMA script, not rule DSL):

…“telegram”,“telegram:telegramBot:telegram”);

The error message shows that it should be an integer.

yes yes. by <mybotid…> i ment as a placeholder.

it is

val telegramAction = getActions("telegram","telegram:telegramBot:1234567890")

same issue here.

See here as you need to upgrade.

clearing the cache and tmp directory in userdata did not resolve the issue

What version of opemHAB? You need to upgrade.

I am using the docker :latest tag.

Daniel

I am using openHAB 3.1.1 on a RaspPi with a selfinstall (no Openhabian). And my BotNo starts with a 5…

And my Java Setup ist the following:

openjdk version "11.0.13" 2021-10-19 LTS
OpenJDK Runtime Environment Zulu11.52+13-CA (build 11.0.13+8-LTS)
OpenJDK Client VM Zulu11.52+13-CA (build 11.0.13+8-LTS, mixed mode)

By we need to upgrade you mean to Openhab 3.2 or you mean any kind of Java upgrade?

Best Regards,
IvIax

You need to upgrade as there was a bug in the telegram library that the binding uses. I changed the version of the library for other reasons many months ago so the fix will be in at least half of the 3,2 milestone builds and the RC1 release candidate for 3,2 stable.

Roger that.
Never the less, as stated above - i have only an error in the log. The message arrives despite the error, what was pretty strange to me.

Can people that upgrade report back that upgrading fixes the issue please?

mm. I would if I could, however all 3.2 versions throw a lot of errors.

Hello - I am still running OH2.5. I have a complicated KNX setup and it’s just not worth the time to migrate to OH3 as everything runs flawlessly. Until today… I’ve just added a new Telegram user and am now facing the NumberFormatException problem (Telegram chatIDs are now 10 digits instead of 9).

Two questions I’d be grateful for help with:

  1. Is there any way of upgrading to the latest java-telegram-bot-api without upgrading to V3 of Openhab?
  2. If the answer to 1 is no, how can I delete the chatID that now prevents the Telegram Addon from starting? I’ve deleted the offending chatID from the Thing but OpenHAB has saved it somewhere that I can’t find. The error message thrown is (even after deleting the thing) is:
telegram:telegramBot:xxx_bot' changed from OFFLINE (COMMUNICATION_ERROR): java.io.IOException: com.google.gson.JsonSyntaxException: java.
lang.NumberFormatException: Expected an int but was 5XXXXXXXXX at line 2 column 55 path $.result[0].message.from.id to UNINITIALIZED

Thanks!

The answer to 1 is no. Normally you can but too much has changed, you need 3.2 stable or newer. I have no idea on question 2.

Sigh. Thanks, Matt.