Mira Device Send Message

Send message to a device via Mira App Server

Mira Device Send Message

AI-generated

Overview

The "Mira Device Send Message" node allows users to send a custom message to a specific device registered in a Mira App Server environment. It is designed for scenarios where you need to remotely communicate with devices, such as sending notifications, commands, or data payloads.

Practical examples include:

  • Sending a notification alert to a device in a particular library.
  • Delivering configuration updates or commands to IoT devices managed by the Mira platform.
  • Triggering actions on client devices by sending structured JSON messages.

This node is useful in automation workflows that require direct device communication within an organization's device management system.

Properties

Name Meaning
Token Source Choose where to get the access token from: either from stored credentials or from input data.
Server URL The URL of the Mira App Server (required if token source is from input).
Access Token Access token string used for authentication (required if token source is from input).
Library ID The identifier of the library to which the target device belongs (required).
Client ID The client/device identifier to which the message will be sent (required).
Message The message content to send, provided as a JSON object or JSON string (required).

Output

The node outputs JSON data containing details about the message sending operation:

  • sentToClientId: The client ID of the device the message was sent to.
  • libraryId: The library ID associated with the device.
  • messageSize: The size in characters of the JSON stringified message.
  • operation: A string indicating the operation performed, here always "send_message".
  • timestamp: ISO timestamp of when the message was sent.

The output does not include binary data; it provides metadata about the message dispatch.

Dependencies

  • Requires access to a Mira App Server API endpoint.
  • Needs an access token for authentication, either supplied via credentials configured in n8n or directly through input data.
  • Uses HTTP POST requests to the /api/devices/send-message endpoint on the Mira server.

Troubleshooting

  • Invalid JSON Message: If the message property is a string but not valid JSON, the node throws an error:
    "Message must be valid JSON. Parse error: <error message>".
    Resolution: Ensure the message is a properly formatted JSON string or provide a JSON object.

  • Missing Required Parameters: Errors occur if "Library ID" or "Client ID" are missing or empty.
    Resolution: Provide valid non-empty values for these fields.

  • Authentication Issues: If the access token is invalid or missing (depending on token source), the request to the Mira server will fail.
    Resolution: Verify the token source setting and ensure a valid token is provided either via credentials or input.

  • Server Connectivity: If the Mira App Server URL is incorrect or unreachable, the node will fail to send the message.
    Resolution: Confirm the server URL is correct and accessible from the n8n instance.

Links and References

  • Mira App Server API documentation (not provided here, check your Mira platform resources)
  • JSON formatting guides for constructing valid message payloads

Discussion