Skip to content

EP600: AC_P1_POWER, AC_P2_POWER, AC_P3_POWER reported as large unsigned values instead of signed (negative) power #74

Description

@carstenschroeder

Description

For the EP600, the fields AC_P1_POWER, AC_P2_POWER and AC_P3_POWER return incorrect values.

Instead of realistic (often negative) power values, very large positive numbers are reported, e.g.:

  • 65120 (instead of something like -416)

Expected behavior

These registers represent signed 16-bit integers (two’s complement):

  • Positive values → power output / feeding
  • Negative values → power consumption / charging

Example:

  • Raw register value 0xFE60 should be interpreted as -416, not as unsigned 65120.

Actual behavior

In bluetti_bt_lib/devices/ep600.py the fields are currently defined as:

UIntField(FieldName.AC_P1_POWER, 1510),
UIntField(FieldName.AC_P2_POWER, 1517),
UIntField(FieldName.AC_P3_POWER, 1524),

UIntField uses struct.unpack("!H", data) (unsigned 16-bit).
When a negative value is present, it is therefore shown as a large positive number (e.g. 65120).

Root cause

The AC phase power registers on the EP600 are signed, but the library currently treats them as unsigned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions