#Expose Voice PE button

1 messages · Page 1 of 1 (latest)

serene wren
#

I'm not sure if there's a better way to do this, but my end goal is to get Voice PE to start listening from running a script. I don't see any options so I tried using the event.home_assistant_voice_092cca_button_press entity for a virtual button push and that doesn't work either. Is there any way to get Voice PE to start listening without physically having to use the wake word or physically press the button? Also wasn't sure if this would be a better post for here or the Automations sections. Thanks!

mint rune
serene wren
#

Based on those, it seems like what I want will be coming hopefully soon. Could you elaborate on adopting VPE in esphome and setting up a service call? If I'm not mistaken, VPE is already adopted into esphome during the initial setup, butI don't see any way to trigger it to listen via a service call. What would the entity be? The list it gives me doesn't show anything from VPE

mint rune
#

No, I mean it will need to be adopted in esphome (the addon not the integration). When it is adopted you can add code to it. For example a home assistant service as in the PR.

serene wren
#

gotcha, my bad! sounds like that should work then at least until there's a more streamlined approach which seems like may be in the works based on your first link. Thanks again, much appreciated!

mint rune
#

Yes, once the idea in the first link is finalized, this will be much better than a simple service call. Could take a while though looking at how little traction this got since Sept 24.

serene wren
#

so, I wanted to more or less look into it, but I guess I'm all in as it seems that ESPHome wipes the device rather than just reading what's already on it? I wasn't really expecting that. I've messed with an ESP32 device once before when making some LED lights....do I just copy and paste everything from that PR? Seems like there should be more? I've essentially bricked the HA Voice until I reinstall something on it....unless I'm looking at something wrong

mint rune
#

At the end of the code in esphome you can add the following part of the PR.

api:
  actions:
    - action: start_va
      then:
        - if:
            condition:
              and:
                - switch.is_off: master_mute_switch
                - not:
                    voice_assistant.is_running
            then:
              - script.execute:
                  id: play_sound
                  priority: true
                  sound_file: !lambda return id(center_button_press_sound);
              - delay: 300ms
              - voice_assistant.start:
    - action: stop_va
      then:
        - voice_assistant.stop
serene wren
#

yeah, I just discovered that page which is a good fallback

#

this is all I have since adding it to ESPhome

#

unplugging from my computer and plugging it back into a wall outlet yields nothing so I'm assuming I need to do more than just add that little bit of extra code?

mint rune
#

this is how it looks before adopting:

#

that's output you should expect after adopting

serene wren
#

well, that answers what went wrong lol I definitely said new device and followed the prompts until it told me to plug it in....which explains why I couldn't adopt it, it wasn't plugged in yet for it to be discovered.....I think I should be able to just flash it again and then ADOPT it rather than adding it as a new device. I appreciate the help again

mint rune
#

yes, if you flash it back to factory, it should pop up in ESPhome like in the above screenshot and you can adopt it.

#

note: it will only show up in the ESPhome dashboard if it can be detected via MDNS in your network. Sometimes (as in my case) this does not work when using containers and/or VLANs.

serene wren
#

is it fine if I only saw "take control" rather than "adopt"?

#

it compiled a bunch and eventually booted and my .yaml now matches what you showed

serene wren
#

okay, that worked! All of that just so HA can ask me if I I want to turn off the lights when I tell it to turn on the TV lol I really appreciate the help. It works exactly like I want

mint rune
#

Please note that you won't auto receive updates this way. If there's an update you will have to recompile via the esphome dashboard. It pulls the latest version on each compile, but you will have to trigger it. That's imho the only downside with the adoption.