val telegram = getActions("telegram","telegram:telegramBot:703145")
if(null === telegram)
{
logInfo("telegram", "Actions in knx-LICHT not found, check thing ID")
return
}
telegram.sendTelegramQuery(-123456789L, "Kessel ist an:\nSoll die Kessel Gruppe benachrichtigt werden?", "msg_Kessel", "Ja", "nein")
but the answer not be sent:
rule "Benachrichtigung Gruppe Kessel über Telegram"
when
Item telegramReplyId received update msg_Kessel
then
val telegram = getActions("telegram","telegram:telegramBot:703145")
var message = ""
if(null === telegram)
{
logInfo("telegram", "Actions in knx-LICHT not found, check thing ID")
return
}
if (telegramMessage.state.toString == "Ja")
{
sendCommand(msg_g_kessel,ON)
message = "Die Benachrichtigung über Telegram (Gruppe Kessel) wurde eingeschaltet.\nState= " + msg_g_kessel.state.toString
}
else
{
sendCommand(msg_g_kessel,OFF)
message = "Okay! Keine Benachrichtigung über Telegram.\nState= " + msg_g_kessel.state.toString
}
telegram.sendTelegramAnswer(telegramReplyId.state.toString, message)
postUpdate(telegramReplyId,"NULL")
end
It is executed but otherwise it was so that the choices disappear. But this is not done anymore.
Maybe someone can give me a hint. If it is a bug or if something has changed in the binding that I have not seen.
rule "Frage"
when
Item SteinelCAM_Motionevent changed to ON
then
val telegramAction = getActions("telegram","telegram:telegramBot:b56f3b7499")
telegramAction.sendTelegramQuery("Jemand war vor der Tür willst du das Video sehen?", "Reply_Telegram_Video", "Ja", "Nein")
end
rule "Antwort auf die Frage"
when
Item Telegram_Reply_Id received update Reply_Telegram_Video
then
val telegramAction = getActions("telegram","telegram:telegramBot:b56f3b7499")
if (Telegram_received_BOT.state.toString == "Ja")
{
telegramAction.sendTelegramAnswer(Telegram_Reply_Id.state.toString, "Video wird verschickt")
telegramAction.sendTelegramVideo("file:/var/lib/openhab/ipcamera/5590f48d61/hauseingang.mp4", "Video - Hauseingang")
}
else if (Telegram_received_BOT.state.toString == "Nein")
{
telegramAction.sendTelegramAnswer(Telegram_Reply_Id.state.toString, "Ok kein Video.")
}
else
{}
end
If i reply with “Ja” everythink is working only with “nein” but in both cases i get the Log.
I did a workaround yesterday. I linked the Telegrambot_Query_Callback_Received channel.
Then I get the chatid, messageid and callbackid and answer like it’s explained in the telegram binding.