Skip to content

felicity: derive real cell_count and filter 0x7FFF temp sentinel - #484

Merged
mr-manuel merged 1 commit into
mr-manuel:masterfrom
talas9:fix/felicity-cell-count-and-temp-sentinel
Jul 29, 2026
Merged

felicity: derive real cell_count and filter 0x7FFF temp sentinel#484
mr-manuel merged 1 commit into
mr-manuel:masterfrom
talas9:fix/felicity-cell-count-and-temp-sentinel

Conversation

@talas9

@talas9 talas9 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Found these running a Felicity FLA-series pack over RS485 on a Venus OS
Cerbo GX. Three issues in bms/felicity.py:

  1. cell_count is hardcoded to 16 (read_gen_data). My pack is wired as an
    8S battery; register 4906 still returns 16 cell voltage slots, but the
    8 unused ones read back 0x7FFF. With cell_count fixed at 16, the driver
    builds 16 Cell objects and cells 8-15 carry a bogus ~32.767V reading
    forever, which breaks pack voltage/balancing display on this hardware.
    Fixed by reading the cell voltage block once at startup and counting
    only slots that aren't 0x7FFF.

  2. Temperature sentinel not filtered. read_temperature_data() assigns
    self.temperature_1/2/3 straight from the raw register read. My unit
    only populates 2 of the 3 slots; the third reads 0x7FFF (32767 as a
    signed int16). battery.py's get_filtered_temperature_map() only drops
    None values, so this sentinel isn't excluded and gets averaged into
    get_temperature() along with the real sensors, pushing the reported
    pack temperature into the thousands of degrees. Fixed by mapping the
    sentinel to None before assignment, matching how the base class
    already expects "no sensor" to be represented.

  3. Minor: the comment on command_bms_temperature_1_3 says register
    4929-4931. The command bytes (\x13\x39\x00\x05) decode to register
    4921, not 4929 - confirmed against the live unit. Fixed the comment to
    avoid sending anyone chasing the wrong register number if they ever
    need to touch this.

All three confirmed against a live Felicity pack, not just from reading
the code. Patch is against current master.

- read_gen_data: count populated cell voltage slots instead of
  hardcoding cell_count to 16, so packs wired with fewer than 16
  cells don't get bogus ~32.767V ghost cells.
- read_temperature_data: map the 0x7FFF sentinel to None for
  temperature_1/2/3 so unpopulated sensor slots are excluded from
  get_temperature() averaging instead of blowing up the reported
  pack temperature.
- fix stale register comment on command_bms_temperature_1_3
  (4929-4931 -> 4921-4925, matches the actual command bytes).
@mr-manuel

Copy link
Copy Markdown
Owner

Thanks for contributing

@mr-manuel
mr-manuel merged commit 505d85d into mr-manuel:master Jul 29, 2026
3 checks passed
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.

2 participants