Skip to main content

Scenario Synchronization with Equipment

Synchronization is the step that allows you to transfer your scenarios from the database to the Logic Controller equipment. This is an essential step for your automations to be actually executed.

Synchronization Principle

Scenarios exist in two distinct locations:

  1. Database (DB): Where you create and modify your scenarios via the web interface
  2. Logic Controller Equipment: Where scenarios are stored and executed in real-time
Important

A scenario saved in the database will NOT be executed until it has been synchronized with the equipment.

Accessing Synchronization

Prerequisites

Before you can synchronize, make sure that:

  • ✅ The equipment is online (status "online")
  • ✅ You have at least one scenario created in the database
  • ✅ You have the necessary permissions (Premium or Demo subscription)

Opening the Synchronization Modal

  1. Access the "Scenario" tab of your equipment
  2. At the top right, click the "Synchronize with equipment" button
  3. The synchronization modal opens and automatically loads the scenario states
Equipment Offline

If the equipment is offline or you have no scenarios, the button will be disabled (grayed out).

Automatic Loading

As soon as the modal opens, the system:

  1. 📡 Sends a LIST command to the equipment
  2. ⏱️ Waits for the equipment response (8 second timeout)
  3. 🔍 Compares database scenarios with equipment scenarios
  4. 📊 Displays results with possible actions

Synchronization States

Each scenario in the modal displays a clear visual state:

✅ Synchronized

  • Badge: Green "Synchronized" badge with ✓ icon
  • Left border: Green
  • Meaning: The scenario is identical in the database and equipment
  • Condition: lastSyncAt exists and updatedAtlastSyncAt and active/inactive status matches
  • Available action: Delete from equipment

⚠️ To Update

  • Badge: Orange "To update" badge with ⚠ icon
  • Left border: Orange/Yellow
  • Meaning: The scenario exists in both but has been modified in the database
  • Condition:
    • Either lastSyncAt is null (never synchronized)
    • Or updatedAt > lastSyncAt (modified since last sync)
    • Or active/inactive status has changed
  • Available actions:
    • Update in equipment
    • Delete from equipment

❌ Not Synchronized

  • Badge: Gray "Not synchronized" badge with ✗ icon
  • Left border: Gray
  • Meaning: The scenario exists only in the database, not in the equipment
  • Condition: No matching scenario found in the equipment
  • Available action: Add to equipment

🚨 Orphan Scenario

  • Badge: Red "Not referenced" badge with ? icon
  • Left border: Red
  • Background: Slightly transparent red
  • Meaning: The scenario exists in the equipment but not in the database
  • Possible cause:
    • Scenario deleted from database but not yet from equipment
    • Database reset
    • Scenario created directly on equipment (rare case)
  • Available action: Delete from equipment

"To Sync" Badge in List

In the "Scenario" tab (list view), each scenario card displays an orange "To sync" badge if:

  • The scenario has never been synchronized (lastSyncAt is null)
  • The scenario was modified after the last synchronization (updatedAt > lastSyncAt)

This badge allows you to quickly see which scenarios need synchronization without opening the modal.

Synchronization Actions

Add to Equipment

When to use: For a scenario that exists only in the database

Process:

  1. Click on "Add to equipment"
  2. An info toast displays: "Adding scenario [name] in progress..."
  3. The scenario is converted to equipment format
  4. Published to server on channel {MAC}/SCENARIO
  5. Wait 1.5 seconds for confirmation
  6. Update lastSyncAt in database
  7. Success toast: "Scenario [name] added to equipment"
Tip

After creating a new scenario, remember to add it to the equipment for it to be operational.

Update in Equipment

When to use: For a scenario that has been modified in the database

Process:

  1. Click on "Update"
  2. An info toast displays: "Updating scenario [name] in progress..."
  3. The updated scenario is converted to equipment format
  4. Published to server on channel {MAC}/SCENARIO (overwrites the old one)
  5. Wait 1.5 seconds
  6. Update lastSyncAt in database
  7. Success toast: "Scenario [name] updated in equipment"
Status Update

If you activate or deactivate a scenario, it also triggers a "To update" state because the active/inactive status must be synchronized with the equipment.

Delete from Equipment

When to use:

  • To remove a scenario from the equipment while keeping it in the database
  • To clean up an orphan scenario

Process:

  1. Click on "Delete" or "Delete from equipment"
  2. An info toast displays: "Deleting scenario [id] in progress..."
  3. Send DELETE command via connection on channel {MAC}/SCENARIO/CMD
  4. Wait 1.5 seconds
  5. Update lastSyncAt to null in database (for non-orphan scenarios)
  6. Success toast: "Scenario [id] deleted from equipment"
Difference with Total Deletion

Deleting from equipment does NOT delete the scenario from the database. It remains accessible and editable, but no longer runs on the equipment until you add it again.

Refresh State

At the bottom of the modal, the "Refresh" button allows you to:

  1. Reload the current scenario state from the equipment
  2. Update the database/equipment comparison
  3. Detect new changes

When to use:

  • After performing multiple synchronizations
  • If multiple users manage the same equipment
  • To verify that actions have been properly applied

Displayed Information

For each scenario in the modal, you see:

  • Scenario name with icon
  • Active/inactive badge (green/gray)
  • Sync state badge (synchronized/to update/not synchronized)

Description (if present)

  • Descriptive text of the scenario
  • Last modification date (e.g., "2 hours ago")
  • ID in equipment (e.g., "scenario_123") - only if present in equipment
  • Action buttons according to state

Error Handling

Error: Timeout

Message: "Timeout: Equipment did not respond to LIST command..."

Cause: Equipment did not respond within 8 seconds

Solutions:

  • Check that equipment is online
  • Check connection
  • Ensure equipment firmware is up to date (scenario feature supported)
  • Click "Retry"

Timeout error

Error: Invalid Response

Message: "Error processing response: [details]"

Cause: Equipment response is not in expected format

Solutions:

  • Check firmware version
  • Contact technical support
  • Click "Retry"

Error: Equipment Signals Error

Message: "Equipment error: [equipment message]"

Cause: Equipment returned ACK with "error" or "failure" status

Solutions:

  • Check equipment logs
  • Verify scenario is compatible with equipment
  • Try deleting then recreating the scenario

Error handling

Complete Synchronization Workflow

Here is a typical synchronization usage workflow:

Scenario 1: New Scenario

  1. ✏️ Create a new scenario in the canvas
  2. 💾 Save the scenario (saved to database)
  3. 🔍 The scenario appears in the list with "To sync" badge
  4. 🔄 Open the synchronization modal
  5. ➕ Click on "Add to equipment"
  6. ✅ The scenario is now active and synchronized

New scenario workflow

Scenario 2: Modifying Existing Scenario

  1. ✏️ Edit an existing scenario in the canvas
  2. 🔧 Modify blocks, parameters, conditions
  3. 💾 Save modifications
  4. 🔍 The scenario now displays the "To sync" badge
  5. 🔄 Open the synchronization modal
  6. 🔁 Click on "Update"
  7. ✅ Modifications are applied to equipment

Scenario modification workflow

Scenario 3: Activation/Deactivation

  1. 🎚️ Toggle the active/inactive switch of a scenario
  2. 🔍 The "To sync" badge appears
  3. 🔄 Open the synchronization modal
  4. 🔁 Click on "Update" to synchronize new status
  5. ✅ Equipment activates or deactivates the scenario

Activation/deactivation workflow

Scenario 4: Cleaning Orphan Scenario

  1. 🔄 Open the synchronization modal
  2. 🔍 An orphan scenario (red) is detected
  3. 🗑️ Click on "Delete from equipment"
  4. ✅ Scenario is removed from equipment
  5. 🔄 Refresh to confirm deletion

Orphan cleanup workflow

Visual Indicators

Border Color Codes

  • 🟢 Green: Synchronized scenario (everything up to date)
  • 🟡 Yellow/Orange: Scenario to update (pending modifications)
  • Gray: Not synchronized scenario (never sent to equipment)
  • 🔴 Red: Orphan scenario (in equipment but not in database)

Badge Icons

  • ✓ (check-circle): Synchronized
  • ⚠ (exclamation-circle): To update
  • ✗ (x-circle): Not synchronized
  • ? (question-circle): Orphan / Not referenced

Visual indicators

Best Practices

For efficient synchronization:

Synchronize after each important modification: Don't let changes accumulate ✅ Check "To sync" badges: Regularly check the scenario list ✅ Use "Refresh": Before and after a series of synchronizations ✅ Clean up orphans: Delete orphan scenarios to avoid confusion ✅ Check equipment status: Ensure it's "online" before synchronizing ✅ Wait for confirmation: Toasts indicate success or failure of each action ✅ Test after sync: Verify that the scenario executes correctly

Limitations and Constraints

Communication Delay

  • Timeout: 8 seconds for LIST command
  • Post-action delay: 1.5 second wait after each command
  • These delays are necessary for communication and equipment processing

Firmware

  • The feature requires up-to-date firmware on the equipment
  • Old firmware may not support scenario commands
  • Regularly check available firmware updates

Connection

  • Equipment must be connected to server
  • Unstable connection may cause synchronization failures
  • In case of problem, check equipment network settings

Troubleshooting

"Synchronize" Button is Disabled

Check:

  • Is the equipment online?
  • Do you have at least one scenario created?
  • Do you have necessary permissions (Premium/Demo)?

Actions:

  1. Check equipment state (must be "online")
  2. Check connection in settings
  3. Restart equipment if necessary
  4. Update equipment firmware

Scenario Doesn't Execute After Synchronization

Actions:

  1. Check that scenario is enabled (switch ON)
  2. Open modal and check state (must be "Synchronized")
  3. Check "Logs" tab to see executions
  4. Verify that used sensors exist and work
  5. Test scenario with "Test" button

Orphan Scenarios Appear

Possible causes:

  • Deleting scenario from database without deleting from equipment
  • Database reset
  • Equipment migration

Solution:

  • Delete orphans from equipment via "Delete from equipment" button

Conclusion

Synchronization is the bridge between your web configuration and real-time execution on equipment. By understanding different states and following best practices, you will maintain perfect consistency between your database scenarios and those active in the field.

You Now Master Scenarios!

You know how to create, configure and synchronize scenarios. Don't hesitate to experiment and create complex automations adapted to your needs!