Hi, I’m trying to accomplish a lovelace button that when pressed, tells the result of an assist (llm) query
If I call this service:
service: conversation.process
data:
text: dimmi le previsioni meteo per oggi e la temperatura attuale in balcone
agent_id: conversation.google_generative_ai_conversation
I get this result:
response:
speech:
plain:
speech: >-
Il meteo attuale a Roma è nuvoloso. La temperatura attuale in balcone è
29.6°C.
extra_data: null
card: {}
language: it
response_type: action_done
data:
targets: []
success: []
failed: []
conversation_id: 01J0TGBVKVH4MRZJZWVHNJFBD1
I want to pass the “speech” part as a variable and tts that variable on a device:
I did this script:
alias: Meteo OP5T
sequence:
- service: conversation.process
metadata: {}
data:
text: dimmi le previsioni meteo per oggi e la temperatura attuale in balcone
agent_id: conversation.google_generative_ai_conversation
response_variable: risposta
- service: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.oneplus_5t
message: "{{ risposta }}"
target:
entity_id: tts.piper
description: ""
icon: mdi:weather-lightning
Problem is that the message is the full response and not just the “speech” part. How to filter that? I tried {{ speech.risposta }} but did not work