I have a Telegram “send message” and after another trigger a “delete message” of the stored message_id of this related sent message running in NodeRed.
Now I wanted to migrate this to HA. Send message part is working.
Not with a delete delay of a first message!
A) Is there a complete example available to send a message AND store the used message_ ID after a first trigger.
B)
Then in another automation of another trigger how to retrieve the stored message_ ID and use it for the delete message command of Telegram Bot?
I could not solve it with the current Telegram Bot documentation.
After playing around with HA I found my current solution.
Using NodeRed and Homematic so far I was not so familar with the HA limitations of variables and response value handling/usage.
perhaps it helps others:
I used the HA add-on "Saver" for variables valid outside the Action and after HA restart.
A)
sending the message an getting the response in the variable "response"
action: telegram_bot.send_message
data:
message: a test message
entity_id:
- notify.homeassistant_ID1
response_variable: response
saving response sequence to Saver-variable: TelegramID