igloo
Docs / igloohome / Concepts / AlgoPIN Codes

AlgoPIN Codes

AlgoPIN generates valid PIN codes for a lock without WiFi, cellular, or remote access to the lock.

How It Works

sequenceDiagram Note over Your Server, Our Server: igloohome API Your Server->>Our Server: Request AlgoPIN Our Server-->>Your Server: AlgoPIN code Your Server->>Guest: AlgoPIN code Guest->>Lock: Enter AlgoPIN code Lock->>Lock: Unlock

Types of AlgoPIN Codes

Type Validity Variances API
One-Time (OTP) Single use 10 Create a One-Time AlgoPIN
Permanent No end date 10 Create a Permanent AlgoPIN
Duration (Hourly) 1 to 672 hours 3 Create an Hourly AlgoPIN
Duration (Daily) 29 to 367 days 3 Create a Daily AlgoPIN
Passage 1 to 12 hours 1 Create a Passage AlgoPIN

A Passage AlgoPIN unlocks the lock and keeps it unlocked for the chosen number of hours. Passage requires newer lock firmware.

Activation

AlgoPIN codes valid for more than 24 hours need activation on the lock. The first time the code is used on the lock, it is activated. That first use must happen within the 24-hour activation window, which starts when the code's validity starts.

The example below uses a code valid from 00:00, 1 Oct to 00:00, 5 Oct. The activation window is the first 24 hours of validity, from 00:00, 1 Oct to 00:00, 2 Oct. The timelines are not drawn to scale.

Code validity The code is valid from 00:00 on 1 Oct to 00:00 on 5 Oct. The first 24 hours form the activation window. Code validity AlgoPIN code validity 24-hour window 00:00, 1 Oct 00:00, 2 Oct 00:00, 3 Oct 00:00, 5 Oct

First use within the activation window. The code is activated, unlocks the lock, and stays valid until 00:00, 5 Oct.

First use within the window The code is used for the first time inside the 24-hour window. The lock unlocks and the code is activated. First use within the window AlgoPIN code validity 24-hour window Used here Unlocks. Activated until 5 Oct. 00:00, 1 Oct 00:00, 5 Oct

First use after the activation window. The code was not activated in the window. The lock does not unlock, even though the code is still within its validity period.

First use after the window The code is used for the first time after the 24-hour window. The lock does not unlock because the code was not activated. First use after the window AlgoPIN code validity 24-hour window Used here Does not unlock. Not activated. 00:00, 1 Oct 00:00, 5 Oct

AlgoPIN Limitations

Limitation Explanation
AlgoPIN-supported devices only The device has to support AlgoPIN. See Supported Devices.
Paired devices Pair the device with the igloohome app first.
24-hour activation AlgoPIN codes valid for more than 24 hours need activation on the lock. The first use must be within the first 24 hours of validity. See Activation.
256 rule You can't delete an AlgoPIN whose start date is more than 256 hours after its creation.
199 rule The lock's whitelist and blacklist hold at most 199 PIN codes in total (AlgoPIN and Bluetooth PIN codes).
PINs per duration For one duration, you can generate only as many PINs as the type's variances.

Variance: Multiple AlgoPIN Codes for the Same Duration

For a given duration, each variance returns a different PIN code. The Types table above lists the number of variances per type.

One-Time and Permanent support 10 variances on locks with newer firmware. Some older locks gain this with a firmware update; others support 5.

Example of hourly PIN codes for one lock, three variances each:

Start time End time PIN codes (variance 1, 2, 3) deviceId
2PM 3PM 511093918, 945844647, 052368115 IGB403fe3b9d
2PM 4PM 633654730, 437755350, 337288611 IGB403fe3b9d
3PM 5PM 297248165, 196981787, 384522901 IGB403fe3b9d
3PM 5PM 948950871, 142404925, 817840781 IGP114cde456

The following request returns a unique PIN code (e.g. 4642226):

curl --request POST \
  --url https://api.igloohome.co/home/devices/IGP101abc123/algopin/onetime \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer abcdef' \
  --data '{
  "variance": 1,
  "startDate": "2022-01-01T00:00:00+08:00",
  "accessName": "Maintenance guy"
}'

Changing the variance returns a second unique PIN code (e.g. 1419472) for the same duration:

curl --request POST \
  --url https://api.igloohome.co/home/devices/IGP101abc123/algopin/onetime \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer abcdef' \
  --data '{
  "variance": 2,
  "startDate": "2022-01-01T00:00:00+08:00",
  "accessName": "Maintenance guy 2"
}'