Add comprehensive SOC (State of Charge) sensor integration#134
Open
alexlenk wants to merge 1 commit intoyoziru:mainfrom
Open
Add comprehensive SOC (State of Charge) sensor integration#134alexlenk wants to merge 1 commit intoyoziru:mainfrom
alexlenk wants to merge 1 commit intoyoziru:mainfrom
Conversation
Integrate complete SOC (State of Charge) functionality from alexlenk/tesla-ble library: - Add three SOC sensors: Battery Level, Usable Battery Level, and Charge Limit - Enhance existing battery_level_sensor with accurate SOC data extraction - Add new usable_battery_level_sensor for usable battery percentage - Add new charge_limit_sensor for target charge limit percentage - Update tesla-ble library dependency to alexlenk/tesla-ble fork - Implement SOC data processing in VehicleStateManager with proper validation - Add ESPHome sensor auto-generation for all three SOC sensors - Follow established component patterns for sensor configuration - Include comprehensive error handling and logging All sensors update automatically when vehicle data is retrieved and appear natively in ESPHome dashboard and Home Assistant. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive SOC (State of Charge) functionality to the ESPHome Tesla BLE component, providing three new battery sensors for Tesla vehicle monitoring in Home Assistant.
This PR depends on yoziru/tesla-ble#31 being merged first.
The companion tesla-ble library PR adds the core SOC extraction functionality that this ESPHome integration utilizes. Once that PR is merged and a new release is created, the
packages/base.ymlfile will be updated to reference the official release version instead of the temporary fork reference.🚀 Key Features
🔧 Technical Implementation
📊 ESPHome Dashboard Integration
After this update, the ESPHome Sensors section will display three new battery sensors:
🏠 Home Assistant Integration
These NEW sensors automatically appear in Home Assistant as:
sensor.tesla_battery(NEW)sensor.tesla_usable_battery_level(NEW)sensor.tesla_charge_limit(NEW)Perfect for automations, dashboards, and smart charging logic - functionality that was previously unavailable.
✅ Testing & Verification
📋 Files Changed
components/tesla_ble_vehicle/vehicle_state_manager.h- NEW SOC sensor infrastructurecomponents/tesla_ble_vehicle/vehicle_state_manager.cpp- NEW SOC data processing implementationcomponents/tesla_ble_vehicle/tesla_ble_vehicle.h- NEW sensor setter declarationscomponents/tesla_ble_vehicle/tesla_ble_vehicle.cpp- NEW sensor configuration logiccomponents/tesla_ble_vehicle/__init__.py- NEW ESPHome sensor auto-generationpackages/base.yml- Tesla-ble library dependency (temporary fork reference)🎯 Usage Example
After deployment, users get NEW comprehensive Tesla battery monitoring:
🔄 Next Steps
packages/base.ymlto reference official release versionThis enhancement adds entirely NEW battery monitoring capabilities to the ESPHome Tesla BLE component, providing detailed battery insights that were previously unavailable.
🤖 Generated with Claude Code