Hello community
I’m currently migrating from OH2.5 to OH3. But I’m facing a problem to which I couldn’t find a solution for.
In OH2.5 I had “Telegram action” setup to send messages. I had two chats, one filled with logs and one more family-friendly, with just important messages.
I created in OH3:
> /etc/openhab/things/telegram.things
Thing telegram:telegramBot:telegram_bot [ chatIds="123456789","987654321", botToken="<token>", parseMode="Markdown" ]
and
> /etc/openhab/rules/telegram_test.rules
rule "Test Telegram"
when
Time cron "0 * * * * ?"
then
// Telegram as action OH_v2.5
sendTelegram("bot1", "Family messages")
sendTelegram("bot2", "Logging messages.")
// Telegram as action OH_v3.0
val telegramAction = getActions("telegram","telegram:telegramBot:telegram_bot")
telegramAction.sendTelegram("Messages to all")
telegramAction.sendTelegram(123456789L, "Family messages")
telegramAction.sendTelegram(987654321L, "Logging messages")
But this only brings up this error on the openhab.log
[ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘telegram_test-1’ failed: An error occurred during the script execution: Could not invoke method: org.openhab.binding.telegram.internal.action.TelegramActions.sendTelegram(org.openhab.core.thing.binding.ThingActions,java.lang.String,java.lang.Object[]) on instance: null in telegram_test
Messages to all are working, but not the ones for specific groups.
I can’t create two “Things” for Telegram with each ID seperatly, for this I get the following error so I think that’s not allowed:
[WARN ] [ng.telegram.internal.TelegramHandler] - Telegram exception: GetUpdates failed with error_code 409 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
Can anybody advise, how to set this up properly and it works the same as before as action?
Many thanks in advance.