> ## Documentation Index
> Fetch the complete documentation index at: https://docs.der-connect.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands API

> Use the Commands API to schedule or directly send instructions to Entities.

<Frame>
  <img src="https://mintcdn.com/realto/EG-Ok6q3nUjGJxIo/images/commands.jpg?fit=max&auto=format&n=EG-Ok6q3nUjGJxIo&q=85&s=21a6cc029b546d2e1ee8157bcbc63c0f" alt="illustration related to commands" width="1600" height="800" data-path="images/commands.jpg" />
</Frame>

Some Entities can be controlled remotely through our Commands API. Commands can instruct a device to take action or change its configuration.

## What makes this API powerful

Just like Readings, Commands are normalized across all Entities. This allows you to send consistent instructions to any supported device across different manufacturers, models, and device variations.

## Command types and compatibility

Whether an Entity supports a Command depends on the type of Entity and its manufacturer.

| **Command**          | **Use**                                              | **Value**  | **Compatibility** |
| :------------------- | :--------------------------------------------------- | :--------- | :---------------- |
| <u>StartCharging</u> | Start a new charging session.                        | N/A        | EV[^1], CP[^2]    |
| <u>StopCharging</u>  | Stop an active charging session.                     | N/A        | EV[^1], CP[^2]    |
| <u>Reset</u>         | Set the default configuration.                       | N/A        | PV                |
| <u>Disconnect</u>    | Disconnect the system from the grid.                 | N/A        | PV[^3]            |
| <u>LimitFeedIn</u>   | Sets a feed-in limit. Used for curtailing injection. | Limit in W | PV                |
| <u>StopFeedIn</u>    | Limits feed-in to a minimum.                         | N/A        | PV                |

## The cooldown time

In rare cases, a Command can’t be executed immediately. The device might process it with a delay, or it may take some time for the Command to reach it. To prevent latency issues, we’ve introduced a cooldown period between Commands sent to the same Entity.

The cooldown period lasts 10 minutes. You can disable the cooldown if needed, but we recommend avoiding this whenever possible to maintain reliability.

When you [Trigger a Command for an Entity](/api-reference/endpoint/commands-api/trigger-schedule/trigger-for-entity), you can disable the cooldown by setting the <Tooltip tip="Ignore internal cooldowns of the Entity. Using this may result in Commands not being executed!">ignoreCooldown</Tooltip> query parameter to `true`.

## What you’ll need

* A valid access (bearer) token
* Contributor permission on an Entity that supports Commands

## Let’s try it out

Use the <Tooltip tip="The ID of the Entity">entityId</Tooltip> to [Trigger a Command](/api-reference/endpoint/commands-api/trigger-schedule/trigger-for-entity) for it.

You'll also have to specify the Command <Tooltip tip="Available options: StartCharging, StopCharging, Reset, Disconnect, LimitFeedIn, StopFeedIn">type</Tooltip> and you may need to set a <Tooltip tip="The value for the command.">value</Tooltip>.

<ParamField body="type" type="string" required>
  Available options: `StartCharging`, `StopCharging`, `Reset`, `Disconnect`, `LimitFeedIn`, and `StopFeedIn`.
</ParamField>

<ParamField body="value" type="string">
  Reference the [compatibility table](#command-types-and-compatibility) to understand what's expected.
</ParamField>

```json Response (Body) {4} theme={null}
  {
    "id": "9671cc39-[...]-803eb4022baa",
    "entityId": "3c90c3cc-[...]-8dd25736052a",
    "status": "Pending",
    "triggerTime": "2023-11-07T05:31:56Z",
    "type": "Reset",
  }
```

After creating it, your Command will typically be in a `Pending` state. Fetch its updated <Tooltip tip="Available options: Canceled, Failed, Pending, Sent, Succeeded, Triggered">status</Tooltip> at a later time by [Retrieving your Command](/api-reference/endpoint/commands-api/retrieve-a-specific-command-by-its-id).

***

[^1]: Charging Commands aren't available for BMW vehicles unless onboarded through Enode. We partner with Enode to extend our support for vehicles through reversed-engeneered connectivity solutions. Read more about Enode's capabilities [on their website](https://developers.enode.com/api/capabilities/vehicle).

[^2]: Direct charge point connections over OCPP may not all support Charging Commands.

[^3]: The Disconnect Command is currently not supported by Huawei.
