Skip to main content
Up and Coming
December 17, 2015

[Gear VR] Using OVRPlugin.batteryTemperature

Is there any documentation available for OVRPlugin.batteryTemperature? I'm curious about how we can use it to identify when the phone is at risk of triggering a heat warning.

Specifically, it'd be great to know:
  • at what temperature a heat warning is triggered (even if different per-device)

  • What format batteryTemperature returns in

  • What margin of error we can expect from the reading, if any


This would enable us to do things like detect if players are on the verge of overheating when they start our games, so we can display a message suggesting they let their phone cool down a bit before getting started so their gameplay isn't interrupted by a heat warning.
    This topic has been closed for replies.

    7 replies

    Inspiring
    December 17, 2015
    We have a Unity sample scene in our SDKExamples, "Menu_Sample", which uses OVRPlugin.batteryTemperature to populate a battery gui element. Can you take a look there and see if that's what you need?
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    HoldenTBAuthor
    Up and Coming
    December 18, 2015
    Thanks for that - I had missed the separate examples project. It looks like there's a range for animating hot and cold there, but I'm not sure if those are the hard limits?

    // 30 degrees C == green/cool, 45 degrees C == red/hot


    Presumably at 45 degrees, it's already overheated? I'm wondering about the precise temperature it has to hit in order to trigger a heat warning.
    Inspiring
    December 18, 2015
    I would suggest showing a warning message if the value reaches 42 degrees. Not sure how accurate the measurement is, but it seems to be well-damped and closely correlated to throttling events. BTW, OVRPlugin is not a public documented interface. Please use OVRManager.instance.batteryTemperature instead.
    HoldenTBAuthor
    Up and Coming
    December 18, 2015
    "vrdaveb" wrote:
    I would suggest showing a warning message if the value reaches 42 degrees. Not sure how accurate the measurement is, but it seems to be well-damped and closely correlated to throttling events. BTW, OVRPlugin is not a public documented interface. Please use OVRManager.instance.batteryTemperature instead.


    Thanks! I'll give this a try.
    New Participant
    October 26, 2016
    Old thread but my question is directly related (anyone interested would likely be doing a search on OVRManager.batteryTemperature).

    I'm assuming from the advice given that (1) the readout is in Celsius and (2) the built-in warning kicks in some time after the battery reaches 42. The reason I ask is that:

    (1) the readings I'm getting range start at about 290 on a Note 4 and 310 on an S7. To make sure it's not me, I ran the SDKSamples Menu_Test scene and the readout stretched across the screen (obviously since the expected range was 30-45). Is it now 10X?

    (2) I'm getting cutouts at about 391. Assuming 10X, that's way below the 42 you suggested.
    Like the OP, I'm trying to preempt the warning and subsequent cutout. Any guidance here would be appreciated.
    Inspiring
    October 26, 2016
    (1) I can't reproduce this with an recent version. Note that VRAPI reports the battery temperature as an int in tenths of a degree celsius, but Unity turns it into a float in plain degrees. If you are using Unity 5.3.6 or newer, this should work as expected.

    (2) Unfortunately, Samsung may have changed the throttling heuristic to kick in earlier. It isn't strictly based on battery temperature and there isn't an easy way to detect that it's about to kick in. You may need to reduce your warning threshold to 37 or so.
    New Participant
    October 27, 2016
    OK, thanks for the quick response.

    So it is 10X in C.

    I also do a shell call requesting CPU temp that when converted (/1000) is more or less the same as the battery temp, so I'm not sure if it's really CPU.

    Hopefully whatever reading Samsung does on the hardware is available via the Android Sensor API. There doesn't seem to be an overheating warning callback or anything like that.