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:
- Database (DB): Where you create and modify your scenarios via the web interface
- Logic Controller Equipment: Where scenarios are stored and executed in real-time
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
- Access the "Scenario" tab of your equipment
- At the top right, click the "Synchronize with equipment" button
- The synchronization modal opens and automatically loads the scenario states
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:
- 📡 Sends a LIST command to the equipment
- ⏱️ Waits for the equipment response (8 second timeout)
- 🔍 Compares database scenarios with equipment scenarios
- 📊 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:
lastSyncAtexists andupdatedAt≤lastSyncAtand 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
lastSyncAtis null (never synchronized) - Or
updatedAt>lastSyncAt(modified since last sync) - Or active/inactive status has changed
- Either
- 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 (
lastSyncAtis 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:
- Click on "Add to equipment"
- An info toast displays: "Adding scenario [name] in progress..."
- The scenario is converted to equipment format
- Published to server on channel
{MAC}/SCENARIO - Wait 1.5 seconds for confirmation
- Update
lastSyncAtin database - Success toast: "Scenario [name] added to equipment"
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:
- Click on "Update"
- An info toast displays: "Updating scenario [name] in progress..."
- The updated scenario is converted to equipment format
- Published to server on channel
{MAC}/SCENARIO(overwrites the old one) - Wait 1.5 seconds
- Update
lastSyncAtin database - Success toast: "Scenario [name] updated in equipment"
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:
- Click on "Delete" or "Delete from equipment"
- An info toast displays: "Deleting scenario [id] in progress..."
- Send DELETE command via connection on channel
{MAC}/SCENARIO/CMD - Wait 1.5 seconds
- Update
lastSyncAttonullin database (for non-orphan scenarios) - Success toast: "Scenario [id] deleted from equipment"
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:
- Reload the current scenario state from the equipment
- Update the database/equipment comparison
- 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:
Header
- 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
Footer
- 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"
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
Complete Synchronization Workflow
Here is a typical synchronization usage workflow:
Scenario 1: New Scenario
- ✏️ Create a new scenario in the canvas
- 💾 Save the scenario (saved to database)
- 🔍 The scenario appears in the list with "To sync" badge
- 🔄 Open the synchronization modal
- ➕ Click on "Add to equipment"
- ✅ The scenario is now active and synchronized
Scenario 2: Modifying Existing Scenario
- ✏️ Edit an existing scenario in the canvas
- 🔧 Modify blocks, parameters, conditions
- 💾 Save modifications
- 🔍 The scenario now displays the "To sync" badge
- 🔄 Open the synchronization modal
- 🔁 Click on "Update"
- ✅ Modifications are applied to equipment
Scenario 3: Activation/Deactivation
- 🎚️ Toggle the active/inactive switch of a scenario
- 🔍 The "To sync" badge appears
- 🔄 Open the synchronization modal
- 🔁 Click on "Update" to synchronize new status
- ✅ Equipment activates or deactivates the scenario
Scenario 4: Cleaning Orphan Scenario
- 🔄 Open the synchronization modal
- 🔍 An orphan scenario (red) is detected
- 🗑️ Click on "Delete from equipment"
- ✅ Scenario is removed from equipment
- 🔄 Refresh to confirm deletion
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
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)?
Modal Displays "Timeout"
Actions:
- Check equipment state (must be "online")
- Check connection in settings
- Restart equipment if necessary
- Update equipment firmware
Scenario Doesn't Execute After Synchronization
Actions:
- Check that scenario is enabled (switch ON)
- Open modal and check state (must be "Synchronized")
- Check "Logs" tab to see executions
- Verify that used sensors exist and work
- 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 know how to create, configure and synchronize scenarios. Don't hesitate to experiment and create complex automations adapted to your needs!