rhasspy / wyoming-satellite

Remote voice satellite using Wyoming protocol
MIT License
653 stars 94 forks source link

Add a way to initiate an interaction #45

Open HannesK-ME opened 9 months ago

HannesK-ME commented 9 months ago

It would be great to have a way to initiate an interaction from the satellite through automations, for example. In ESPHome there is a workaround with a switch that enables listening without the wake word being uttered first. Something like this would be great!

As an example:

Satellite says (triggered by automation): "It's getting hot, do you want me to turn on the AC?" then starts listening for a reply and acts on it.

Mincka commented 5 months ago

Great suggestion. I also would like to trigger interaction with a push of a button, instead of using the wake word.

Dza-byte commented 5 months ago

I would love this as well. Really opens up some possibilities

Mincka commented 5 months ago

Actually, there is an open PR about this: https://github.com/rhasspy/wyoming-satellite/pull/144 Also, this issue seems to be a duplicate of #81.

Mincka commented 5 months ago

Quick guide to test it:

  1. Copy files from https://github.com/chatziko/home-assistant-core/tree/wyoming-satellite-force-activate/homeassistant/components/wyoming in HA folder \config\custom_components\wyoming\
  2. Update the manifest file with a version (it can be anything) to the forked build of wyoming python package:
    {
    "domain": "wyoming",
    "name": "Wyoming Protocol",
    "codeowners": ["@balloob", "@synesthesiam"],
    "config_flow": true,
    "dependencies": ["assist_pipeline"],
    "documentation": "https://www.home-assistant.io/integrations/wyoming",
    "iot_class": "local_push",
    "requirements": ["wyoming==1.5.4"],
    "zeroconf": ["_wyoming._tcp.local."],
    "version": "v100.0.0"
    }
  3. Restart HA
  4. On the satellite, clone the repository from chatziko git clone https://github.com/chatziko/wyoming-satellite
  5. Checkout the branch with the update git checkout force-activate
  6. Pull the content of a recommended, but not required, PR git merge origin/use-transcribe-event
  7. Resolve the merge conflict in wyoming_satellite/satellite.py: just remove the following lines:
    <<<<<<< HEAD
    =======
    >>>>>>> origin/use-transcribe-event
  8. Update requirements.txt to reference the wyoming fork
    git+https://github.com/chatziko/wyoming.git@run-satellite-start-stage#egg=wyoming
    zeroconf==0.88.0
    pyring-buffer==1.0.0
  9. Run script/setup
  10. Run your satellite (my config for ReSpeaker USB on Raspberry Pi 4) script/run --name 'my satellite' --uri 'tcp://0.0.0.0:10700' --mic-command 'arecord -D plughw:3,0 -r 16000 -c 1 -f S16_LE -t raw' --snd-command 'aplay -D plughw:3,0 -r 22050 -c 1 -f S16_LE -t raw' --awake-wav sounds/awake.wav --done-wav sounds/done.wav
  11. Call the service in HA to initiate the interaction
    service: button.press
    data: {}
    target:
    entity_id: button.my_satellite_none

    2024-05-17 - Guide updated to fix an invalid syntax in the requirements attribute of the integration's manifest file. 2024-05-28 - Updated to mimic the latest release (wyoming==1.5.4), be sure to check the latest version and change this 2024-06-03 - Updated to remove pull of custom wyoming package since a required PR was merged in 1.5.4 (HA also references 1.5.4).

tinyfrenchcars commented 3 months ago

Hi, is this little guide still up to date/usable ? Just tried, seems to work on each side, but not really as there's no comm between HA and wyoming sattelite and I can't figure out where I'm wrong :-( edit : just saw an error in logs : TypeError: RunSatellite.init() got an unexpected keyword argument 'start_stage' if it can help