#Event trigger from speech to text
1 messages · Page 1 of 1 (latest)
By default there's no such event. You have to take control and write that yourself.
I included this to Koala/Respeaker satellite by default, alongside with on-device alarm clock. You may copy the code from there.
Thanks, that's what I started with few years ago on my AI santa but thought I could pickup it as event from a non custom voice PE.
Nope.
Came here with a similar question and see that the topic is being actively discussed. Here is my idea of the logic of the work (no control mode for the agent).
Could you specify which event allows to receive input value when using RespeakerLite?
It's event esphome.tts_uri
Looking for a way to include "response_format": "json_object" in the system prompt since it's not supported by HA engine yet.
I've looked at the sensor and it's not suitable for my task. Is there any way to create a text sensor that will store the value from this step?
[19:43:59][D][voice_assistant:670]: Speech recognised as: "Yes"
Oh sorry, the topic is about STT, not TTS...
I should read better... 🙂
Here: https://esphome.io/components/voice_assistant.html it says:
on_stt_end (Optional, Automation): An automation to perform when the voice assistant has finished speech-to-text. The resulting text is available to automations as the variable x.
So just use on_stt_end and send the event from there.
I will include it into next Koala/Respeaker too.
Will be something like this:
on_stt_end:
- homeassistant.event:
event: esphome.stt_text
data:
text: !lambda return x;
Yup, it works, and sends event that you can use in automations:
event_type: esphome.stt_text
data:
device_id: b82c7a26a1d7dd97ae66bec7802609dc
text: What's the weather?
Basically use device_id to get area or satellite name, and there's the text.
That's awesome, thank you very much. I should read the documentation more often😓
So far I've tested it on my esp32 (with custom continued conversation code) - works perfectly. Now we can access conditioinal after voice responses. For many simple tasks this will be a more preferred option than LLM with function calls.