Commands
Define custom device and software commands for a GPS device in Navixy and send them on demand from the Object widget.
The Commands block lets you define custom commands for a device in Navixy and send them on demand from the device's Object widget or the X-GPS Mobile app. Use it to send a firmware-level instruction directly to a device, such as sending a CAN command or activating an output, or to call any external system that accepts HTTP requests, such as a Slack channel, a notification service, a CRM, or a custom API endpoint. Once configured, commands can be dispatched with a single click.
The Commands block supports two command types:
Device command sends a protocol-level instruction string directly to the device, for example to send a CAN command or activate an output.
Software command sends an HTTP POST request with a JSON body to any URL, optionally including current device data such as location, speed, or device ID in the payload.
Commands are saved per device and remain available for repeated use.
Configuration
To configure Commands for a device, follow these steps:
Go to Devices and settings in the left sidebar.
Select the device you want to configure.
Locate and expand the Commands block.

You can add multiple commands of each type. Each command is saved individually.
Device commands
A device command sends a protocol-level instruction string directly to the device over its communication channel.

To add a device command, click Add device command at the bottom of the block. Configure the following fields:
Command name: a label for the command as it appears in the Object widget, for example
device reboot. Choose a name that clearly describes what the command does.Command string: the exact instruction string that is sent to the device, for example
cpureset.
Valid command strings are device-specific and defined by the device manufacturer. Always refer to the official documentation for your device model to find the correct command strings. Entering incorrect values may have unintended effects on the device.
Click Save to store the command. Click Delete to remove it.
Software commands
A software command sends an HTTP POST request with a JSON body to a URL you specify. This can be an external service endpoint, such as Slack, a custom webhook receiver, or any REST API, or a Navixy API endpoint.
The request body is JSON and must be structured according to what the destination endpoint expects. You can include device data attributes in the body using the {{attribute_name}} syntax.
Software commands are configured across two tabs: General and Body.
To add a software command, click Add software command at the bottom of the block.
General tab
Configure the following:
Title: a label for the command as it appears in the Object widget.
URL: the full endpoint URL where the POST request is sent, for example
https://hooks.slack.com/services/...orhttps://api.eu.navixy.com/v2/....Headers: key-value pairs sent as HTTP request headers. Add headers as needed for the destination endpoint. Click Add header to insert a new row.
Use the
Authorizationheader for token-based authentication, for exampleAuthorizationset toBearer your_token.Other authentication methods supported by the destination, such as API keys passed as query parameters in the URL, can also be used.

Body tab
The Body field is where you compose the JSON payload. Write valid JSON that matches the format expected by the destination endpoint.
To include live device data in the payload, use the {{attribute_name}} syntax. Click the attribute picker button
at the top-right of the body field to open a searchable list of available attributes for the device. Selecting an attribute inserts the corresponding {{attribute_name}} placeholder into the body at the cursor position.

Click Save to store the command. Click Delete to remove it.
Example: sending a Slack notification
Slack supports receiving messages from external services via Incoming Webhooks. Once you have set up a webhook in your Slack workspace and obtained the webhook URL (see the Slack Incoming Webhooks guide), create a software command with the following configuration.
General tab:
Title:
Notify SlackURL: your Slack Incoming Webhook URL, for example
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXHeaders: no headers required
Body tab:
Slack expects a JSON object with a text field. The {{device_id}}, {{speed}}, {{latitude}}, and {{longitude}} placeholders are replaced with the current values for the device at the moment the command is sent. When triggered from the Object widget, the message appears in the Slack channel configured for your webhook.
Dynamic command values
A command string or software command body can include a single <> placeholder to prompt for a value each time you send the command, instead of hard-coding a fixed value.
In a device command, add
<>inside the Command string field, for examplerelay,<>to send a different relay state on each send.In a software command, add
<>inside the Body field, for example{"value": "<>"}.
Only one <> placeholder is allowed per command. Saving a command with more than one placeholder returns the error "Only one value is allowed per command. Remove the extra < >."
When you send a command that contains <> from the Object widget, a dialog asks for the value before dispatch. See Sending commands from the Object widget for the full flow.
Sending commands from the Object widget
Once commands are saved, they appear in the Commands block of the device's Object widget in the Tracking module.

Click the send button next to a command name to dispatch it. The Commands block shows all device commands and software commands configured for that device.
If the command doesn't contain a dynamic value placeholder, Navixy sends it immediately. There is no confirmation dialog.
If the command contains
<>, a dialog opens asking you to enter a value. Enter a value of up to 500 characters and click Send to dispatch the command with the value substituted for<>. The Send button stays disabled until you enter a value, and empty or whitespace-only values aren't accepted.
After the command runs, Navixy shows a notification with the result:
Device commands show only whether the command succeeded, as
{ "success": true }or{ "success": false }.Software commands show the command name and the raw response from the destination endpoint, as
{status, body}. Long responses scroll inside the notification.
Sent commands also appear in the Recent events block of the Object widget, with their result available in an expandable view. If the command included a dynamic value placeholder, the entry's title also shows the value that was sent, for example Update status <online>.

Last updated
Was this helpful?