Module: Toybox::SensorHistory Available Data by Device?

Is there anywhere that defines how much data (how many hours and how many samples per minute) is available with Module: Toybox::SensorHistory by device?

I have tried searching for this but I cannot find anything definitive and what there is seems to to say things have changed with iterations of SDK.

The simulator is not very useful in this area as no matter what period is asked for with period => duration, the simulator just maps a simple data set to the period requested.

  • The sim isn't very good here, and it's all canned data.  You'll see at least 4hrs worth and possibly more based on the history type and device, and  less if the device hasn't been on that long.

    As far as how many samples that is, that again can vary by device and in the past was actually based on the screen width.  This is the same data used in the native widgets and say the max width for it's graph there is say 200 pixels there might be a max of 200 samples, which can also impact the time between samples.

  • On a real device, if you use "when" from two adjacent samples, you can see how often a sample is saved.

  • Thanks for the reply.  I don't have the luxury of having a selection of devices to test on.  I was hoping for some published data from Garmin so that I could understand how an app I am designing would work on devices that I don't have.

    Even if we can't have a sim which supports the device differences, some published data doesn't seem too much to ask for.

  • You can kind of figure out things in your code.  Let's say you want to display 4 hrs of data.

    That's 4*60*60 seconds = 14400 seconds. (should be safe for any history on any device)

    Then let's say the time between samples is 92 seconds (the difference between 2 adjacent "whens")

    1440/92=157 samples (rounding up)

    Then request all history.  Display the newest 157 samples.  If there are more, ignore them.

  • Fenix3 seems to be able to display 48hrs of data in it's widget.  Can I expect 48hrs of data across all devices with SensorHistory available?

  • The f3 doesn't support SensorHistory.  The f3 is CIQ 1, while SensorHistory first became available in CIQ 2

  • Sorry i just saw that the fenix3 pressure widget covered 48hrs.  Any ideas on history length on devices that do support SensorHistory?

  • As I said will support 4hrs.  After that its' based on device and user setting.

    Another option is allow for fixed number of samples and use the "when" for the newest sample and oldest sample to determine the time span.

  • Currently you can access information about the period between samples and the number of samples maintained by looking at the <sensorhistory> data in ${SDKROOT}/bin/devices.xml.

  • The simulator is not very useful in this area as no matter what period is asked for with period => duration, the simulator just maps a simple data set to the period requested.

    I'm not sure exactly what you're saying here.

    If a device is supposed to take one sample every 2 minutes and you ask for 4 minutes worth of samples, i'd expect you to get 2 samples. If this is not what happens in the simulator, then it deserves a bug report.