Skip to content

ESPHome commands to start and stop HA Voice PE device? #477

@fquirin

Description

@fquirin

Hello HA team,

first of all let me say that this piece of hardware is really interesting and fun to play with, thx for creating it!

I've been trying to build a little stand-alone client for it using the ESPHome Native API and the aioesphomeapi module.
So far it works pretty well, I can connect to the device, read the states, read the log and even capture the audio stream after triggering it via the wake-word or the center button. What I don't understand is how you send any commands to the device to trigger for example recording START/STOP.

Here is what I've tried so far ('api' is my connected APIClient instance):

Sending a voice assistant event:

api.send_voice_assistant_event(
    VoiceAssistantEventType.VOICE_ASSISTANT_STT_START, {}
)

Sending a center button event:

api.button_command(center_button.key)

Sending a media player event:

api.media_player_command(
    key=media_player.key,
    command=MediaPlayerCommand.STOP
)

None of this has the desired effect.
I've read a lot of the aioesphomeapi client and connection code, the tests etc. and many things related to assist_satellite.py but couldn't find any more clues.

I've never worked with the HA and ESPHome Python code before, so maybe I'm missing something, but I'd appreciate any help or tips, pointing me in the right direction :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions