Every now and then I have a problem with “AI TASK Gemini Generate data”…
I have an automation that when the washing machine finishes sends messages to the phones and a message is generated that is played on a speaker.
it generates a message that is read by TTS.
Except that the text read doesn’t just contain the message it’s trained to read.
It also reads a series of messages like: “service underscore, underscore, underscore, device hash, notify with your mobile device… underscore etc etc” then reads the correct message and ends with “mode single”.
It almost seems like it’s reading parts of the automation.
But this doesn’t always happen… rarely, but it does happen.
action: ai_task.generate_data
metadata: {}
data:
instructions: >-
Let me know the cleaner has finished washing and the laundry can be hung out to dry.
Reply in a cynical and humorous way and don't use markdown (**).
Avoid asterisks and emoticons. Use a maximum of two lines of text.
task_name: Lavatrice ha finito
entity_id: ai_task.google_ai_task
response_variable: response
The automation includes, in addition to the generated message, the sending of notifications to smartphones.
As mentioned, the automation works flawlessly most of the time, but every now and then… it also reads something else. Specifically this is what he reads:
“service notify dot mobile underscore underscore underscore device hash replace with the notification service for your mobile device or other. Data title: “(title of the data)” Message: (Here you can read the title of the message) Mode: Single.”
It’s very difficult to run tests and analyze data because this rarely happens… (and as often happens, I’m not at home) but from what I think I remember, it only happens with GEMINI; not with OpenAI. (Or maybe I don’t remember trying to change).
I was facing a similar problem. The solution was to specify a response variable and then use [variable name].data as the text to be sent to tts. For the instructions, I added the sentence “The response should include only the text of the message and nothing else.”
This is an example of what worked:
action: ai_task.generate_data
metadata: {}
data:
task_name: say fact
instructions: >-
Generate the text for a message that wishes Allen a good morning in a
unique and clever way. The response should include only the text of the
message and nothing else.
entity_id: ai_task.claude_ai_task
response_variable: ai_text
Every time there's a problem: tokens run out (even though they're paid for), misunderstood actions, actions not completed,the system is too busy, actions or messages that don't execute etc.
But the main problem is that sometimes they work perfectly, then they stop working, then magically they start working again.
Then you have to modify the output because they've complicated things, etc. etc.
I think HOMEASSISTANT should be something that simplifies.