myle
(StePhan McKillen (Other kiwi Here))
1
Im wing this Jiniga stuff
Im Passing some stuff to a script
where: ,office,lounge
in template i see it works
and
happy camper
but when I look at it flow i see
what page of the manual did I miss reading
and other little problem ill like to fix is drop the , at the front of the string.
just want to pass
where: lounge
or
where: lounge,office
not the
where: ,lounge,office
here is my Jinga thing
{% if ',' in where %}
{{ where | replace(",", "\n- notify.alexa_media_") }}
{%else%}
- notify.alexa_media_{{where}}
{% endif %}
tom_l
2
Jinja. Not Jinga.
|-
is yaml not jinja. Try out the demo here: https://yaml-multiline.info/
myle
(StePhan McKillen (Other kiwi Here))
3
thanks bro look like more reading
myle
(StePhan McKillen (Other kiwi Here))
4
can’t work it out
yelling at the screen not working
but work out how to drop the leading ,
{%- if ',' in where %}
- notify.alexa_media_{{ where | replace(",", "\n- notify.alexa_media_") }}
{%-else%}
- notify.alexa_media_{{where}}
{% endif %}
tom_l
5
Pass this instead:
where:
- 'lounge'
- 'office'
Or
where:
- 'lounge'
Then use this:
entity_id: >
{% if where|count == 2 %}
- notify.alexa_media_{{where[0]}}
- notify.alexa_media_{{where[1]}}
{% else %}
- notify.alexa_media_{{where[0]}}
{% endif %}
1 Like