Mira Device Disconnect

Disconnect a device from Mira App Server

Mira Device Disconnect

AI-generated

Overview

The "Mira Device Disconnect" node is designed to disconnect a specific device from the Mira App Server. It is useful in scenarios where you need to remotely terminate or revoke a device's connection within a given library context, such as managing IoT devices, client applications, or hardware endpoints registered on the Mira platform.

Practical examples include:

  • Administrators disconnecting a compromised or malfunctioning device.
  • Automated workflows that disconnect devices after certain conditions are met (e.g., inactivity or security policy enforcement).
  • Managing device lifecycle by programmatically controlling device connectivity.

Properties

Name Meaning
Token Source Choose where to get the access token from: either from stored credentials or from input data. Options: "From Credentials", "From Input Data".
Server URL The URL of the Mira App Server to which the request will be sent. Required if token source is "From Input Data".
Access Token The access token used for authentication, provided directly or via input data. Required if token source is "From Input Data".
Library ID The identifier of the library that the device belongs to. This scopes the disconnection request to a specific library.
Client ID The identifier of the device (client) to disconnect from the Mira App Server.

Output

The node outputs JSON data containing the following fields:

  • disconnectedClientId: The trimmed Client ID of the device that was disconnected.
  • libraryId: The trimmed Library ID associated with the device.
  • operation: A string indicating the operation performed, here always "disconnect".
  • timestamp: The ISO 8601 timestamp when the disconnection operation was executed.

This output confirms the device disconnection and provides metadata about the action.

Dependencies

  • Requires an active connection to a Mira App Server instance.
  • Needs an access token for authentication, either supplied via credentials configured in n8n or passed dynamically through input data.
  • The node uses HTTP POST requests to the /api/devices/disconnect endpoint on the Mira server.

Troubleshooting

  • Missing or invalid Library ID or Client ID: The node validates these parameters before making the request. Ensure both are provided and correctly formatted.
  • Authentication errors: If using input data for tokens, verify the access token is valid and not expired. If using credentials, ensure they are properly configured.
  • Server connectivity issues: Confirm the Server URL is reachable and correct, especially when using input data for token source.
  • API errors: The Mira server may return errors if the device or library does not exist or if the device is already disconnected. Check server logs or API responses for details.

Links and References

  • Mira App Server API documentation (for /api/devices/disconnect endpoint) — consult your Mira platform resources.
  • n8n documentation on credential management and HTTP request nodes for further customization.

Discussion