I want to create a list in a markdown card with line breaks between each value from a template sensor but can’t figure out how to do that. Currently the output is in a string with each value broken up by a comma (which I also don’t want).
Can someone please advise what I need to add to get the line breaks as well as removing the comma?
Thanks Tom. That’s providing a list for me which has resolved that bit but in my markdown card it is showing encased in square brackets and quotes. Is there a way off cleaning it up so as not to show those?
*EDIT - I’ve figured out how to remove the square brackets, by adding |replace("["," ")|replace("]"," ") but when I try the same with the single quote marks it won’t accept it.
If that markdown card is the only place you use that template sensor, just replace the |list at the end of the expression with |join("<br>") — then you can use the sensor state directly in the card without all of the |replaces.
Hello!
I found this forum when I was looking for an answer to a similar problem.
I need to display a list of lit lamps in a card (markdown).
With your “indent” tip, I was able to place a marker on the first lamp in the list. I would like to place this marker on all of them. Is there a way to do this by changing this instruction?