Set Up Bulk Room Access Mapping
Quick Setup
Most hotels can test a small room range in 5 to 10 minutes. Run a dry run first.
Use these scripts when you need to map many rooms at once for keycard encoders or smart locks.
Quick reference
| Script | What it does | Best for |
|---|---|---|
scripts/bulk-keycard-room-mapping.mjs | Creates or updates keycard encoder room mappings | Encoder room names follow a clear pattern |
scripts/bulk-smart-lock-room-mapping.mjs | Creates or updates smart lock room mappings | Locks are named or assigned in bulk |
Before you start
Confirm these items first:
- You can log in with merchant credentials
- You know the target merchant ID
- Your env file includes
TEST_MERCHANT_ID,TEST_USERNAME, andTEST_PASSWORD - You are running the command from the repository root
Load your environment
Set your env file before running the scripts:
set -a
source packages/e2e-tests/.env.production-cloudbeds
set +a
If your env file has a different name, change the path.
Step 1: Test a small range
- Run a dry run for a small room range.
- Review the output carefully.
- Confirm the room names match the rooms you expect.
Keycard encoder example
node scripts/bulk-keycard-room-mapping.mjs \
--merchant-id "$TEST_MERCHANT_ID" \
--username "$TEST_USERNAME" \
--password "$TEST_PASSWORD" \
--room-name-pattern 'TES({n})' \
--start 10 \
--end 20 \
--dry-run
Smart lock example
node scripts/bulk-smart-lock-room-mapping.mjs \
--merchant-id "$TEST_MERCHANT_ID" \
--username "$TEST_USERNAME" \
--password "$TEST_PASSWORD" \
--vendor igloohome \
--room-name-pattern 'TES({n})' \
--lock-id 'IGB40903c5f5' \
--start 1 \
--end 5 \
--allow-assigned-elsewhere \
--dry-run
Step 2: Run the real mapping
- Remove
--dry-run. - Keep the same room range.
- Run the command again.
Use --update-existing if you need to correct existing mappings.
Keycard encoders
Use scripts/bulk-keycard-room-mapping.mjs when encoder room names follow a predictable pattern.
What it does
- Resolves PMS rooms from
/api/rooms - Creates or updates
/api/keycard-encoder-room-mapping - Generates
encoderRoomNamefrom the room number
Example
node scripts/bulk-keycard-room-mapping.mjs \
--merchant-id "$TEST_MERCHANT_ID" \
--username "$TEST_USERNAME" \
--password "$TEST_PASSWORD" \
--room-name-pattern 'TES({n})' \
--start 10 \
--end 300
Smart locks
Use scripts/bulk-smart-lock-room-mapping.mjs when you need to map many rooms to smart locks.
What it does
- Resolves PMS rooms from
/api/rooms - Loads devices from
/api/integrations/devices?vendor=... - Checks existing mappings from
/api/mappings/room-lock - Sends bridge metadata when the selected lock provides it
Common modes
- Use one fixed lock across many rooms.
- Match locks by device name.
- Match locks by lock ID pattern.
Example
node scripts/bulk-smart-lock-room-mapping.mjs \
--merchant-id "$TEST_MERCHANT_ID" \
--username "$TEST_USERNAME" \
--password "$TEST_PASSWORD" \
--vendor igloohome \
--room-name-pattern 'TES({n})' \
--device-name-pattern 'TES({n})' \
--start 1 \
--end 20 \
--dry-run
Troubleshooting
What you see: The dry run shows the wrong rooms
Fix:
- Check your
--room-name-pattern. - Confirm your
--startand--endvalues. - Run the dry run again.
What you see: A room already has a different mapping
Fix:
- Confirm the new mapping is correct.
- Rerun with
--update-existing. - Verify the room in the UI.
What you see: A lock is already assigned elsewhere
Fix:
- Confirm reuse is intentional.
- Add
--allow-assigned-elsewhereonly for shared locks. - Rerun the script.
What you see: No rooms appear
Fix:
- Confirm PMS rooms load in AVA.
- Refresh the page.
- Check the merchant ID and credentials.
Still Stuck?
Contact success@vouch-technologies.com if:
- ❌ The script keeps failing after a dry run
- ❌ Mappings save but do not appear in AVA
- ❌ You are unsure which mapping mode fits your property
Helpful to include:
- Screenshot of the command output
- Merchant ID
- Vendor name and lock model
- Time the issue started