awesome idea and setup. Everything’s working like a charm except one thing: removing the inline-keyboard doesn’t work. By clicking on a reminder- or the remove-the-keyboard-button I’d expect the keyboard to go away. But everything I get is the notification “Ok, I’ll notify you in 30 minutes”. The keyboard is still there.
Did I do something wrong? Here is my automation.yaml:
Solved it by myself: I had to definite exact chat_id:
- service: telegram_bot.edit_replymarkup
data_template:
message_id: '{{ trigger.event.data.message.message_id }}'
chat_id: HERE GOES THE CHATID WITHOUT QUOTATION MARKS
inline_keyboard: []
Note that the telegramremoveinline function in my automations is only used when you press the 'No reminder:/removekeyboard' button. The same actions have to be replicated onto the automations that handle all the timed buttons as well:
See that the function handling the '/1h' command also sends inline_keyboard: [] to destroy the keyboard.
That all seems to work at my end. Can you confirm your timed button handlers: telegramrepeat30m, telegramrepeat1h, etc… all contain the action to remove the keyboard?
EDIT: I just saw your second post. I’ll leave the above in case it clears anything up for other people.
However, I’m not sure why you need to place the chatid there, it seems to work on my end. Is it a different kind of chat? Group chat?
I want to know if a can send a URL to mapas with a data template that contains the latitude and longitude off one of my device tracker, does telegram have option?
I only use HA Telegram broadcast. For Telegram interaction I use Node-Red (link), Your polling config looks good to me, as far as I can tell.
I do not have experience setting up interaction with HA, but I read the component docs, linked in my previous answer.
So, if you use polling and a Telegram answer message starts with
/
then you probably need an event triggering to, ehh, trigger an event…
Also, as far as the none Home Assistant part, you don’t need extra config to communicate with Telegram, no need for port forwarding, dynamic DNS config, etcetera… If sending a message works, then sending back commands should be working also.
I don’t know if sending a message without / will work, I don’t think so, but I’m not sure about that…
Its still not working. I am using the exact code like in the initial post from @Kallb123. I double checked my code and so far, I didn’t make a mistake.
I assume that there is something which blocks the message from telegram because of the error “Incoming message is not allowed”. So, telegram sends the message back to my HA and then it got lost…
“To get your chat_id and api_key follow the instructions here. As well as authorizing the chat, if you have added your bot to a group you will also need to authorize any user that will be interacting with the webhook. When an unauthorized user tries to interact with the webhook Home Assistant will raise an error (“Incoming message is not allowed”), you can easily obtain the users id by looking in the “from” section of this error message.”
@taddeuz Did you send your bot a message first? Cause you have to get in contact with him the first time. Bots are not allowed to send message to users at first.