Proprietary news feed via command_line

Hi, I am processing an RSS URL, send it through ChatGPT and the output is a few lines. The shell script is working fine, I’m getting a proper output on the HA command line. However, if I try to display it on the dashboard, the script gets stuck.

Shell script output on the terminal while being logged in via ssh:

01.09.2023 21:04:35

Zugang aus Bayern: SV Elversberg verpflichtet den 17-jährigen Paul Wanner von FC Bayern München.
Kampf dem Fachkräftemangel: Luxemburg erleichtert Zuwanderung, um Fachkräftemangel entgegenzuwirken.
Flüchtiger Häftling gefasst: Die Polizei hat einen entflohenen Häftling aus JVA Ottweiler … (truncated a few lines) …
Schülerzahlen steigen: Im Saarland steigt die Schülerzahl aufgrund von Zuwanderung.
Patient geflohen: Ein Psychiatriepatient aus Frankenthal wird von der Polizei gesucht.
Antikriegstag in Völklingen: Der DGB Saar begeht den Anti-Kriegstag in Völklingen.

Actual output on the dashboard:

01.09.2023 21:04:35
e[0K

The dashboard card is a plain markdown card with this expression:

{{ states('sensor.radio_salue') }}

The definition of the sensor:

command_line:
  - sensor:
      command: "/config/kurznews.sh"
      name: Radio Salue
      command_timeout: 60
      scan_interval: 180

If I redirect the kurznews.sh script into a text file, I see this:

01.09.2023 21:04:35
             ^[[0K^M
Zugang aus Bayern: SV Elversberg verpflichtet den 17-j..hrigen Paul Wanner von FC Bayern M..nchen.

Is there something I’m doing wrong? How can I make sure, that German Umlauts are being preserved? How can I prevent these special chars being “produced” and the text being truncated? Even if the fix is something like “kurznews.sh | rinse_that_output”, I’ll be fine with it :slight_smile:
Thanks in advance!

I’ve solved it by including the output of the script like described in this post.
Moreover, I’ve used that file to speak those news via TTS, as described in this article.