I would like to add some random text. So let’s say like something like below
{{ [ “Hi”, “Hello”, “how are you” ] | random }}
But what if i want to randomize only the start of sentence. What is the correct syntax? I know below might not work
{{ “[ “Hi”, “Hello”, “how are you” ] | random” “here goes the static state?” }}
I havn’t tested this but im pretty sure you could just do
{{ [ “Hi”, “Hello”, “how are you” ] | random }} here goes the static state
cogneato
(Cogneato)
February 23, 2017, 6:57pm
3
Did you figure this out? Was looking for the same info.
What if the static state is also a template? Something like {{ states.sensor.pws_weather.state }} - shall it go like
{{ [ “Hi”, “Hello”, “how are you” ] | random }} {{ states.sensor.pws_weather.state }}
Or somehow different?
That should work. If its all on one line then put a single quote on both ends of the entire line. (single because you’re already using double in the template)