Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect traction battery voltage #765

Open
Memosis opened this issue Feb 18, 2024 · 32 comments
Open

Incorrect traction battery voltage #765

Memosis opened this issue Feb 18, 2024 · 32 comments

Comments

@Memosis
Copy link

Memosis commented Feb 18, 2024

Battery voltage sensor seems to be providing invalid data for traction battery. The voltage is way lower than what is shown via OBD (e.g. now at 82% SoC OBD says 426V, this sensor shows 340V in HA) and also the voltage drops or increases irrespectively of traction battery percentage. E.g. when I charged the traction battery from 73% to 82%, voltage shown DROPPED from 346V to 340V.

I was looking for this issue here on Github and it seems this might be it? The sensor shows data from accessory 12V battery (just multiplied by some number) and not from real traction battery?

#354

image
image
image

@Memosis
Copy link
Author

Memosis commented Feb 18, 2024

My 12V battery is currently at 11.3 volts so that would mean multiplication by ~30 to get those 340V reported?
image

@p4block
Copy link

p4block commented Feb 18, 2024

This would explain lots of things. I can also replicate that the value for the battery voltage has no resemblance at all to the real voltage output by OBD

@5kat3R
Copy link

5kat3R commented Feb 19, 2024

For me this value has been percentage of the 12V battery state of charge.
Meaning that your 340V (85*4) would be 85% SOC of the 12V battery.
And this value is very useful. Few times I have noticed that for some reason the car is awake all the time and it consumes the 12V battery a lot.

@Memosis
Copy link
Author

Memosis commented Feb 19, 2024

You are right, it's 0-100% multiplied by 4. Although it's useful to (also) have voltage of 12V battery, is there a value for traction battery?
image

@Memosis
Copy link
Author

Memosis commented Feb 19, 2024

So I've renamed label for this sensor and put multiplication there (based on my OBD reading) so it shows correctly for 12V battery
image
image

@papageigit
Copy link
Contributor

What does the value return when the car is on and in ready? Do you get ~14V via API? Does your API returned voltage match the voltage measured by your OBD device?

@Memosis
Copy link
Author

Memosis commented Feb 19, 2024

That's a great question. You are right that when you turn the car on the OBD 12V shows something like 13.7V (as DC to DC convertor provides the voltage directly from the traction battery (and hopefully also slowly recharges the 12V battery from time to time)).

When I check the voltage history in my HA for the last week, it shows minimum 318 (79.5%) and maximum 348 (87%) with no sudden spikes. So it seems this reported voltage is always from the 12V battery only, ignoring OBD voltage.

image

@papageigit
Copy link
Contributor

If more people can confirm that this is actually the SoC of the LV battery, please consider creating a pull request over at https://github.com/Flodu31/HomeAssistant-PeugeotIntegration to get this changed.

Perhaps maybe someone can update the template to the modern format rather than the legacy format as well? I would do this myself but my PSACC is not functioning so I can't test.

@gerar19
Copy link

gerar19 commented Feb 23, 2024

The value that returns the api of % of the voltage, refers to the battery of 12V, not the traction, should not be multiplied by 4.

@HenningS81
Copy link
Contributor

HenningS81 commented Mar 1, 2024

Same here:
See traction battery compared to the 12V battery when driving.
image

At one point, I had to many requests to the car because of a mistake in my programming. That drained the 12 V battery to a point where the car didn't even started. The percentage of the 12 V battery showed that very well. I had an update of the BMS for the 12V battery and that eased the problem.
At the top the 12 V Battery (which I took as the traction battery voltage at that point), than the SoC of the traction battery and at the bottom the mileage.
image

You can see clearly, that the 12 V battery is charged, when the car ignition is on, as well when the traction battery is being charged (but not as fast) and the drainage because of too many requests, down to zero, where the battery had less than 8 volts.

@Memosis
Copy link
Author

Memosis commented Mar 1, 2024

"I had an update of the BMS for the 12V battery and that eased the problem."

Update performed at service center?

I am currently replacing my 12V accessory battery in e-C4. Almost 3 years old, original EFB 60 Ah, but I was using it a lot (2 cameras in parking mode, frequent checks via Home Assistant). Recently it was unable to charge above 12V. I was trying to "repair" it using standalone charger for lead acid batteris (EFB, AGM...), but it tried for 10 minutes and then gave up. Recharging from traction battery in the car was insufficient as well (after 15 minutes in READY mode while the battery has been charging with 13.6V it was able to charge the battery to 11.8 but it dropped in a minute back to 11.1 where it stays most of the time).
I asked the service to put there AGM battery with a slightly higher capacity (70 Ah), hope it fits. 🙂

