EP760: add device/state class + translations for new registers - #253
Open
mikwhe wants to merge 1 commit into
Open
EP760: add device/state class + translations for new registers#253mikwhe wants to merge 1 commit into
mikwhe wants to merge 1 commit into
Conversation
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
Companion PR to Patrick762/bluetti-bt-lib#88 (EP760 register fixes — signed AC_P1_POWER, PV_S3 reclassification, new grid max import/export registers, energy counters, house load).
That PR adds new/changed FieldName entries in bluetti-bt-lib. This PR wires those fields up on the HA integration side: sensor device_class, state_class, and UI translation strings. No register/BLE logic changes here — purely HA entity metadata so the new sensors show proper units, icons, and Energy Dashboard eligibility instead of falling back to generic/unlabeled entities.
Tested against a live EP760 alongside the corresponding bluetti-bt-lib branch — confirmed entities render with correct names, units, and (where applicable) appear as valid Energy Dashboard sources.
Changes
custom_components/bluetti_bt/types/FieldDeviceClass.py
Added SensorDeviceClass mappings for:
PV_S3_POWER / PV_S3_VOLTAGE / PV_S3_CURRENT → POWER / VOLTAGE / CURRENT
TOTAL_GRID_CONSUMPTION / TOTAL_GRID_FEED / TOTAL_LOAD_CONSUMPTION → ENERGY
HOUSE_LOAD_POWER → POWER
custom_components/bluetti_bt/types/FieldStateClass.py
Added matching SensorStateClass mappings:
PV_S3_POWER / PV_S3_VOLTAGE / PV_S3_CURRENT → MEASUREMENT
TOTAL_GRID_CONSUMPTION / TOTAL_GRID_FEED / TOTAL_LOAD_CONSUMPTION → TOTAL_INCREASING (required for Energy Dashboard cumulative sensors)
HOUSE_LOAD_POWER → MEASUREMENT
custom_components/bluetti_bt/translations/en.json
Added friendly display names for the newly exposed entities, including ctrl_grid_max_import_power, ctrl_grid_max_export_power, pv_s3_*, house_load_power, and the energy counter fields.
Dependency
This PR assumes the FieldName entries referenced above exist — i.e. it should be merged together with (or after) the bluetti-bt-lib PR, not standalone, or these mappings will reference undefined enum members.
Not included
DC_INPUT_POWER already had correct device_class/state_class mappings upstream — no change needed there.
No changes to entity category, config flow, or any other integration logic — scope is limited to device_class/state_class/translations only.