Is there any way to get the temperature of the device (Venu 2) in intervals smaller than 5 minutes? I am trying to get it every minute or even 30 seconds for logging purposes....
Is there any way to get the temperature of the device (Venu 2) in intervals smaller than 5 minutes? I am trying to get it every minute or even 30 seconds for logging purposes....
Why are you doing it in the background? What app type? How do you get it now?
I have an app of type Watch App that should log the device temperature for a longer period of time (usually up to 30 minutes) during which the app can't be constantly kept open due to the device screen turning off after some time...
I am currently doing it retrospectively when the logging ends (saving Start and End timestamp using a Menu, then using SensorHistory to get the values, saving it in CSV format to a Settings property and calculating min/max) but SensorHistory only gives one value every ~5 minutes...
You mean if you read Sensor.getInfo().temperature every 30 seconds, it only ever changes in 5 minute intervals?
I currently use the sensor history to get the values after the logging ends, so no Sensor.getInfo involved as I can't keep the app running....
The values returned by the SensorHistory only have an interval of 5 minutes....
Why can't you keep the watch-app running? My app keeps running for hours.
How would I do that?
Just set a periodic timer that runs Sensor.getInfo and appends time and value to an array?
Yeah, start with that. Or even just display it + the time it was read, and then you can see if it changes when you get it out from your fridge and put it under the sun.
var sensorInfo = Sensor.getInfo(); System.println(sensorInfo.temperature);
I just tried running this in the simulator and it returned "null".
Am I so unlucky that my Venu2 doesn't support this sensor or is this just another oddity of the sim?
Try it on a real device, with some newer devices, you should see the internal temp.
Try my temps app and if you don't have a tempe sensor you'll see Sensor.getInfo().temperature.
https://apps.garmin.com/apps/17580ca9-816e-4203-a6a5-002eb543c04a
With your app, I can see the internal temperature in the top field ("internal"). Does that mean I can just run Sensor.getInfo().temperature on my real device and it will work even if it didn't work in the sim?