# ⚠️ REQUIRED: Update Your `.env` File ## The Problem You were using the **Client ID** (`8437ff7e3e39452294234ce23bbd105f`) as the **Omada ID**, which caused: ``` Omada login failed: Controller ID not exist. ``` ## The Solution The **real Omada ID** (omadac_id) is: `b7335e3ad40ef0df060a922dcf5abdf5` ## Update Your `.env` File Add or update these lines in your `.env`: ```env # TP-LINK Open API Credentials (keep as-is) TP_LINK_CLIENT_ID=8437ff7e3e39452294234ce23bbd105f TP_LINK_CLIENT_SECRET=f2d19e1bdcdd49adabe10f489ce09a79 TP_LINK_APPLICATION=Datacenter-Control-Complete TP_LINK_MODE=Authorization Code TP_LINK_API_BASE_URL=https://openapi.tplinkcloud.com TP_LINK_REDIRECT_URI=http://localhost:3000/callback # Omada OpenAPI Credentials (same as TP_LINK for now) OMADA_CLIENT_ID=8437ff7e3e39452294234ce23bbd105f OMADA_CLIENT_SECRET=f2d19e1bdcdd49adabe10f489ce09a79 # ⚠️ IMPORTANT: This is the REAL Omada ID (omadac_id) - NOT the Client ID! OMADA_ID=b7335e3ad40ef0df060a922dcf5abdf5 OMADA_CUSTOMER_ID=b7335e3ad40ef0df060a922dcf5abdf5 # Your Omada credentials OMADA_USERNAME=teresa@teresalopez.us OMADA_PASSWORD=L@kers2010 # Omada endpoints OMADA_NORTHBOUND_BASE=https://euw1-omada-northbound.tplinkcloud.com OMADA_CONTROLLER_BASE=https://euw1-omada-controller.tplinkcloud.com # Use password auth OMADA_AUTH_METHOD=password ``` ## Key Changes 1. **`OMADA_ID`** changed from `8437ff7e3e39452294234ce23bbd105f` → `b7335e3ad40ef0df060a922dcf5abdf5` 2. **`OMADA_CUSTOMER_ID`** added with the same value (used as `omadac_id` in login) ## What This Means - **Client ID** (`8437ff7e3e39452294234ce23bbd105f`) = Your application's ID → Used as `client_id` in login - **Omada ID** (`b7335e3ad40ef0df060a922dcf5abdf5`) = Your controller/customer ID → Used as `omadac_id` in login ## After Updating 1. Save your `.env` file 2. Restart the application: ```bash pnpm run dev ``` ## Expected Results ✅ **Success**: You should see: ``` [info]: Logging into Omada Cloud with username/password... [info]: Omada login successful [info]: Successfully logged into Omada Cloud ``` OR ✅ **Progress**: If credentials are wrong: ``` Omada login failed: Invalid username or password ``` (This means the ID is correct! Just fix username/password.) ## Verification The login URL should now be: ``` https://euw1-omada-northbound.tplinkcloud.com/openapi/authorize/login?client_id=8437ff7e3e39452294234ce23bbd105f&omadac_id=b7335e3ad40ef0df060a922dcf5abdf5 ``` Notice: - `client_id` = `8437ff7e3e39452294234ce23bbd105f` (Client ID) - `omadac_id` = `b7335e3ad40ef0df060a922dcf5abdf5` (Omada ID) ✅