> ## 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.

# Connect to an SMA PV system

> Connect and control solar plants remotely.

## What you'll need

* A valid access (bearer) token
* The plant ID for the PV system
* The email address of the plant owner

### Locating the plant ID

In SMA's Sunny Portal, the plant ID is part of the URL when navigating to the corresponding plant or when clicking on the PV System Logbook navigation tree item. The plant ID may not be visible in the UI itself.

## Let's get started

<Steps>
  <Step title="Start the onboarding process">
    Create an [Entity Onboarding Request](/api-reference/endpoint/onboarding-api/onboard-entities/create-an-entity-onboarding-request), setting the <Tooltip tip="Specify the type of device or vehicle that you want to connect with.">type</Tooltip> to `SolarPlant` and <Tooltip tip="Specify the brand (for example: “Audi” or “Tesla”) of the device or vehicle you want to connect with.">brand</Tooltip> to `SMA`.

    You'll also need to specify the plant ID as its <Tooltip tip="A unique identifier asigned by the vehicle or device manufacturer.">identifier</Tooltip>, and the plant owner’s <Tooltip tip="The email address of the device owner.">associatedEmail</Tooltip> address.

    <ParamField body="type" type="enum<string>" required />

    <ParamField body="brand" type="string" required />

    <ParamField body="identifier" type="string" required />

    <ParamField body="associatedEmail" type="string" required />
  </Step>

  <Step title="Check for required actions">
    In most cases, the onboarding request will have the <Tooltip tip="Available options: Canceled, Failed, InProgress, Pending, and Succeeded">status</Tooltip> `Pending` until a required <Tooltip tip="Represents a required action before the request can be completed.">action</Tooltip> is completed.

    SMA always requires an action of <Tooltip tip="Available options: Consent and Redirect">type</Tooltip> `Consent`. This means that the action has to be completed through SMA's website or by responding to a notification they have sent to the plant owner. Such actions also contain a <Tooltip tip="Link to instructions for completing the action manually.">documentationLink</Tooltip> leading to more information on how to complete the action.

    ```json Response (Body) [expandable] {3, 5-8} theme={null}
    {
        "id": "3c90c3cc-[....]-8dd25736052a",
        "status": "Pending",
        "requestType": "Entity",
        "action": {
            "type": "Consent",
            "documentationLink": "<string>"
        },
        "data": {
            ...
        }, ...
    }
    ```

    <ResponseField name="action" type="object">
      <Expandable title="properties">
        <ResponseField name="type" type="enum<string>">
          Available options: `Consent`, `Redirect`
        </ResponseField>

        <ResponseField name="redirectLink" type="string">
          A link to redirect the user to complete the action.
        </ResponseField>

        <ResponseField name="documentationLink" type="string">
          A link to our documentation, explaining the user how to proceed.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Step>

  <Step title="Track the onboarding status">
    Periodically poll the Onboarding API to check if the status of your request has updated to `Succeeded`. Once it's complete, you'll find the newly created Entity and its ID in the <Tooltip tip="An object containing the newly created Entity.">data</Tooltip> object.

    You can reference the <Tooltip tip="The ID of the Entity">entityId</Tooltip> when using our Readings API and the Commands API.

    ```json {3, 6} theme={null}
    {
       "id": "3c90c3cc-[....]-8dd25736052a",
       "status": "Succeeded",
       "data": {
           "entity": {
               "id": "3c90c3cc-[...]-8dd25736052a",
               ...
           },
       }, ...
    }
    ```
  </Step>
</Steps>

## Work with your newly created Entity

**Tip:** Take note of your Entity ID before you get started with our APIs.

<CardGroup cols={2}>
  <Card title="Readings API" icon="gauge" href="/guides/readings">
    Observe the state of the plant.
  </Card>

  <Card title="Commands API" icon="square-terminal" href="/guides/commands">
    Curtail or deactivate the inverter.
  </Card>
</CardGroup>

<RequestExample>
  ```json Onboarding Request (Body)  {4-5} theme={null}
  {
      "type": "SolarPlant",
      "brand": "SMA",
      "identifier": "0987654321",
      "associatedEmail": "somebody@example.com"
  }
  ```
</RequestExample>
