On 21/04/18 04:00, Robin O'Leary wrote:

I'm already polling the SOH from the BMS with more precision than is
available on 0x5b3, but that calculation needs to know the "new car" Ah
battery size to convert from the current Ah to the SOH.  Can you store the
0x5b3 SOH in a different metric (or a class variable?) to avoid clobbering
the existing SOH value.
Ah, is that in a separate branch?  I didn't see anything in the master
repository that set ms_v_bat_soh.

It's in master on line 250: https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/blob/master/vehicle/OVMS.V3/components/vehicle_nissanleaf/src/vehicle_nissanleaf.cpp#L250

Did you mean to remove the odometer code? Can you put it back and see if it
works with an odometer in miles, I've only been able to test with my km
odometers.
I can confirm that the value on the bus is always km regardless of the
displayed units preference, which I removed from the ms_v_pos_odometer
setting (the git diff got a bit confused, and shows the change as an
addition and the deletion separated by a big chunk of new code to do
with doors and drive state).

Ah, I see now. I'm glad to hear the units are always in km, I copied the approach I took from somewhere, happy leaf I think. If it's not necessary, rip it out. If we discover a car that isn't like this we can deal with it then. Can you remove the 0x355 based unit check and the m_odometer_units variable in the class definition.