Ok, I can help you navigate Rhasspy’s vast code base
I’ll limit myself to the Hermes MQTT part, because that’s what I’m using.
First you need to define new messages or extend existing messages in the Hermes protocol. Those are defined in the rhasspy-hermes project. The API is documented (not yet completely reworked to the new documentation format, but already usable).
If you want to turn up and down the volume, you’ll need to extend the rhasspyhermes.audioserver module. This is one of the few modules where the documentation is not yet converted to the new, much clearer format, but I’ll see if I can find some time to work on this sooner.
You can ask for information about the current audio devices by sending a rhasspyhermes.audioserver.AudioGetDevices message. This translates to the
rhasspy/audioServer/getDevices MQTT topic. Have a look at the code for now to see this, as the documentation of this module is not yet complete. After sending this message, you get a rhasspyhermes.audioserver.AudioDevices message with information about all the available audio devices. This includes their mode (input or output), id, name, description and so on.
Note that you can already mute and unmute the audio: see rhasspyhermes.audioserver.AudioToggleOff and rhasspyhermes.audioserver.AudioToggleOn.
If you also want to turn up and down the volume, what you should do is define a message with MQTT topic
rhasspy/audioServer/foobar to set the volume (as a float) for an audio device with a specific ID. You should probably also define a message to ask what the current volume of an audio device is. Or maybe you can extend the current getDevices topic and let it include the current volume of every audio device. I don’t know what’s best.
After defining these Hermes MQTT messages, you have to implement how Rhasspy reacts to them. This comes in rhasspy-speakers-cli-hermes and rhasspy-server-hermes.
And maybe you also want to do something similar for the microphone? That would be in rhasspy-microphone-cli-hermes and rhasspy-microphone-pyaudio-hermes.