@HenningS81
Copy link
Contributor

Yes, they did that update at a service center. We got our e208 May last year and the update was done 1st December, so fairly recent.

@gernot-h
Copy link
Contributor

gernot-h commented Mar 5, 2024

Can someone probably translate this from HA terms to pure psacc values for me?

We also had a discussion on the battery field in the get_vehicleinfo answer over at #755 (comment) - is this the value you're referring to here?

@gernot-h
Copy link
Contributor

gernot-h commented Mar 5, 2024

Perhaps you even want to have a look at #755 where I raised the question whether usage of -R (force data refresh by every X mins) should probably be limited or at least "safe" values (> 15 mins?) should be recommended in the help.

@HenningS81
Copy link
Contributor

I'm certain that the battery:voltage value is the SoC of the 12 V battery in %. I've read somewhere that it is the same in fuel driven Stellantis cars.
I wouldn't recommend wake up calls more often than once per hour. For my car I can say that every call leads to 0.5% drop in the SoC of the 12 V battery. But you wouldn't gain much advantage of waking the car more often aynway, maybe a higher accuracy for the temperature. Because whenever the car is active, may it be charging or driving, it sends data more frequently anyway. In case of driving exactly every two minutes.

@HenningS81
Copy link
Contributor

HenningS81 commented Mar 5, 2024

image
The graph shows the SoC of the traction battery, so this was a short drive and a charge afterwards. The colorful bar at the top shows every timestamp transmitted by Stellantis (to be exact: ["energy"][0]["updated_at"])
And I have my car woken up every hour.

@HenningS81
Copy link
Contributor

image
That's how the 12 V battery get's drained by the wakeup calls.
And because I didn't believe that my garage checked the battery and measured for leak currents. Without any findings.

@gernot-h
Copy link
Contributor

gernot-h commented Mar 6, 2024

By the way, don't know exactly how it's for BEVs, but in my Astra PHEV, there are two 12V batteries, one in the motor compartment and a much smaller one in the centre console below the armrest. I couldn't find reliable information about their work split yet, but I guess we're talking about the (larger) one in the motor compartment, which seems to be needed for starting the car (in contrast to the smaller one probably driving radio & friends), right?

@sod75
Copy link

sod75 commented Mar 6, 2024

My Peugeot PHEV also has 2x12v batteries. I only know because I had an issue and the garage told me they had to replace "One of the two 12V batteries" when asking for the root cause...

@gernot-h
Copy link
Contributor

gernot-h commented Mar 6, 2024

My Peugeot PHEV also has 2x12v batteries. I only know because I had an issue and the garage told me they had to replace "One of the two 12V batteries" when asking for the root cause...

Yes. Opel Astra L and Peugeot 308 are nearly identical "under the hood", its common best practice for Astra owners to also read the Peugeot manual as it covers some details in a much better way, e.g. the fact with the two 12V batteries. So RTFM ;-)

And you should really read the Peugeot manual here as you risk breaking some electronic parts if you (or someone in the garage...) unconnect the 12 V batteries in the wrong order (IIRC, the small one in the centre console always needs to be unconnected first before unconnecting the "main" battery in the motor compartment).

Sorry for off-topic...

@Jordan87
Copy link

Jordan87 commented Mar 11, 2024

Hi

For me indeed "Battery voltage" seems to be 12V main battery charge level. with Range 0-400 (0,25% resolution) where 400 is 100%, 0 is most probably 0% :)

Yestarday I was doing some test with disharging my 12V battery to simulate and check how car will behave if I i.e. connect my DVR Camera in parking mode with dedicated module.
When I started "Battery voltage" entity was showing value 380V which i think was 95% (real voltage on battery was 13,14V)
My main electronic load was set to stop dishachring around 11.8V, with this level "Battery voltage" was showing 200V which I think was 50%

image

image

On screen from @HenningS81 we see that when battery was "dead" it showed even 0V

edit

