I have read the documentation and wonder if this is what I am looking for, probably since I do not understand this 100% yet.
I don’t want to change any of the voltage values, but basically have the percentages adapt to the non linear curve.
At the moment I am reading the SOC through a Shelly UNI (sensor.solarbattery_soc_adc). This sensor shouldn’t change, but the percentage sensor (sensor.solarbattery_soc_percent) should.
Yes. It goes in your configuration.yaml file (not your sensors.yaml file) and you probably want to specify a degree of 6 instead of the default 1 (which will try to fit a straight line).
yes, I am doing all this in my configuration.yaml.
However, if I validate the yaml I am receiving errors so I didn’t apply any of these settings yet. Playing around with this in Templating does produce anything.
Do I need to attach the compensate statement somehow with the sensor definition? As I have it right now the code doesn’t work and the documentation isn’t clear about this too.
edit: changed degree to 5, since 6 gave me values above 100%, although the measured voltage was below 27V. Not sure if this has en effect, but for now the values make sense.
I would love to develop a better SoC calculation.
Defining SoC from the battery voltage curve is not ideal, and I would prefer using a similar method as what Coulombmeter are using.
Using the actual battery bank capacity in Ah, define a Wh capacity (easy part), and monitor the Charge/Discharge Amps versus Voltage to define what’s actually left. Way more accurate and reliable.
I’ll start to work on that, maybe using Node-RED… I will post an update if I am successful!
FYI: You will need to take charge/discharge efficiency into account for that to be true. You never get as much out as you put in. It’s about 95% for Li and 80% for Pb. It will change as the battery ages though.
This is why your laptop has to do a full charge / discharge cycle every so often for calibration.