Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tesla SSO and Extension #1387

Merged
merged 1 commit into from
Jan 25, 2025
Merged

Add Tesla SSO and Extension #1387

merged 1 commit into from
Jan 25, 2025

Conversation

Josh-XT
Copy link
Owner

@Josh-XT Josh-XT commented Jan 25, 2025

🚗 Add Tesla Vehicle Control to AGiXT! 🔌

This PR adds full Tesla vehicle integration to AGiXT, allowing agents to control Tesla vehicles through natural language! Now your AI agents can interact with Tesla vehicles using the official Fleet API.

✨ Highlights

  • Complete Vehicle Control: Lock/unlock doors, control climate, manage charging, navigate, and more - all through natural language!
  • Secure Authentication: Full OAuth2 integration with Tesla's Fleet API including proper token management and refresh flows
  • Rich Command Set: Over 30 vehicle commands organized into logical groups:
    • Basic controls (lock/unlock, honk, lights)
    • Climate control (temperature, seat heating/cooling)
    • Charging management
    • Media controls
    • Navigation
    • Windows/sunroof control
    • And much more!

🛡️ Security & Best Practices

  • Follows Tesla's official Fleet API guidelines
  • Proper scope management for permissions
  • Secure token handling and refresh
  • Full error handling and logging

🎯 Use Cases

  • "Lock my Tesla and set the temperature to 72 degrees"
  • "Start charging my car and set the limit to 90%"
  • "Navigate to the nearest Supercharger"
  • "Turn on climate control and set the seat heaters"

This pull request introduces a new extension for controlling Tesla vehicles via the Fleet API and includes updates to the Single Sign-On (SSO) process for Tesla OAuth authentication. Additionally, environment variables for Tesla OAuth credentials have been added to the Docker configuration files.

Tesla Vehicle Control Extension:

  • agixt/extensions/tesla.py: Added a new tesla class that provides various commands for controlling Tesla vehicles, including locking/unlocking doors, controlling climate settings, managing charging, and sending navigation commands. The extension requires OAuth authentication with Tesla.

Tesla OAuth SSO:

  • agixt/sso/tesla.py: Implemented the TeslaSSO class to handle OAuth authentication with Tesla, including obtaining access and refresh tokens, and retrieving user information. Added functions for handling the OAuth flow and generating authorization URLs.

Docker Configuration:

  • docker-compose-dev.yml: Added TESLA_CLIENT_ID and TESLA_CLIENT_SECRET environment variables to support Tesla OAuth authentication in the development environment.
  • docker-compose.yml: Added TESLA_CLIENT_ID and TESLA_CLIENT_SECRET environment variables to support Tesla OAuth authentication in the production environment.

@Josh-XT Josh-XT marked this pull request as ready for review January 25, 2025 19:36
@Josh-XT Josh-XT merged commit 0ea101c into main Jan 25, 2025
7 checks passed
@Josh-XT Josh-XT deleted the tesla branch January 25, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant