suggestion: "isBatteryCharging" in System Stats?

With these devices, you can change the USB mode from "Mass Storage" to "Garmin" and actually charge the watches while in use. With the va and GPS on, you'll get something under 10hrs with GPS on (I only see a bit over 8 myself), so for long activities, some may opt for charging along the way while still in the same activity recording.

Granted, in a .prg you can keep an eye on the the battery level, and if it's going up and not down, it's being charged, but would it make sense for the charging state be passed on from the FW? (isBatteryCharing or something?) Something like on a cell phone that gives you a lightning bolt on the battery when it's being charged could then be easily done.
  • Thanks for the suggestion. :) I've created a feature request ticket to have this looked into.
  • I tried just watching the battery level to see if it was going up or down, and it works quite well. It took maybe 15 seconds to detect it was being charged, and a bit longer to detect it was removed from the charger. It also figured out when the battery was fully charged. Not as fast as cellphones do it, but still very usable! (this code runs every second or so in my test, but it'll will work if run less often.)

    //lastBattery starts with the battery level when the .prg started

    var batval=Sys.getSystemStats().battery;

    if(lastBattery<batval) {
    charging=true;
    lastBattery=batval;
    } else if(lastBattery>batval) {
    charging=false;
    lastBattery=batval;
    }
  • For grins, I tried this on a watchface today. It detects "charging" just fine, but the battery drain of a watchface is so low, that it took 15 minutes to figure out it had been removed from the charger!
  • Any update on this from the Connect IQ team?

    I had a user request a charging indicator on my watch face yesterday, so I went looking through the API docs for something like what was suggested here (isBatteryCharging). Doesn't seem to be there yet. So pretty quickly I came up with basically the same solution as jim_m_58 posted, but it has a couple of issues:

    • The lag time (as mentioned) for detecting when the watch has been removed from the charger. I could reduce this by adding logic to assume that if the battery level hasn't increased in x time (1 minute? 2 minutes?), it must no longer be charging. But this doesn't work when sitting on the charger at 100%.


    • Battery level on my Fenix3 continues to rise slightly for about 2 minutes after taking it off the charger. It rises at a slower rate, but does consistently go up about 0.18% each minute for 1-2 minutes after disconnecting. In contrast, it rises that 0.18% about every 15 seconds while charging.

    Any logic based on the above observations must assume that all watches behave mostly the same way. I have no idea if this is true, as I only have the one device to test on.

    Then in my testing I came across something that might reduce lag time to just a second or two. I noticed that while charging, the watch face is in "sleep" mode (onEnterSleep() has been called) but it still updates every second. I could test for this combination of events: if I'm in sleep mode but onUpdate() is being consistently called every second, I must be charging. Once this is no longer true, I must not be charging.

    The big question is, does this hold true for all devices? Having isBatteryCharging from Connect IQ itself would eliminate that uncertainty.
  • Actually, I am using the same basic logic I posted months ago in a few watchfaces and apps, but do have the check that if it hasn't changed in ~45 seconds, it's no longer charging (as a watchface only updates every minute, this isn't bad). Also I check not only is the battery level going up, but has it gone up more than something like 0.000015, which also helps prevent the charging status being wrong.

    The 2hz onUpdate() (on a 230 at least) while charging might work today, but may change with FW updates or differ on different devices, as it is kind of odd, in that it burns more battery than normal to display a watchface while charging! That's probably there so the default watchface can keep displaying seconds or something. Also, it's not there if you add a charging status to an app instead of a watchface.

    Oh, I did check a few months back and the "Stat.isCharging" is still being considered, but no date.
  • Any update on this from the Connect IQ team?

    The big question is, does this hold true for all devices? Having isBatteryCharging from Connect IQ itself would eliminate that uncertainty.


    This is on our list of features to add. I can't really speculate about when it will be included, but since it's not a critical feature, we'll probably fit it in when we can. :)