Hi mark,


This should definitely be done in the module.
yes, of course, best it is done in the module.


One suggestion: can we store the smallest seen raw SOC value > 0, and the largest seen raw SOC value, and default these to 13524 (64400*0.21) and 56028 (64400*0.87) at start up.
Yes and No!
The lowest usable SOC IS (!) 21%. When the RE comes in, it COULD be that the SOC falls to 17-18%. But the RE charge the Batterie to SOC 21%. This means that you normaly dont have this SOC for a long time.
And the highest usable SOC IS 87%. Above this is never shown anywhere. It is of course usable.
I think we cut the SOC at 21 and 87%.

Like this:
v = (can_databuffer[1]+(unsigned int) can_databuffer[0] << 8);
if ((v<soc_smallest)&&(v>0)) v=soc_smallest;
if (v>soc_largest) v=soc_largest;
car_SOC = (char)((v-soc_smallest)/((soc_largest-soc_smallest)/100));

Here is a Pic with a SOC 17% shown as -4 in my mod iPhone App: