Just trying to let my Sonos tell me every evening a bedtime story which chatgpt is creating. Due to that this takes about 10-20sec to process I want to store the response into a text input helper (I already increased the maximum characters to store to 2000)
But unfortunately there is nothing stored into the text, I also get no warnings or errors. To confirm that it is generally working I added a notify to my Phone, which is working fine.
Any ideas what I’m doing wrong?
Automation:
alias: ChatGPT Test
description: ""
trigger: []
condition: []
action:
- service: conversation.process
data:
agent_id: bb818bce4388ebe27a8d54531d1e4d7d
text: >-
Tell me a random bedtime story
response_variable: chatgpt
- service: notify.mobile_app_s23ultra
data:
message: "Assist Reply: {{ chatgpt.response.speech.plain.speech }}"
enabled: true
- service: input_text.set_value
target:
entity_id: input_text.test
data:
value: "{{ chatgpt.response.speech.plain.speech | string }}"
mode: single
An entity’s attributes can store up to 16Kb. I suggest you create a Trigger-based Template Sensor and store the response variable’s value in a custom attribute.
Hello! First time poster and sorry for reviving a sort of old post but I’ve been wanting to do something similar. Would you mind giving me some kind of pointer as to what you did to fix this @heschdy? Not fully grasping @123s comment
I know this is old but came across it and it could help someone in the future if you’ve moved past it. I think the idea is to create a sensor which is updated by an event (I’ve called my event set_ai_response):