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

Bug fixes, missing commands and endpoints #95

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from

Conversation

Lenart12
Copy link
Contributor

@Lenart12 Lenart12 commented Jan 28, 2025

This pull request includes several updates to the TeslaBleHttpProxy project. It changes quite a bit of things and is fairly large. The most important changes are summarized below:

Code Refactoring:

  • Scan for vehicle BLE advertisements to check for vehicle presence and abort quickly if none are detected, using my contributions to vehicle-command repository.
  • Expose BLE connection status via /api/proxy/1/vehicles/VIN/connection_status. Closes Add BT information #78
  • Refactored the internal/api/handlers/tesla.go to make sure all endpoints use operated connection command processing logic, including body-controller-state.
  • Moved body-controller-state endpoint to /api/proxy/1/vehicles/VIN/body_controller_state to be consistent with naming scheme. Moved wake_up to /api/1/vehicles/VIN/wake_up to be consistent with Tesla API.
  • Implemented most of the missing fleet commands and added stubs for missing/unsupported ones
  • Simplified json formatting for vehicle_data and added missing categories. Added manual json formatting for body-controller-state, fixes vehicleLockState missing for unlocked vehicle? #87 .
  • Removed unused imports and redundant code in internal/api/handlers/tesla.go.
  • Fixed an issue where a command would retry forever and block other commands if it was slow enough. Also fixed retries if connection expires.
  • Work around a bug where starting infotainment session after car wake up would never finish.
  • Allow wake_up command to wait for car to wake up with wait=true parameter
  • Command line interface with backwards compatibility.
  • Allow changing keys directory.
  • Support proxy base url and X-Ingress-Path for running this app behind a reverse proxy.

Configuration Enhancements:

  • Introduced a new scanTimeout configuration parameter in config/config.go to control the scan duration for BLE beacons.
  • Updated the cacheMaxAge environment variable default value in the README.md to 5 seconds.
  • Introduced keys parameter to allow reading keys from a different directory.
  • Introduced dashboardBaseUrl and apiBaseUrl for configuring paths when running behind a reverse proxy.

Dependency Updates:

  • Updated the github.com/teslamotors/vehicle-command dependency in go.mod to a newer version.
  • Removed outdated replace directives for dependencies in go.mod, since go_bleConnectFix is now not neccesary anymore :^)

Documentation Updates:

  • Updated the README.md to include a reference to TeslaBle2Mqtt and added a comprehensive list of supported endpoints for vehicle data.
  • Simplified the list of supported vehicle commands and provided an example of how to use the wait parameter.
  • Added a new section for BLE connection status in the README.md.
  • Added a new section for installing the addon through a home assistant repository. Closes Home Assistant Add-On #82

@wimaha
Copy link
Owner

wimaha commented Jan 29, 2025

Thank you for all if this! I will Review when I‘m back Home.

@wimaha
Copy link
Owner

wimaha commented Feb 24, 2025

Hi, I'm back and will now start to look through all the changes.

@Lenart12
Copy link
Contributor Author

Hello, still working on a couple of upstream fixes in vehicle-command before ready to merge, but nothing should change in this PR ideally.

@wimaha wimaha marked this pull request as draft February 25, 2025 15:18
@bicaluv
Copy link

bicaluv commented Feb 28, 2025

@wimaha : Will the merge effect the integration into evcc or required updates on the template in evcc?

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.

vehicleLockState missing for unlocked vehicle? Home Assistant Add-On Add BT information
4 participants