Red flag in working Script

I am on 2026.4.1 and just noticed something in a script that may have been introduced in an earlier update. It seems to be a UI thing and the script runs fine as it always has.

I noticed this red flag:-


which relates to the following YAML:-

  - action: media_player.volume_set
    data:
      entity_id: "{{ mplayer }}"
      volume_level: 0

mplayer is a variable I calculate, it works perfectly and as far as I recall, caused no red flags when I first created the script some months ago as this:-


so no errors showing there and as I said, it works fine. As does this later action:-

   - action: media_player.play_media
    target:
      entity_id: "{{ mplayer }}"
    data:
      media:
        media_content_id: "{{ station }}"
        media_content_type: radio

which produces no red flags:-
Screenshot 2026-04-05 at 09.53.24
It just looks to me like the UI is slightly out of step with the ability to template the entity_id here, which works but the UI doesn’t seem to know this and I’m pretty sure there was no red flag when setting up this script, so something seems a bit mixed up.

This example is a combination of old and new syntax.

  - action: media_player.volume_set
    data:
      entity_id: "{{ mplayer }}"
      volume_level: 0

This is fully old syntax:

  - service: media_player.volume_set
    data:
      entity_id: "{{ mplayer }}"
      volume_level: 0

This is fully new syntax:

  - action: media_player.volume_set
    target:
       entity_id: "{{ mplayer }}"
    data:
      volume_level: 0

The old syntax (and combinations of old and new) continue to be supported but the UI is designed to direct you to use the new syntax (i.e. “No target set”).

As for “new” syntax, it’s been the standard for several years now. Anyone creating a new script/automation, or modifying an old one, should adopt the “new” syntax.

1 Like

Brilliant. Thanks @123 . That explains it.

Found a couple of those and corrected them, so I’ll watch out for that in the future.