Some of Kontakt.io devices have built-in features that allow them to automatically change their settings, resulting in lower power consumption when needed. These power savings come from increasing the advertising packets broadcasting interval, making beacons send their packets less often when there is no need to do this with normal frequency, e.g. at night, during non-business hours.
Enabling the Power Saving on a capable beacon via API is done the same way as changing any other setting – by creating a Config object and then syncing it with the beacon via Kontakt.io Administration App (or any other app based on our SDKs). An API call needs to specify what power saving features should be enabled and with what settings.
Power savings options are bundled in a
powerSaving object within a Config object, so power saving-related options in a HTTP request need to formatted like this:
curl -X "POST" "https://api.kontakt.io/config/create" \ -H "Api-Key: YourSuperSecretAPIKey" \ -H "Accept: application/vnd.com.kontakt+json;version=10" \ -H "Content-Type: application/x-www-form-urlencoded; charset=utf-8" \ --data-urlencode "uniqueId=Ueu1" \ --data-urlencode "deviceType=beacon" \ --data-urlencode "powerSaving.features=MOTION_DETECTION" \ --data-urlencode "powerSaving.moveSuspendTimeout=90"
In order to disable Power Saving, create a config with an empty
curl -X "POST" "https://api.kontakt.io/config/create" \ -H "Api-Key: YourSuperSecretAPIKey" \ -H "Accept: application/vnd.com.kontakt+json;version=10" \ -H "Content-Type: application/x-www-form-urlencoded; charset=utf-8" \ --data-urlencode "uniqueId=Ueu1" \ --data-urlencode "deviceType=beacon" \ --data-urlencode "powerSaving.features="
Different beacons have different capabilities, that are described below.
Card Tag CT16-2
All Card Tags CT16-2 are equipped with a motion sensor. It allows them to reduce the frequency of advertising packets e.g. when a person that wears a Card Tag CT16-2 as an employee badge is not moving.
To enable Power Saving on Card Tags CT16-2, set
features list in a new Config to
MOTION_DETECTION. Additionally it's possible to customize the time (in seconds) that needs to pass when a Card Tag CT16-2 is not registering any motion in order to trigger Power Saving mode. To do that, set
moveSuspendTimeout to a desired value between
3600. If nothing is changed, the default value of 60 seconds will be used.
Power Saving advertising rates
The value of the advertising interval in the Power Saving state depends on the original advertising interval value:
- When interval is equal or less than 1000 ms, the power saving interval equals 2000 ms
- If a beacon has an interval of more than 1000 ms, then the power saving interval will be equal to five times the normal interval, e.g. when a normal interval is 1500 ms, the power saving interval is 7500 ms (1500 ms * 5)
- Power saving interval cannot be longer than the maximum interval value (10240 ms). If a multiplication of 5 times an interval would yield a higher number, the power saving interval will be capped at 10240 ms.
Beacon Pro BP16-3
Every Beacon Pro BP16-3 comes with a Light Sensor built-in. It can be used to enable Power Saving when a light intensity drops below a certain threshold, and switch back to normal operations when the brightness come back to standard levels.
To enable Power Saving on Beacon Pros BP16-3, set
features list in a new Config to
Light Sensor configuration
There are two additional settings related to a light sensor that you can use to customize the light sensor-based Power Saving:
lightSensorThreshold– sets a brightness level (in percent) that will trigger Power Saving. Default value is 50.
lightSensorHysteresis– a buffer used to avoid frequent switches between Power Saving enabled or disabled when the raw brightness levels reported hover around threshold. It's represented by a number of percentage points that brightness need to deviate from the threshold to actually trigger a Power Saving state switch. Default value is 5.
Example: Let's assume
lightSensorThresholdis set to 50%,
lightSensorHysteresisis 2% and Power Saving is engaged (light intensity reported by a light sensor is below 50%). When the light starts becoming brighter, the Power Saving is not going to be turned off the moment the light sensor reports any value above 50%. Instead a Beacon Pro BP16-3 will wait until the measurements reaches 52% and only then disable Power Saving. If a reported brightness level later drops below 52% but stays above the switching point (that is threshold adjusted for hysteresis, but in the opposite direction), the Power Saving will stay disabled.
In order to ensure proper operations, these two settings have to follow two additional rules:
- The sum of
lightSensorHysteresishas to be equal or less than 100
- The result of subtraction of
lightSensorThresholdhas to be equal or greater than 0
Power Saving implementation on Beacon Pros BP16-3
Similarly to Card Tags CT16-2, the value of the advertising interval in the Power Saving state on Beacon Pros BP16-3 depends on their original advertising interval value, although rules are a bit simpler comparing to those of the Card Tags CT16-2 – in general Power Saving advertising interval is a normal interval multiplied by 3, with 2 exceptions:
- If a multiplied interval is below 2000 ms, the Power Saving interval will be set to 2000 ms
- If a multiplied interval is above 10240 ms, the Power Saving interval will be set to 10240 ms
There is, however, a major difference between Card Tag CT16-2 and Beacon Pro BP16-3 implementation of Power Saving – when a Beacon Pro BP16-3 goes into the Power Saving mode, it completely stops broadcasting standard, non-connectable iBeacon and Eddystone packets, leaving only the Kontakt.io packet being broadcasted at a slower rate.