Skip to content

AC: total energy sensor shows Wh as kWh (1000× too high) — totalElectricityUsed is reported in Wh #147

Closed

Description

@SusoINC

Before opening

addhOn version

5.29.0

Home Assistant version

2026.11.0

Appliance type

Air conditioner (AC)

Appliance model

AS35SBBHRA-MB (also seen on AS25SBBHRA-MB and AS50SDBHRA-MB, Haier Flexis)

What happens, and what did you expect?

The AC total_energy sensor (sensor.<ac>_air_conditioner_total_energy, attribute totalElectricityUsed) is declared with native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, but these units report the counter in Wh. The entity therefore shows values 1000× too high.

Compared with the hOn app: for the AS25SBBHRA-MB unit the raw totalElectricityUsed is 26, Home Assistant shows 26 kWh, and the hOn app shows 0.02 kWh.

Readings of the AS35SBBHRA-MB while heating (raw totalElectricityUsed, local time, 2026-11-09):

Time Raw value Δ Interval Average power if Wh if kWh
19:31 45954 +176 16 min 660 W 660 kW
19:47 46031 +77 16 min 289 W 289 kW
20:03 46189 +158 16 min 593 W 593 kW
21:07 46696 +146 16 min 548 W 548 kW
21:23 46778 +82 16 min 308 W 308 kW
21:39 46927 +149 16 min 559 W 559 kW
21:55 47037 +110 16 min 413 W 413 kW

300–700 W is what a 3.5 kW heat pump draws at part load; 300–700 kW is impossible. Over the 12 days since the unit was added the counter went from 289 to 47037: about 47 kWh (≈3.9 kWh/day) if Wh, versus 47 MWh if kWh.

accumulatedUseMainsPower carries the same value as totalElectricityUsed on all three units (26 / 338 / 47037).

Expected: the sensor shows kWh (raw value / 1000).

Note: the comment above _AC in sensor.py says AS-class ACs report 0 for totalElectricityUsed. These units (2026 Flexis, S*BHRA-MB) report a live counter in Wh, so the sensor is useful once the unit is fixed.

Suggested fix: declare the native unit as Wh and let Home Assistant display kWh:

HonSensorEntityDescription(
    key="total_energy",
    translation_key="ac_total_energy",
    attr_key=AC_ATTR_TOTAL_ENERGY,
    native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
    suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
    device_class=SensorDeviceClass.ENERGY,
    state_class=SensorStateClass.TOTAL_INCREASING,
),

Users who already have this sensor have long-term statistics recorded ×1000. After the fix the value drops by 1000, which the recorder treats as a meter reset, so a note in the release changelog would help.

Local workaround I'm running meanwhile: a value_fn that divides by 1000, keeping the native unit as kWh:

def _wh_to_kwh(raw) -> float | None:
    if raw is None:
        return None
    try:
        return round(float(raw) / 1000, 3)
    except (ValueError, TypeError):
        return None

and value_fn=_wh_to_kwh on the AC total_energy description.

Steps to reproduce

  1. Add a Haier Flexis AC (e.g. AS35SBBHRA-MB) through addhOn.
  2. Run it in heat or cool mode for an hour or more.
  3. Compare sensor.<ac>_air_conditioner_total_energy with the energy shown in the hOn app, or with the change in the raw totalElectricityUsed over time.

Error code

No response

Diagnostics file

addhon-diagnostics-aires.json

Debug log

No response

Activity

  1. github-actions commented on Nov 9, 2026

    @github-actions
    Contributor

    Thanks @SusoINC, we received your issue.
    We'll reply as soon as we can; no reply yet means we're already working on it.
    If we need more details or tests, we'll ask here.

  2. tis24dev commented on Nov 11, 2026

    @tis24dev
    Owner

    @SusoINC Hi, install the latest release and let me know what you think... I hope that solves the problem.

  3. SusoINC commented on Nov 12, 2026

    @SusoINC
    Author

    @tis24dev
    Thanks for the fix! Now it looks fine :)

  4. github-actions commented on Nov 12, 2026

    @github-actions
    Contributor

    @SusoINC thanks for using addhOn!

    Important

    addhOn is an independent, self-funded project: every bit of support really makes a difference.

    Sponsor addhOn on GitHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions