AWS Lambda middleware — Yealink desk phone DSS key unlocks front door via LenelS2 Elements API
Find a file
Adam Moussa b0976f94eb Add lockdown profile toggle endpoints with T58W linekey support
Add a new Lambda handler that toggles Elements lockdown profiles
(Bohemia and Ronkonkoma) via the Elements API, with status
verification before and after each toggle. Returns Yealink XML
to control linekey LEDs (green=inactive, red=locked down).

Also brings both Lambda handlers into compliance with system
standards: Node 22.x runtime, arm64 architecture, 60-day log
retention, and kebab-case function names.
2026-04-28 18:05:38 -04:00
bin Fix stack and API naming to follow kebab-case convention 2026-04-28 14:43:48 -04:00
lambda Add lockdown profile toggle endpoints with T58W linekey support 2026-04-28 18:05:38 -04:00
lib Add lockdown profile toggle endpoints with T58W linekey support 2026-04-28 18:05:38 -04:00
.gitignore Add door unlock API — Yealink DSS key triggers LenelS2 Elements TemporaryUnlock via API Gateway + Lambda 2026-04-22 14:36:55 -04:00
cdk.json Add door unlock API — Yealink DSS key triggers LenelS2 Elements TemporaryUnlock via API Gateway + Lambda 2026-04-22 14:36:55 -04:00
door-unlock-plan.md Add door unlock API — Yealink DSS key triggers LenelS2 Elements TemporaryUnlock via API Gateway + Lambda 2026-04-22 14:36:55 -04:00
package-lock.json Add lockdown profile toggle endpoints with T58W linekey support 2026-04-28 18:05:38 -04:00
package.json Bump esbuild from 0.24.2 to 0.25.0 (#1) 2026-04-28 18:04:03 -04:00
README.md Add Yealink T58W door unlock 3CX template 2026-04-27 13:08:57 -04:00
tsconfig.json Add door unlock API — Yealink DSS key triggers LenelS2 Elements TemporaryUnlock via API Gateway + Lambda 2026-04-22 14:36:55 -04:00
yealinkT54W-door-unlock-with-sp.ph.xml Apply display settings to SP template — both templates now match 2026-04-23 11:00:00 -04:00
yealinkT54W-door-unlock.ph.xml Add display settings to door-unlock template and update README 2026-04-22 20:01:09 -04:00
yealinkT58W-door-unlock.ph.xml Add lockdown profile toggle endpoints with T58W linekey support 2026-04-28 18:05:38 -04:00

Sea Haven Door Unlock API

AWS Lambda middleware that allows a Yealink T54W desk phone to unlock the front door controlled by LenelS2 Elements. Press a DSS key on the phone, and the door unlocks.

Yealink T54W → HTTPS GET → API Gateway → Lambda → LenelS2 Elements API → Door Unlocks

Architecture

  • API Gateway (HTTP API) — single GET /unlock endpoint with throttling (5 burst / 2 sustained req/sec)
  • Lambda (Node.js 20.x) — validates a shared auth token, calls the Elements TemporaryUnlock command
  • SSM Parameter Store — stores the Elements API key, auth token, and door device ID
  • Custom Domain — doorunlock.seahaven.com via Route 53 + ACM wildcard cert

SSM Parameters

Parameter Type Description
/seahaven/door-unlock/elements-api-key SecureString LenelS2 Elements API key
/seahaven/door-unlock/auth-token SecureString Shared secret embedded in the Yealink DSS key URL
/seahaven/door-unlock/door-id String Elements device ID for the front door reader

Deployment

npm install
npx cdk deploy

Phone Configuration

Configure a DSS key on the Yealink T54W (via phone web UI or 3CX):

  • Type: URL
  • Label: Unlock Door
  • Value: https://doorunlock.seahaven.com/unlock?token=<auth-token-value>

3CX Provisioning Templates

Custom 3CX templates are included with the door unlock URL hardcoded on line key 2.

Template Model Line Key 2 Keys 3+ Display
yealinkT54W-door-unlock.ph.xml T54W Unlock Door Managed by 3CX BLF Dim after 5 min, never sleep
yealinkT54W-door-unlock-with-sp.ph.xml T54W Unlock Door Shared Parking SP1-3 Dim after 5 min, never sleep
yealinkT58W-door-unlock.ph.xml T58W Unlock Door Managed by 3CX BLF Default T58W display settings