@Juggler wrote:
I’m trying to write an action with an event template. Without the template, the event looks like:
- event: homeassistantCube event_data: notifications: [{title: 'Goodnight security', severity: 'warning', options: {detail: 'All is well... sleep tight', dismissable: 'true'}}]
I would like to add the following into the above as a random integer:
{{ range(1,99999) | random }}}
, so the event would look something like:- event: homeassistantCube event_data_template: notifications: [{title: 'Goodnight security', severity: 'warning', options: {detail: 'All is well... sleep tight', dismissable: 'true', serverId: {{ range(1,99999) | random }} }}]
I know the above is incorrect, but I cannot figure how to escape it properly. Can any Jinja ninjas help me out?
J.
Posts: 2
Participants: 2