githubEdit

Creating Ultraloq Access Codes

Create and manage access codes for Ultraloq locks

This guide explains how to create and manage access codes for Ultraloq locks using the Seam API.


Overview

Ultraloq locks support two types of access codes:

  • Permanent access codes — Codes without start or end times that work indefinitely

  • Time-bound access codes — Codes that automatically activate and deactivate at specific times

circle-exclamation

Before You Begin

To create access codes for an Ultraloq device:

  1. Your Ultraloq device must be connected to Seam

  2. For time-bound access codes only: Device timezone must be configured

  3. Device must have can_program_online_access_codes: true


Creating Permanent Access Codes

Permanent access codes work indefinitely until you delete them. They do not require timezone configuration.


Creating Time-Bound Access Codes

Time-bound access codes automatically activate and deactivate at specified times. They require timezone configuration.

circle-exclamation

How Time Zone Conversion Works

When you create a time-bound access code:

  1. You provide: UTC timestamps (starts_at and ends_at)

  2. Seam converts: UTC → Device local time using the configured timezone

  3. Ultraloq schedules: Code activation/deactivation in device's local time

  4. Seam stores: UTC timestamps for consistent time representation

Example:


Access Code Requirements

Code Format

Ultraloq access codes must be:

  • Numeric only — Only digits 0-9

  • 4-8 characters long — Examples: "1234", "567890", "12345678"

circle-info

Auto-generated codes: If you omit the code parameter, Seam automatically generates a random 4-8 digit numeric code.

Valid Examples

Invalid Examples


Checking Device Readiness

Before creating time-bound access codes, verify that the device's timezone is configured:


Disabled Access Codes

Users can disable access codes through the Ultraloq mobile app. When this happens, Seam detects the change and adds a warning to the access code.

Detecting Disabled Codes

circle-info

Resolution: The user must re-enable the code in the Ultraloq mobile app. Seam cannot programmatically re-enable disabled codes. Once re-enabled in the app, Seam will automatically detect the change and clear the warning.


Validation and Error Handling

Time-Bound Code Without Timezone

If you attempt to create a time-bound code without configuring the device's timezone:

Solution: Configure the device's timezone first using /devices/report_provider_metadata. See Configuring Ultraloq Device Timezones.

Invalid Code Format

If you provide a code that doesn't meet the 4-8 digit numeric requirement:

Solution: Use only numeric digits (0-9) and ensure the code is 4-8 characters long.

Missing Time Bounds

If you provide only starts_at or only ends_at:

Solution: Either provide both starts_at and ends_at, or omit both for a permanent code.

Invalid Time Ordering

If ends_at is before starts_at:

Solution: Ensure starts_at comes before ends_at.


Best Practices

1. Use Auto-Generated Codes

For better security, let Seam generate random codes instead of using predictable patterns:

2. Check Timezone Before Creating Time-Bound Codes

Always verify timezone configuration before attempting to create time-bound codes:

3. Monitor Access Code Warnings

Regularly check access code warnings to detect disabled codes:

4. Use UTC Timestamps

Always provide timestamps in UTC (ISO 8601 format with 'Z' suffix):


Troubleshooting

Code Not Appearing on Device

If an access code doesn't appear on the physical device:

  1. Verify the code status is set (not setting or unset)

  2. Check for warnings on the access code

  3. Ensure the device is online and connected to Wi-Fi

  4. Wait a few minutes for synchronization

Time-Bound Code Activates at Wrong Time

If a time-bound code activates at an unexpected time:

  1. Verify the device's timezone is correctly configured

  2. Check device.properties.ultraloq_metadata.time_zone

  3. Ensure you provided UTC timestamps (with 'Z' suffix)

  4. Recalculate the local time conversion to verify correctness

Code Validation Errors

If you receive validation errors when creating codes:

  1. Invalid format: Ensure code is 4-8 numeric digits

  2. Timezone required: Configure device timezone for time-bound codes

  3. Missing time bounds: Provide both starts_at and ends_at, or neither

  4. Invalid ordering: Ensure starts_at is before ends_at


API Reference

For complete API documentation, see:


Next Steps


Last updated

Was this helpful?