Questions about battery information in 'diagnostics'

I have an Electron out in the field on solar power. It’s currently nighttime so it should be running off the battery but the diagnostics event that’s just come in has this:

  "battery": {
    "charge": 64.39,
    "state": "discharging"
  "source": "unknown"

The other values I’ve seen are VIN and USB host. Does unknown mean it’s running off battery?

The other weirdness I’ve noticed is that I also send the current battery ‘SoC’ and voltage in my metrics and the value I’m getting from FuelGauge::getSoC() is 54.7. Is there a reason diagnostics is returning a different value?

Another observation is that when diagnostics event shows 100%, it is around 85% with FuelGauge::getSoC(). That’s usually the max charge level of the battery if you don’t change default configuration for max charging voltage via PMIC functions . Could that mean that diagnostics is using its own value mapping?

Interesting to note that 54.7:64.39 is (with rounding) the same ratio as 85:100. So maybe as @jaafar suggests Particle is always scaling up by some factor.

If you search the forum here I think you will find that Particle set the max charge to 85% out of an abundance of caution for overcharging problems. This is changeable by users but the burden of ensuring safety then becomes yours.