Notify Group with timestamp on selective channels

I have a group notify script that includes alexa devices, mobile and html5 push notification. This script is generic, being called by multiple automations with different messages.
For mobile and html push notification, I would like to prefix the message with a timestamp. This is because if a notification was triggered in the middle of the night and you only check your mobile/pc in the morning, you will see the notifcation but not knowing exactly time it was sent.
For alexa devices, there is no need as she will just tts in real time.

Here is one of my script. How do I change to accommodate

  - name: "Admin" 
    unique_id: admin
    platform: group
    - service: alexa_media
          type: tts
    - service: mobile_app_my_phone
        title: Lara
    - service: webpush_webpush_my_thinkpad
          icon: /local/image/lara_icon.png
        title: Lara

if i understand what you’re asking, i think you have to do this in the calling of the notify group. the group notify is not so much a script as a configuration that groups multiple notify targets together as a single one. i don’t believe it provides a way to manipulate the actual content of the notification as it goes out… however perhaps someone will surprise me and tell me i’m wrong… :slight_smile:

You are right. So basically, in the example above, the message for alexa_media will be just straight passthrough from automation that calls it. Where as mobile_app and webpush notifcations will be something like message = [timestamp] + [original message].

Is this possible?

you mean something like this?

        message: |
            {{ now().strftime('%H:%M') }}

needs to be done in the calling of the notify

Thanks but that didn’t work. It only display original message coming from automation, no timestamp

sorry, I meant to pull the message only. this needs to be added to the calling on the notify. As we said above, the group notify doesn’t carry or modify the message payload

ahhh… i see. I need another solution then because i dont want the alexa tts to include timestamp.

create a notification wrapper script that calls all the targets, but adds the time to just the ones you want.