(telegram) alert: delete repetitive notification before sending another?

Hi everybody,

I have an alert (code below) that will notify a particular telegram group if some window is still open after a set time. It repeats every 30 minutes, so if we don’t close the window that evening, the notification will be there multiple times in the morning.

Is it possible to delete this message somehow before sending another? So that we will still be alerted (because there is a new notification), but not flooded (because the previous notification will be deleted before the new one is sent)?

I don’t need to use alert, if it helps. I might as well use a regular automation with service: notify.tg_gruppe_smarthome and wait_template, if that would make things easier.

Basically, whenever sending particular notifications (especially reminders), we get quite a bunch because sometimes we don’t act upon them. While this is fine in theory (being flooded is a good way to force us acting upon these reminders :wink: ), other things (=different notifications) might get lost, when they are being sent at the same time as these “reminder floods”.

So it’d be nice to identify particular (repetitive!!) messages at the moment Home Assistant sends them out, so when the same reminder has to be sent at a later time, the previous one could be deleted from telegram (either direct, or group; we use both), thus uncluttering the message window.

Thank you in advance for your ideas :slight_smile:

alert:
  az_fenster_abends:
    name: "Arbeitszimmer Fenster noch geöffnet."
    # done_message: "Vielen Dank"
    entity_id: input_boolean.helper_az_fenster_abends
    state: "on"
    repeat: 30
    can_acknowledge: true
    notifiers:
      - tg_gruppe_smarthome