homeassistant-satellite icon indicating copy to clipboard operation
homeassistant-satellite copied to clipboard

Feature-Request: Run scripts on voice-actitivity start + end, awake and done etc. (e.g. to control indicator LEDs)

Open jkrenzer opened this issue 8 months ago • 5 comments

I'd propose to add the feature to call an external script on state changes. This way one could for example use LEDs connected to the system to indicate the current state of the satellite to the users. Thus it would be much easier to judge when the satellite is streaming audio and what stage the whole process of communication is at.

I would suggest the following states/events:

  • Script successful startup
  • Script startup failure
  • Audio streaming started
  • Audio streaming terminated
  • Wakeword detected, awake
  • Done
  • Playing response
  • Response done
  • Script shutdown

Thanks for any input or considerations!

Jörn

jkrenzer avatar Nov 18 '23 15:11 jkrenzer

There is already a homeassistant_satellite_event event emitted for most important state changes which can be used to trigger scripts (although it's not documented yet).

Check #54 for details.

chatziko avatar Nov 18 '23 19:11 chatziko

Hi!

As far as I understand homeassistant_satellite_event is emitted on the home-assistant instance, right?

I intend to run a script locally on the hardware running homeasssisten-satellite. So without interaction back and forth with home-assistant. Main use-case is to switch the satellite's LEDs to signal state or errors tp the user locally without need to log into the satellite's system.

jkrenzer avatar Nov 18 '23 19:11 jkrenzer

Oh I see, when you wrote "script" I understood "HA script", not "bash script" :smile: . Indeed currently you can do that only via HA. Maybe this could help?

chatziko avatar Nov 18 '23 20:11 chatziko

This would be one possibility for some of the functionality probably. For sure it is a noteworthy possibility to employ the LEDs of the satellite to signal for the smart home. Thank you for bringing it to attention.

But for obvious reasons this would fail when for example I wanted the LEDs to turn red when the wifi connection or the connection to the home-assistant instance would break or if homeassistant-satellite errors out. And also the possibility to show transparently when the satellite is listening (to address people's privacy concerns) without the HA instance being able to meddle with this would be lost.

jkrenzer avatar Nov 18 '23 21:11 jkrenzer

I just want to add that all you requested, including LEDs on ReSpeakers, is ready available in https://github.com/rhasspy/wyoming-satellite/

ser avatar Dec 19 '23 05:12 ser