Skip to content

[Bug]: SOC predictor is not accurate. #242

@jacekkjw

Description

@jacekkjw

Home Assistant version

2026.2.1

BMW CarData HA integration version

4.8.0 and main.

Installation method

HACS

BMW vehicle model & year

Countryman Cooper SE all4 2022

What happened?

SOC integration prediction isn't accurate

Too clarify: I’m on the main now. PHEV and AC only.
I made 2 tests. First one I just charge from 17% to 90%. Picture below (I changed the order of the sensors so colors changed):

Image

  • Integration prediction sensor is too optimistic and was synced 4 (even 5) times down.
  • Prediction is syncing now with battery state (perfect) but still is syncing with bmw API prediction. API predictor sucks and many times syncing with battery with big delay. I don’t think so we should sync with it.

I manually measured/calculate (from graph and using external energy meter) real charging efficiency. It shows 67%. It’s weird, definitely too low. It suggests that battery size is too low. I checked it seral times. I found few values: 7.6 (most common), 8.8 and 9.0. API shows 7.3 comparing to 7.6 is probably ok. At the end is was difficult for me to find one source of true.
For comparison I checked efficiency on my second car (audi) and it shows 99,4%. Looks good but it little too high. Probably battery sizes provided by manufacturers are not so precise.
We don’t want to find the correct size of the battery or charging efficiency. We want to provide SOC level the same like at the official app but refreshing more frequently.
It can be done even is there a problem with correct battery size. If we remove limitation for efficiency charging (between 82% and 98%) lerning algorithm should find proper efficiency even battery size is wrong. Sometimes finally it will be very low sometimes above 100% but SOC level will be correct.
I made second test. I changed a bit the code: set the limits between 20% and 98% percent and default AC efficiency 67% (as I manually calculate for my car). Charging from 3% to 56%. Second graph below:

Image

  • Soc predictor is correct
  • It was syncing up by API predictor and next down by real battery SOC level . Up and down is more or less the same value. That suggest API predictor is not so correct. ;)

Some suggestion:

  • Integration shouldn’t have limitation for efficiency charging. Efficiency will correct problems with correct battery size (Up or down).
  • There could be a mechanism of checking correctness of last charging session. But it should base on difference to current charging efficiency. It should work after some initial number (10?) of charging without any checks. It should allow learning algorithms find the initial value of efficiency factor .
  • Could you guys implement some diagnostic sensor separate for AC I DC. One with current charging efficiency factor and second with efficiency for last charging session

Steps to reproduce

No response

Screenshots

No response

Debug logs

None

Additional context

No response

Checklist

  • I'm using the latest version of the integration
  • I've searched existing issues to avoid duplicates
  • I've included debug logs and version information

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