Skip to content

EP760: add device/state class + translations for new registers - #253

Open
mikwhe wants to merge 1 commit into
Patrick762:mainfrom
mikwhe:ep760-fix-2026-07
Open

EP760: add device/state class + translations for new registers#253
mikwhe wants to merge 1 commit into
Patrick762:mainfrom
mikwhe:ep760-fix-2026-07

Conversation

@mikwhe

@mikwhe mikwhe commented Aug 12, 2026

Copy link
Copy Markdown

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.

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