You’ll have to convert it and there’s no easy way in jinja. Using this template, you can get what you want:
{%- set line = states('sensor.line_state').replace('0x','') %}
{%- set chars = "abcdefghijklmnopqrstuvwxyz" %}
{%- set n = 2 %}
{%- set ns = namespace(value='') %}
{%- for i in range(0, line | length, n) %}
{%- set c = chars[line[i:i+n] | int('', 16) - 65] %}
{%- if c is defined %}
{%- set ns.value = ns.value ~ c | upper %}
{%- endif %}
{%- endfor %}
{%- if ns.value == 'SHOWTIME' %}
...
@petro Thanks - that’s great how can i use this (with a nextion display) with multines. I imagin, i set a varialbe (like text_line01 , text_line02 and text_line03) in the nextion userinterface. But how will it automatic split a source varible to this trhree variable (after 20 letter).
Sorry, i’m not a pro
Thanks a lot
For anyone that needs more than just uppercase letters, please adjust the chars and the offset (65 in petro’s example changes to 32)
{%- set line = value_json.Artist.replace('0x','') %}
{%- set chars = " !'#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" %}
{%- set n = 2 %}
{%- set ns = namespace(value='') %}
{%- for i in range(0, line | length, n) %}
{%- set c = chars[line[i:i+n] | int('', 16) - 32 ] %}
{%- if c is defined %}
{%- set ns.value = ns.value ~ c %}
{%- endif %}
{%- endfor %}
{{ ns.value }}