I just created new entity based on "Battery voltage" from psa_car_controller
`sensor:

  • platform: template
    sensors:
    battery_percentage:
    friendly_name: "Battery Percentage"
    unit_of_measurement: "%"
    value_template: "{{ states('sensor.your_battery_entity') | float / 4 }}"
    icon_template: >-
    {% set battery_level = states('sensor.your_battery_entity') | int %}
    {% if battery_level >= 90 %}
    mdi:battery
    {% elif battery_level >= 60 %}
    mdi:battery-60
    {% elif battery_level >= 30 %}
    mdi:battery-30
    {% else %}
    mdi:battery-alert
    {% endif %}`

image

@gerar19
Copy link

gerar19 commented Mar 12, 2024

@Jordan87 You do not take into account that the value you say of 400V is just a manually created sensor that is set to multiply the % of voltage that the API returns by 400.
So you don't have to take it into account.
The % of the voltage is from the 12V battery, you don't need to give it any more thought.
If you want the correct Vs, change this multiplication in your sensor in the corresponding yaml.

@Jordan87
Copy link

Ohh, you are correct, now I see that it is not directly from psacc but was created base on https://github.com/Flodu31/HomeAssistant-PeugeotIntegration
I should correct this one.
308_battery_voltage: friendly_name: "Battery Voltage" unit_of_measurement: "V" value_template: "{{ state_attr('sensor.peugeot_308', 'battery')['voltage'] * 4 }}" icon_template: mdi:flash-triangle-outline

Thanks

@Memosis
Copy link
Author

Memosis commented Mar 12, 2024

Yes, as I was showing previously. ;)
image

I will also perform new measurement with OBD and multimeter at the same time to finetune the multiplcation value. I previously had smaller 60Ah EFB battery, now I have 72Ah AGM (which should have been configured in BMS by the service center, though the reported voltage should be the same I believe)

@Jordan87
Copy link

Im sure its not about volts but % level of charge 12V battery. 400V was in my case ~13.2V but 200V was around 11,8V
With volts this cant be 50% drop.

@Memosis
Copy link
Author

Memosis commented Mar 12, 2024

When my 12V battery was just 11.1V, the reported value was ~83% ("332V" in the incorrect calculation). At 11.3V it was ~85% ("340V"). This is Citroen e-C4 and voltage I see via OBD (in Car Scanner). I will measure it with my multimeter as well to be sure.

@Jordan87
Copy link

Here you can see my graphs even with exact spots (dips in voltage) when car was woke up. 200V= 11.8V
image

@Memosis
Copy link
Author

Memosis commented Mar 13, 2024

I finally managed to measure my 12V battery in e-C4 using physical multimeter. See below my process. Notes:

  1. OBD/Car Scanner reports the voltage lower by 0.9V. Friend of mine who has also e-C4 was showing me his Car Scanner values previously and they were higher, so this might be just an issue with my OBD adapter/Car Scanner profile.
  2. I assume the reported value to Stellantis cloud is the last one measurement (with traction battery disconnected). Battery was 12.77V at that moment and cloud reported value of 93.
    Let me know your thoughts...

image

@Jordan87
Copy link

You have low battery level in your multimeter. This could cause incorrect value for voltage measurment.

It may be that you are reading different value with that OBD device (at least few ECUs in car are doing those measuments for voltage). "Smart charge" ECU is doing calculation for charge level so this is most probably a source for that value.
Maybe one day I will check it with Diagbox.

@papageigit
Copy link
Contributor

I believe the voltage reported in Car Scanner is the voltaged measured at the OBD port by the OBD tool. Cheap OBD tools could provide a reading that isn't 100% correct due to cheap measuring components.

@Memosis
Copy link
Author

Memosis commented Mar 13, 2024

You have low battery level in your multimeter

That battery icon, right. I thought it was just assuring me I measure DC (battery). :D I will replace it, thanks, though the measured 12V values seem plausible, I don't expect no significant difference. What surprised me was that OBD. If I get a chance to meet with my friend, we should try both OBD adapters/car scanners.

@Memosis
Copy link
Author

Memosis commented Mar 13, 2024

I believe the voltage reported in Car Scanner is the voltaged measured at the OBD port by the OBD tool. Cheap OBD tools could provide a reading that isn't 100% correct due to cheap measuring components.

I see. My OBD is iCar Pro. Friend of mine has much cheaper type, just for Android, go figure. :D
https://www.amazon.de/dp/B07SQLY39V/ref=pe_27091401_487024491_TE_item

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

No branches or pull requests

9 participants