Skip to main content

How Commands Flow: From App to Device

Have you ever wondered what happens in the split second between tapping a button in your app and your light turning on? This guide traces that journey.

1. The Starting Line: Your Request​

Whether you tap a button or tell the AI to "Dim the lights," a request is created. It's sent to our API Server, which is the front door to our cloud.

2. The Checkpoint: Is it Safe?​

The request goes straight to the Smart Shield (Safety Gateway).

  • It checks your permissions.
  • It makes sure the command makes sense for the device.
  • It logs the start of the action in our Permanent Library.

3. The Digital Signature: Sealing the Letter​

The Command Engine takes over.

  • It creates a unique ID for the command to make sure it's not a duplicate.
  • It adds a Digital Signature using a secret key unique to your device.
  • This "seals" the message so it can't be tampered with.

4. The Delivery: The High-Speed Post Office​

We use a technology called MQTT (a lightweight messaging system) to send the command. It's built for extreme speed and low power, which is why it works even on small smart devices.

5. The Confirmation: Closing the Loop​

Your device receives the command, checks the signature, and performs the action. It then sends back a "Mission Accomplished" (ACK) message.

  • Our cloud receives this confirmation.
  • We update the Live State of your home in our quick memory.
  • You see the update in your app instantly.

Behind the Scenes: Keeping it Clean​

  • The Sweeper: Every 30 seconds, a background "sweeper" looks for commands that didn't get a confirmation. It marks them as "expired" so the system doesn't stay stuck waiting.
  • The Monitor: We constantly watch for "heartbeats" from your devices. If a device stops talking, we mark it as "offline" and notify you.

Graceful Shutdown​

If we ever need to update our servers, we don't just pull the plug. We use a Graceful Shutdown process that waits for all active commands to finish before turning off. This ensures your home stays in a consistent state.