getSystemStats().battery

Hello. I have a FR235 and have developed a watch face for it (Step Light in the Connect IQ Store: https://apps.garmin.com/en-US/apps/d7a0893b-6ed0-46c6-a5d2-a5983c77c897).

The watch face displays the battery charge as a numerical percentage, using the code below.

I see something odd: When I plug the watch in to charge, and it switches to the built-in charging screen and it reaches 100%, then remove the watch from the charger my watch face never displays more than 98%, and most often only shows 97%. If I immediately put the charger back on it, the built-in charging screen again shows 100%. Unplug it and my watch face shows 97% (or 98%). The simulator shows whatever value I set via the simulator settings, so I am pretty sure the code works.

Has anyone experienced this? Is it a bug in SDK? A faulty battery in my watch? Thanks for any insights you can provide...

var stats = Sys.getSystemStats();
var pwr = stats.battery;
var batStr = Lang.format( "$1$%", [ pwr.format( "%2d" ) ] );
  • I found it. This is in relation to the vivoactive, but I wonder if we do the same thing on the FR230/235.

    After the battery charges to 100%, the battery charger will disable itself (while the unit is still on the charger) and the battery will very slowly discharge until it hits a hysteresis threshold (which I believe is around 96% charge) and then kick back on. This is intentional as it will extend the life of the battery if someone leaves their unit on the charger for a long time. So the idea is if a customer throws the unit on the charger overnight and wakes up and sees 97% on the charge page, they may wonder why the unit did not fully charge and think the unit is faulty. So we artificially ‘lock’ the charge indicator on the charge page to 100% (once the unit reached full charge) to indicate to the user the unit is topped off.
  • 1891

    I have a strange problem with the battery status.

    On my watchface the battery always is 1% lower that the level shown in the settings.
    This is the code
    var stats = Sys.getSystemStats();
    var pwr = stats.battery;


    Maybe I can us var pwr = stats.battery + 1; but there must be a reason for this problem.

    Anyone has an idea?

    Thank you
  • What you may want to try is adding 0.5 to "round up"

    If the battery level is 75.999999, and you show the integer part it would show 75% even though it's almost 76%, but by rounding up, it would be 76.499999, and show as 76%. but if it was 75.499999, adding .5 to it would still display 75%
  • It seems to work with adding +0.5

    Thank You!
  • Based on this review, 0.5 won't cut it for this user, will it?

    The face is great! However, the battery signal stuck at 98% all the time. The original face shows 100% charged, switch to this one, decrease 2% to 98% immediately
  • Hermo - that seems to be something with the 23x/630 that I still don't understand (maybe how the value is determined - charging current vs voltage level or something?). In the time I've had a 230, I think I saw a CIQ WF display 100% only one time.
  • Just want to know what you guys do with regarding to displaying the battery percentage as a whole number.

    Do you take the ceiling of the double value: 0.2 becomes 1
    or
    Do you round it: 0.2 becomes 0

    I was thinking that from a whole number point of view, 0.2 isn't exactly 0, so it should be displayed as 1.

    Just want to hear your thoughts?

    For me the following code should do the ceiling:

    var batteryLevel = 0.2;
    var ceil = batteryLevel > batteryLevel.toNumber() ? (batteryLevel + 1).toNumber() : batteryLevel.toNumber();


    I am a bit concerned about the performance penalty this code might add. I am trying to keep performance as high as possible and don't want to add unnecessary calculations.
  • I round it. My reasoning is that it is better to show a battery value a little bit too low rather than too high.
  • I round it. My reasoning is that it is better to show a battery value a little bit too low rather than too high.


    Quite the opposite in my opinion....lots of users report discrepencies between CIQ watch face batteries compared to native faces. And when rounding, it almost always differ and is lower than what the users perceive to be the correct reading, namely that of the native watch.
  • hi,

    however, for my FR235, while the value is a double, it's never returned anything but whole integers for me, i.e. 10.00, 35.00, 98.00, etc.

    i have same problem.
    battery is not a float ? or i do error ?

    thanks for your help