There's a few different ways to know the battery level of your Kontakt.io beacons, whether you're using our app, fetching this information directly from beacons, or gathering it using our SDK.
Here's a quick overview on these:
You can check the state of your beacons' battery in the Kontakt.io Web Panel.
Simply log into your account, got to Beacons>Beacon List, select the beacon you would like to review, and on the Device information section under the General tab, you'll see the battery level displayed along the last connection date. Because beacons can't connect to our API directly, both of these represent the last time our API was reported this battery level.
If your beacon hasn't been seen by our API in a while, you might find something like this:
In order to get the latest information about your beacon, all you need to do is scan for it using our Kontakt.io management app, available for Android and iOS. If you'd like, you could integrate this into your own app using our SDK as well, please refer to our developer center to learn more or visit our GitHub repository to find code samples.
Because our Web Panel is only a front to the information available in our API, if you'd like to fetch these values directly, you can do so using our /device/status endpoint. In it, you'll receive a JSON response with a batteryLevel and lastEventTimestamp parameter indicating the level and date these were reported.
Kontakt.io Management app
To know the battery level of your beacons using our app, simply log in and scan for beacons around. Battery levels will be shown next to their firmware version on the right side column. These levels will be automatically uploaded and made available over our API as well, including those that don't belong to your account.
This is how it looks like on iOS and Android:
Other BLE scanners
It's also possible to find the battery level using any Bluetooth LE scanner, as the battery level in our beacons is included in our scan response packet, and can be read under the battery service and characteristic as a double digit hex value.
Here's how the battery service looks using Nordic's nRF app on both Android and iOS:
And this is the response packet structure, where the UUID service 0xd00d, includes four bytes for the unique ID, two for the firmware version, and one for the battery level.
In this case:
- 0x47376857 in ascii: G7hW (this particular beacon's unique ID).
- 0x3430 in ascii: 40 (in this case, firmware 4.0)
- 0x64 in decimal: 100 (battery percentage)