This page is part of archived documentation for openHAB 4.3. Go to the current stable version

# Google Cloud Speech-to-Text

Google Cloud STT Service uses the non-free Google Cloud Speech-to-Text API to transcript audio data to text. Be aware, that using this service may incur cost on your Google Cloud account. You can find pricing information on the documentation page (opens new window).

# Obtaining Credentials

Before you can integrate this service with your Google Cloud Speech-to-Text, you must have a Google API Console project:

# Configuration

# Authentication Configuration

Using your favorite configuration UI to edit Settings / Other Services - Google Cloud Speech-to-Text and set:

# Speech to Text Configuration

Using your favorite configuration UI to edit Settings / Other Services - Google Cloud Speech-to-Text:

  • Single Utterance Mode - When enabled Google Cloud Platform is responsible for detecting when to stop listening after a single utterance. (Recommended)
  • Max Transcription Seconds - Max seconds to wait to force stop the transcription.
  • Max Silence Seconds - Only works when singleUtteranceMode is disabled, max seconds without getting new transcriptions to stop listening.
  • Refresh Supported Locales - Try loading supported locales from the documentation page.

# Messages Configuration

Using your favorite configuration UI to edit Settings / Other Services - Google Cloud Speech-to-Text:

  • No Results Message - Message to be told when no results. (Empty for disabled)
  • Error Message - Message to be told when an error has happened. (Empty for disabled)

# Configuration via a text file

In case you would like to setup the service via a text file, create a new file in $OPENHAB_ROOT/conf/services named googlestt.cfg

Its contents should look similar to:

org.openhab.voice.googlestt:clientId=ID
org.openhab.voice.googlestt:clientSecret=SECRET
org.openhab.voice.googlestt:authcode=XXXXX
org.openhab.voice.googlestt:singleUtteranceMode=true
org.openhab.voice.googlestt:maxTranscriptionSeconds=60
org.openhab.voice.googlestt:maxSilenceSeconds=5
org.openhab.voice.googlestt:refreshSupportedLocales=false
org.openhab.voice.googlestt:noResultsMessage="Sorry, I didn't understand you"
org.openhab.voice.googlestt:errorMessage="Sorry, something went wrong"

# Default Speech-to-Text Configuration

You can setup your preferred default Speech-to-Text in the UI:

  • Go to Settings.
  • Edit System Services - Voice.
  • Set Google Cloud as Speech-to-Text.

In case you would like to setup these settings via a text file, you can edit the file runtime.cfg in $OPENHAB_ROOT/conf/services and set the following entries:

org.openhab.voice:defaultSTT=googlestt