synesthesiam / homeassistant-satellite

Streaming audio satellite for Home Assistant
MIT License
188 stars 23 forks source link

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

Open jkrenzer opened 1 year ago

jkrenzer commented 1 year ago

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:

Thanks for any input or considerations!

Jörn

chatziko commented 1 year ago

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.

jkrenzer commented 1 year ago

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.

chatziko commented 1 year ago

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?

jkrenzer commented 1 year ago

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.

ser commented 11 months ago

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