AP300: add number platform and controls support - #234
Open
happytechca wants to merge 1 commit into
Open
Conversation
Adds support for AP300 device controls in the HA integration: - New number platform (number.py) with slider entities for battery SOC range start/end, including validation guard that prevents setting start >= end (and vice versa) - Platform.NUMBER added to PLATFORMS list - Translations for new controls in en/de/pt: switch: ctrl_charge_from_grid select: ctrl_working_mode (with state labels) number: soc_range_start, soc_range_end - FieldCategory: added CTRL_WORKING_MODE, CTRL_CHARGE_FROM_GRID, BATTERY_SOC_RANGE_START, BATTERY_SOC_RANGE_END to CONFIGS Depends on bluetti-bt-lib AP300 device model PR for NumberField and WorkingMode enum support. Co-Authored-By: Claude Opus 4.6 <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
Adds Home Assistant support for AP300 device controls introduced in bluetti-bt-lib PR #61:
number.py): slider entities for battery SOC range start/end (0–100%), with validation guard preventing start ≥ end__init__.pyctrl_charge_from_gridswitch,ctrl_working_modeselect with state labels,soc_range_start/soc_range_endnumber entitiesCTRL_WORKING_MODE,CTRL_CHARGE_FROM_GRID,BATTERY_SOC_RANGE_START,BATTERY_SOC_RANGE_ENDto CONFIGS listDependencies
NumberField,WorkingModeenum, and the expanded AP300 device modelNotes
ServiceValidationErrorwith a descriptive message if the user tries to set invalid ranges🧪 Testing with full AP300 support (before PRs are merged)
If you have an AP300 and want to test the full working integration (sensors + controls including encrypted writes and persistent BLE connection), you can use the combined test branches. These include the work from PRs #59, #60, and #61 all together.
Step-by-step instructions
1. Install the custom integration via HACS
ap300-combinedbranch2. Restart Home Assistant
Go to Settings → System → Restart
3. Add your Bluetti device
What you get
Reverting back
To go back to the official version once the PRs are merged:
🤖 Generated with Claude Code