Skip to content

xagon0/chatgpt-for-hubitat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Hubitat ChatGPT Driver

This driver allows the Hubitat home automation platform to communicate directly with OpenAI's GPT models, retrieving intelligent and contextual responses based on user questions.

Features

  • Communicate with OpenAI GPT models directly from Hubitat.
  • Retrieve responses to user questions.
  • Initial support is for both general, and true/false styled questions.
  • Customizable settings to control the behavior of the OpenAI model.

Getting Started

Prerequisites

  • A valid API key from OpenAI.

Installation

  1. Navigate to the Drivers Code section of your Hubitat interface.
  2. Click on the + New Driver button.
  3. Copy the content of ChatGPT_Driver.groovy and paste it into Hubitat.
  4. Save the driver.
  5. Create a new virtual device and assign the "ChatGPT Driver" as its driver.

Configuration

Once the driver is added to a device, you will have the option to configure:

  • OpenAI API Key: Your personal key to access the GPT models. (Obtain this here: https://platform.openai.com/account/api-keys)
  • Standard Model: Choose between gpt-3.5-turbo and gpt-4.
  • Model Max Tokens: The maximum tokens the model should use for the response. (Default is 256)
  • Model Temperature: Controls the randomness of the model's output. (Default is 1)
  • Model Top P: Influences the diversity of the generated text. (Default is 1)
  • Request Timeout: Define how long to wait for a response. (Default is 30, but complex reasoning on GPT-4 make take over 60)
  • Clear response while pending?: Option to clear the previous response while waiting for a new one.
  • Default content for True/False with Detail: Set the default content/context for the true/false questions.

Usage

Two primary commands can be executed:

  1. ask(Content, Question): Provides a response based on the system content and user question.
  2. askTrueFalseWithDetail(Question): Provides a true/false/unknown response with additional details based on the user question.

Contributing

Feel free to fork, modify, and submit pull requests. All contributions are welcome!

License

This project is open-source. License file for more details.

Acknowledgments

  • Thanks to OpenAI for providing such a robust and versatile model.

About

A ChatGPT driver for Hubitat

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages