How to map battery values coming from my EV to real value

Hi there, I have a little challenge here. My Nissan Leaf EV car is showing it’s charge value as percentage value, which I have in home assistant via a the Leaf integration.

The problem is, that the shown value in the car (and HA) is off from the real value. I have an app which reads the real battery state directly via ODB from the car. Watching the real battery state from 100% to empty and the battery state in the car display shows some “floating”. I assume it’s a marketing thing. The profile is something like this:

real value → shown value
95% → 100%
80% → 90%
60% → 50%
30% → 20%
15% → 5%

Since it’s hard to integrate the values from the app into HA, I would like to correct the values somehow. So I’m able to create something like a “mapping table” from 100 to 0, but could I integrate this in HA in an elegant way?

You can use this:

1 Like