Skip to content

ViPeR5000/openai_stt_ha

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI Speech-To-Text for Home Assistant

This custom component integrates OpenAI Speech-to-Text, also known as Whisper, into Home Assistant via the OpenAI API.

Installation

HACS

You can install this integration via HACS.

  1. Go to HACS / Integrations / Three-dots menu / Custom repositories
  2. Add:
    • Repository: https://github.com/einToast/openai_stt_ha
    • Category: Integration
  3. Install the "OpenAI Whisper API" integration.
  4. Restart Home Assistant.

Manual

  1. Inside your config directory, create a new directory named custom_components.
  2. Create a new directory named openai_stt inside the custom_components directory.
  3. Place all the files from this repository in the openai_stt directory.
  4. Restart Home Assistant.

Configuration

You need to create an account on the OpenAI website and get an API key . Then add the following to your configuration.yaml:

stt:
  - platform: openai_stt
    api_key: YOUR_API_KEY
    #  Optional parameters
    api_url: https://api.openai.com/v1
    model: whisper-1
    prompt: ""
    temperature: 0

Parameters:

  • api_key (Required): Your OpenAI API key.
  • api_url (Optional): The API URL to use. The default is https://api.openai.com/v1. Specify this to use a different API than OpenAI's.
  • model (Optional): The model to use. The default is whisper-1. Currently, the only available model is whisper-1. The available models are listed here.
  • prompt (Optional): The prompt to use. The default is an empty string. See the OpenAI documentation for more information.
  • temperature (Optional): The temperature to use between 0 and 1. The default is 0. A higher temperature will make the model more creative, but less accurate.

Cost

The OpenAI API is a paid service. You can find the pricing here. Currently, Whisper costs $0.006 per minute of audio.

Error

If you get the following error in the Home Assistant system log:

The stt integration does not support any configuration parameters, got [{'platform': 'openai_stt', 'api_key': 'YOUR_API_KEY'}]. Please remove the configuration parameters from your configuration.

This issues is a known bug in Home Assistant >= 2023.7. The reported message does not affect the functionality of this integration, it should still work.

About

OpenAI Wisper in HA via the OpenAI API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%