i cant get the /n newline to work in my label.
In my home assistnat automation i write to a json file: The servicecall fot add an entry with text wich includes /n newline. Whatever i do the LVGL label does not do anything with the /n. i try:
{{ 'Vandaag: ' ~ states('sensor.afvalwijzer_today') | capitalize
~ '\\nVolgende: ' ~ states('sensor.afvalwijzer_next_in_days') ~ ' ' ~
('dag' if states('sensor.afvalwijzer_next_in_days') == '1' else 'dagen')
~ '\\nType: ' ~ states('sensor.afvalwijzer_next_type') | capitalize }}
Results on screen in one line of text: exact output including quotes:
“Vandaag: Geen\nVolgende: 20 dagen\nType: Pmd”
"Vandaag: {{ states('sensor.afvalwijzer_today') | capitalize }}\nVolgende: {{ states('sensor.afvalwijzer_next_in_days') }} {{ 'dag' if states('sensor.afvalwijzer_next_in_days') == '1' else 'dagen' }}\nType: {{ states('sensor.afvalwijzer_next_type') | capitalize }}"
Gives the same result.
Testing with writing “thisone/nthistwo/nthisthree” Label shows me one line of text: thisone/nthistwo/nthisthree
In Esphome label wiki states the note: Newline escape sequences are handled automatically by the label widget. You can use \n to make a line break. For example: "line1\nline2\n\nline4" . For escape sequences like newline to be translated, enclose the string in double quotes .
What am i doing wrong here?
I am out of clues. Can anyone shed a light?
Thanks in advance
