#Reference script alias in notification

1 messages · Page 1 of 1 (latest)

prisma quartz
#

I am creating a script which will eventually have several branches. I would like to reference the alias of the script in my notification title. The script as shown results in a null value where the alias should be. Any clue about what I am doing wrong?

sequence:
  - action: notify.persistent_notification
    metadata: {}
    data:
      message: Message body
      title: title = '{{ alias }}'
alias: demo_script
description: ""
green yoke
#

Don´t think the alias is accessible as variable at all... Not an option to define your own variable? for it?

And for next post:

spice pythonBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

prisma quartz
# green yoke Don´t think the alias is accessible as variable at all... Not an option to defin...

I could define a variable. It just seems kinda convoluted to define a variable to define an alias just so I can reference the value of the alias; which is itself a human-friendly variable representing the entity id of the script. Somewhere the UI must reference the value of the alias to present the human-friendly title of the script. The syntax for doing so may not be human-friendly nor available to us mere mortals.

keen hemlock
#

If you’re referencing it from within the script you can just use the this variable, so title: title = {{ this.attributes.friendly_name }}

green yoke
#

Alias is just ment as a description of the element in the UI. No other funtion.

And it might be cool to have an variable that would just have all keys of the step. But it would be niche and because it would be easy to have circle references it's hard to implement. Because HA elements in yaml don't have order other then the key.