This guide explains how to migrate and restore the following data from the legacy LinknLink App:
- Scenes
- Linkages or automations
The data will be migrated to the following features in the new App:
- Cloud Scenes
- Cloud Automations
During the migration, Codex connects to the MCP service provided by the LinknLink App, reads the legacy data, and rebuilds it using the devices and entities available in the current family.
Legacy data is not deleted by default, so you can roll back if necessary.
1. What You Need Before Migration
Prepare the following three connection parameters:
| Parameter | Example | Where to Find It |
|---|---|---|
| IP address | 192.168.58.121 |
Check the phone’s settings page for the MCP service’s local network IP |
| Port | 39282 |
The MCP service port; the current default is 39282
|
| Token | A UUID string | LinknLink App → AI Agent settings → copy the last Token shown at the bottom of the page |
A Token usually looks like this:
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Do not use the example Token in this guide. You must copy the Token displayed in your own App.
2. Make Sure Codex and Your Phone Can Communicate
The computer running Codex must be able to reach the device running the LinknLink App.
The simplest setup is:
- Your phone and computer are connected to the same Wi-Fi network.
- Your phone has not switched to mobile data.
- Your computer is not connected to a VPN that isolates the local network.
- Your router does not have guest-network isolation or client isolation enabled.
For example:
Computer IP: 192.168.58.20
App MCP IP: 192.168.58.121
Both addresses are on the 192.168.58.x subnet, so they should usually be able to communicate directly.
If the App displays:
10.0.0.232
but the computer is using:
192.168.58.x
the two devices may be on different subnets. Codex might not be able to connect unless the router has been configured to route traffic between those subnets.
Do not enter the router IP, gateway IP, or a public IP address. You must use the MCP service IP shown on the AI Agent settings page.
3. Complete Migration Prompt for Codex
Copy the following prompt into Codex and replace the IP address, port, and Token with your own values.
Please use the MCP service provided by the LinknLink App to
migrate the legacy App’s scenes and linkages in the current family
to Cloud Scenes and Cloud Automations in the new App.
MCP connection details:
- IP: Replace this with the IP shown on the settings page
- Port: 39282
- Token: Replace this with the last Token shown at the bottom of
the AI Agent settings page
Follow this process exactly:
1. Configure LinknLink as a remote Streamable HTTP MCP Server.
2. Use the following MCP endpoint:
http://IP:PORT/mcp
3. Use the provided Token for Bearer Token authentication.
4. Run the MCP initialize handshake and read tools/list to confirm
that the connection works.
5. Read the current family information.
6. Read the complete device and Entity lists for the current family.
7. Read the capabilities and current state of every Entity required
for the migration.
8. Read the legacy scene data.
9. Read the legacy linkage or automation data.
10. Read the existing Cloud Scenes and Cloud Automations to prevent
duplicates.
11. Build mappings from legacy device DIDs, endpointIds, and legacy
scene IDs to current Entity IDs and new Cloud Scene IDs.
12. Do not copy legacy device IDs directly. Rebuild actions and
triggers using Entity IDs that actually exist in the current family.
13. Migrate Cloud Scenes first and record their new Cloud Scene IDs.
14. Then migrate Cloud Automations that reference scenes, using the
new Cloud Scene IDs. If the server expands a scene into Entity
actions, the expanded actions based on current Entities may also be used.
15. Call validate_scene for every new scene.
16. Call validate_automation for every new automation.
17. Create an item only after it passes validation.
18. Preserve the original name, time, weekdays, trigger conditions,
device actions, notification text, temperature, mode, fan speed,
and delays.
19. If a legacy device no longer exists, do not guess the mapping.
List the legacy device information and possible Entity candidates,
and explain why the item cannot be migrated safely.
20. Do not delete legacy scenes or legacy linkages.
21. Do not execute the new scenes or automations, because doing so
could control real devices.
22. After creation, read the Cloud Scenes and Cloud Automations
again and verify their counts, names, enabled states, triggers,
and actions.
23. In the final report, include:
- The number of legacy scenes found
- The number of legacy linkages found
- The number of Cloud Scenes created
- The number of Cloud Automations created
- The current Entity IDs used by each migrated item
- Any items that could not be migrated and the specific reasons
- Whether the legacy data was preserved
Perform the migration directly. Do not provide instructions only.
Do not repeat the complete Token in the final response.
After filling in the details, the beginning should look like this:
MCP connection details:
- IP: 192.168.58.121
- Port: 39282
- Token: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
4. What Codex Will Do
4.1 Establish the MCP Connection
Codex will connect to LinknLink MCP using:
http://YOUR_IP:39282/mcp
The Token will be used for authentication.
After a successful connection, Codex should identify a server similar to:
linknlink-skill-mcp-server
4.2 Read the Legacy Data
Codex will read:
- The legacy scene list
- Legacy scene details
- The legacy linkage list
- Legacy linkage details
Legacy data may contain identifiers and values such as:
sceneId
ruleid
endpointId
did
gatewayDid
IR codes
Legacy device property names
These identifiers might not work directly in the new App.
4.3 Read the Current Family’s Devices and Entities
Codex will read the Entities in the current family, for example:
light.xxxxx
climate.xxxxx
binary_sensor.xxxxx
event.xxxxx
weather.forecast_home
New scenes and automations should use these currently available Entities whenever possible.
For example, the legacy data might contain only:
did: 01385886d8828d16dc78ac9d74ceca8e
The corresponding current Entity might be:
climate.01385886d8828d16dc78ac9d74ceca8e
Codex should use the current Entity ID when creating the new data.
4.4 Create Scenes Before Automations
If a legacy linkage references a legacy scene, Codex must create the Cloud Scene first.
For example:
Legacy scene ID: 3008322404328373708
New Cloud Scene ID: 8845c067a6744467b8e073863f35cda6
The automation should then reference the new Cloud Scene ID instead of the legacy scene ID.
4.5 Validate Before Creation
Every item should be validated using:
validate_scene
or:
validate_automation
Codex should save an item only when validation returns:
valid: true
and there are no critical errors.
5. How to Verify the Migration
Open the new LinknLink App and check the following sections.
Cloud Scenes
Confirm that:
- The scene name is correct.
- The correct device is used.
- The actions are correct.
- Parameters such as temperature, operating mode, and fan speed are complete.
- The scene uses devices from the current family.
Cloud Automations
Confirm that:
- The automation name is correct.
- The automation is enabled.
- The trigger time is correct.
- The weekday settings are correct.
- Device trigger conditions are correct.
- Notification messages are correct.
- Referenced scenes are new Cloud Scenes.
- Device actions use current Entity IDs.
Do not delete the legacy data immediately. Observe the new automations for several days and confirm that they trigger correctly before deciding whether to remove the legacy records.
6. Troubleshooting
6.1 The IP Responds to Ping, but the Port Times Out
Typical errors include:
Failed to connect
Connection timed out
Check the following:
- Is the AI Agent MCP service running?
- Is the port set to
39282? - Is the App still running?
- Does the system firewall allow local network access?
- Is the MCP service listening on a local network address instead of only
127.0.0.1?
6.2 The IP Does Not Respond to Ping
Common causes include:
- The IP address is incorrect.
- The router IP was entered instead of the phone’s IP.
- The phone’s IP address has changed.
- The phone and computer are connected to different Wi-Fi networks.
- One device is connected to a guest network.
- A VPN has changed the computer’s routing.
Open the AI Agent settings page again and copy the currently displayed IP address.
6.3 MCP Connects, but the Token Is Invalid
Open the AI Agent settings page again:
- Scroll to the bottom of the page.
- Find the last Token.
- Tap the copy button again.
- Make sure the copied value does not contain spaces or line breaks.
- Provide the new Token to Codex.
6.4 Codex Reports That a Device Does Not Exist
The DID or endpointId used by the legacy App may no longer directly control the device.
Ask Codex to:
- Read the current device and Entity lists.
- Match devices using the DID, name, room, and device type.
- Query the capabilities of candidate Entities.
- Rebuild the item using the current Entity ID.
- Stop migrating that item if no unique match can be found.
Codex should never guess an uncertain device mapping.
6.5 Duplicate Data Appears After Migration
This can happen when a matching Cloud Scene or Cloud Automation already exists.
Before creating anything, Codex should:
- Read the existing cloud data.
- Compare names, triggers, and actions.
- Skip records that are already identical.
- Report items with matching names but different content instead of overwriting them automatically.
6.6 Weather Automations Cannot Be Migrated
The legacy App may use numeric weather codes, while the new App may use weather Entity states such as:
snowy
rainy
cloudy
sunny
Ask Codex to rebuild the trigger using the current weather Entity instead of copying the legacy numeric weather code directly.
7. Security Recommendations
- Treat the Token as an MCP access credential. Do not publish it in group chats, forums, or public documents.
- Do not include the complete Token in the migration report.
- If a Token has been shared publicly, regenerate it in the App after migration.
- Do not delete legacy data during the initial migration.
- Do not allow Codex to execute scenes during the initial migration. Otherwise, devices such as air conditioners, locks, or lights might be controlled unexpectedly.
- Manually review automations involving security-sensitive devices such as locks, alarm systems, and valves before enabling them.
By following this process, Codex can complete the connection, data reading, device mapping, validation, creation, and final verification in a single workflow while avoiding the unsafe practice of copying legacy device IDs directly into the new data.