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" ) ] );
  • 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" ) ] );


    This is normal behavior. It certainly is not a bug in the SDK. CIQ simply delivers the value that's given by the system.
    Battery level is usually derived from the voltage being delivered by the battery (I assume this is how Garmin does this). When using the battery, this value slowly decreases. It's normal to get a value of 98 or 99 percent when the battery is fully charged.
  • One thing I do, is to make sure it rounds up. Soon after leaving the charger the battery level will be 9.999999 for example, and would show as 99%.

    What I do is this (using your code):

    var pwr = stats.battery+.5;
  • This is normal behavior. It certainly is not a bug in the SDK. CIQ simply delivers the value that's given by the system.
    Battery level is usually derived from the voltage being delivered by the battery (I assume this is how Garmin does this). When using the battery, this value slowly decreases. It's normal to get a value of 98 or 99 percent when the battery is fully charged.


    I disagree. I don't have a single other device, including my Edge 500, that drops from 100% to a lower number immediately upon removing from the charger. You may not want to call it a bug, but I'd certainly call it a flaw.

    I ran an experiment this morning -- I plugged the watch into my car charger, which doesn't (obviously) present a data connect, and therefore doesn't cause the watch to flip into the Garmin supplied charging screen. So my watch face was still running and updating (once per minute). While plugged in, my charge % reached 99% for one update cycle, then dropped to 98% (still on charger) and remained at 98%. I then unplugged it and plugged it into my laptop, forcing the Garmin charge face to appear, which read 100%.

    This it nit-picky, for sure. But it is clear to me that the Garmin charging face isn't using the same mechanism available to us as developers to report on the current battery charge level. This makes it appear to normal users as though there is a bug in my (and other developer's) watch faces.

    Thanks,
    Ron
  • One thing I do, is to make sure it rounds up. Soon after leaving the charger the battery level will be 9.999999 for example, and would show as 99%.

    What I do is this (using your code):

    var pwr = stats.battery+.5;


    Reasonable suggestion -- 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.

    Which reminds me, there is most definitely a bug in the SDK docs, which say that battery will be a value between 0.0 and 1.0. Again, both in the simulator and on my device, the value is 0.0-100.0 (have only seen 100.0 on the simulator, never the device).

    Thanks,
    Ron
  • yes same problem, always 98% on the watch and 100% on the simulator (on FR 230)... :-/
  • This it nit-picky, for sure. But it is clear to me that the Garmin charging face isn't using the same mechanism available to us as developers to report on the current battery charge level. This makes it appear to normal users as though there is a bug in my (and other developer's) watch faces.

    Thanks,
    Ron


    I use getSystemStats().battery in my Battery Gauge widget, and the widget shows 100% when my fenix 3 is fully charged.
    I Did a test yesterday, charged the watch untiil Garmin's charge screen showed 100%.

    After full charge:


    About 15 minutes later:


    So on my fenix 3 there is no difference between the charging screen and what I read from getSystemStats().battery

    -Torstein
  • I use getSystemStats().battery in my Battery Gauge widget, and the widget shows 100% when my fenix 3 is fully charged.
    I Did a test yesterday, charged the watch untiil Garmin's charge screen showed 100%.

    <snip>
    So on my fenix 3 there is no difference between the charging screen and what I read from getSystemStats().battery

    -Torstein


    Thanks Torstein, that helps at least perhaps narrow it to the FR235.

    Installed the beta 3.13 firmware last night, and was testing this morning. No real change. I did notice because I was looking at the watch at the time that when the Garmin charge screen reached 96% it suddenly jumped to 100% charged. I waited a couple minutes longer, then unplugged, and my watch face reported 96%.

    This is definitely either a firmware flaw or a problem with the battery in my device. Will try and figure out where to file a defect report with Garmin.

    Thanks,
    Ron
  • Former Member
    Former Member over 9 years ago
    This is not an issue with your battery.

    I'm confident this is something the device firmware is doing, and it may be doing exactly what it is designed to do, but I will bring this thread to the device team's attention so they can investigate the behavior.
  • Thanks Torstein, that helps at least perhaps narrow it to the FR235.

    Installed the beta 3.13 firmware last night, and was testing this morning. No real change. I did notice because I was looking at the watch at the time that when the Garmin charge screen reached 96% it suddenly jumped to 100% charged. I waited a couple minutes longer, then unplugged, and my watch face reported 96%.

    This is definitely either a firmware flaw or a problem with the battery in my device. Will try and figure out where to file a defect report with Garmin.

    Thanks,
    Ron


    On a 230, I'll see 100% when charging and sometimes a drop to 99 or 98 when I remove it. (I usually don't pay that much attention when it's charged to 100% and I disconnect it) I don't think you have a HW problem, and might just be a difference in how it's calculated by the fw when charging and what is given to CIQ when not. Maybe when charging it's looking at current, but when not, it's watching the voltage or something.
  • I'm fairly sure I remember the vivoactive doing something similar, but this was brought up quite a while ago. I'll see if I can dig up the info.