Have openHAB phone app speak?

In the openHAB app, when I speak into the microphone, the text shows up in an item called VoiceCommand. I’m not sure if this is the app doing this or if it is part of Cuevox and/or Ollama.

I’m trying to find a way to do the opposite. ie. when I put text into an item, have the text spoken on my phone. Is there an existing openHAB way to do this?

Probably not Ollama. I don’t know what Cuevox is. See Android App | openHAB for detials on how this is set up.

For text to speach you need the following:

  1. a TTS engine (see the Voice category of add-ons.
  2. an audio sink
  3. a rule to use the say Action to generate the audio and send it to the sink.

Unfortunately, where you will run into trouble is 2. The Android App does not provide an audio sink. However, through the browser you can pull up MainUI and enable it as an audio sink from the Help & About page. Then you can send the spoken audio to the Web Sink to have it play on the phone.

So if I understand correctly, on the Help & About page on the openHAB app, I set “Enable Web Audio sink support” to on and then in my script which is triggered by an update to the VoiceCommand item I have
actions.Voice.say(responseText, “pipertts:northern_english_male-en_GB”, “webaudio”);
I also have:
openhab> openhab:voice voices
* Piper - English (United Kingdom) - Northern_english_male (pipertts:northern_english_male-en_GB)
openhab> openhab:audio sinks
Sonos Beam (sonos:Beam:RINCON_804AF249EF5601400)
System Speaker (enhancedjavasound)

* Web Audio (webaudio)

The logs show:
2025-11-14 10:10:48.356 [INFO ] [b.automation.openhab-js.debug-cuevox] - Response text: OK. Turning on the office light
and the light does turn on but I don’t hear any response. I’ve checked the obvious, ie volume on the phone> Am I missing something?

Also FYI: GitHub - JanMattner/voice-control-openhab: A simple but extensible rule based voice control tool for openHAB.

Double check your list of audio sinks (under Settings → Audio) and double check that the audio isn’t showing up as something other than “webaudio”. Beyond that :person_shrugging: . I use Nest speakers as my audio sink.

Note, I think the web page needs to be open on the screen for Android to allow it to play audio. It’s not going to work if the phone/tablet is off, locked, etc. I think.

“Web Audio” is set as the default audio sink under Settings→Audio and yes, the openHAB phone app was open when I tried this.
I’ve also tried:
openhab> log:set TRACE org.openhab.core.audio.internal.webaudio
openhab> log:set DEBUG org.openhab.core.io.http.servlet
openhab> openhab:voice say “This is a test” “pipertts:northern_english_male-en_GB” “webaudio”
and the only thing that show up in the logs is:

2025-11-14 11:19:36.736 [DEBUG] [.internal.webaudio.WebAudioAudioSink] - Received audio stream of format AudioFormat [codec=PCM_SIGNED, container=WAVE, bigEndian=false, bitDepth=16, bitRate=705600, frequency=44100, channels=1]
but I don’t hear anything.

Not the phone app. The phone app doesn’t serve as an audio sink, You have to do this all through the browser on the phone, not the phone app.

Ah! but then how do you get to the microphone?
I tried the console command again with the phone browser open on the Overview page and still didn’t hear anything.

:person_shrugging: I don’t really use voice except for a few announcements. I’ve reached the end of what I know how to do. I assumed there was a microphone option from the browser but maybe all this is simply not possible unless/until the Android app implements the ability to be an audio sink. I suspect there are restrictions on the play store that might prevent that from working though. I can’t think of any apps on my phone that are allowed to send audio to me except when I have it open.

OK, well thanks for trying. I might see if I can write a little Android app to do this. Never written for Android before. It should be interesting. I was going to look at that abandoned HABSpeaker app too. Perhaps this is what it is meant for. So many projects.