Wait_for_trigger telegram_sent event

Hello,

I’d like to implement sending telegram messages with controlling of send result, because I’m using unstable cellular internet and not all messages are send (

Idea:

  • send_message with message_tag
  • wait_for_trigger telegram_sent
  • if event triggered, check remaining if not zero - ok, else - repeat

But, I unable to get event
I send message like this

      - service: telegram_bot.send_message
        data:
          message: "test"
          target: xxxxxx
          timeout: 15
          message_tag: "{{ sometag }}"

sometag is variable “{{ range(0,65535)|random }}” to make it uniq
message is send and I can subscribe to event at HA developers panel and get smth like this

event_type: telegram_sent
data:
  chat_id: xxxxxx
  message_id: 16557
  message_tag: 6223
origin: LOCAL
time_fired: "2024-09-10T08:58:26.378308+00:00"
context:
  id: 01J7DJFMNFT9BBGPAPS17C0B6S
  parent_id: null
  user_id: 6c7e218424ee4759a156f3fce43fdd8f

message_tag is present and equal to our random value - as expected
BUT, if I use this in automation

              - wait_for_trigger:
                - platform: event
                  event_type: telegram_sent
                  event_data:
                    message_tag: "{{ sometag }}"

event is not triggered!
if I remove

                  event_data:
                    message_tag: "{{ sometag }}"

it is triggered, but problem that it can be triggered for another message, not I’m sending right now…

How to solve this problem?

thnx.