AI generated text not displaying on MAX7219 matrix display

I am trying to display the generated text from an ai_task on my MAX7219 matrix display, but the variable comes across as literal. What am I doing wrong?

alias: Funny Joke
description: ""
triggers:
  - trigger: event
    event_type: ""
conditions: []
actions:
  - action: ai_task.generate_data
    metadata: {}
    data:
      task_name: Joke
      instructions: Tell me a funny joke.
      entity_id: ai_task.google_ai_task
    response_variable: generated_text
  - device_id: 1fc2ddb9e05a1aa818dbfe15c38f21be
    domain: text
    entity_id: text.matrix_display_message
    type: set_value
    value: "{{generated_text.data}}"
mode: single

You are using a device action.
They don’t support templates.

Thanks. How do I accomplish what I am trying to do? I am a noob. :grinning:

I don’t know. You need to find the normal action.
Perhaps set_text? Or something like it

Would it help if I showed you the YAML for my Matrix Display?

Try text.set_value

Excuse my ignorance, but where should I use the text.set_value? in my automation? What line?

Click on add action, press the search field, type “text_set”.

That WORKED!!! Thank you! Now, how do I format the generated text to a space at he beginning of the text and replace the Carriage Return with maybe a “-” or something?



"{{'     ' ~ generated_text.data | replace('\n', ' - ' }}"

Throwing this error…
image

It’s missing a closing parantes.
My bad sorry…

AHA! No worries and thank you! :slight_smile: