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

# SolarEdge

> Client-mode REST API connector for a curated SolarEdge monitoring slice: list sites and read a site overview

Technical Preview

# SolarEdge

Client-mode REST API connector for a curated SolarEdge monitoring slice: list sites and read a site overview.

* Hub category: **Energy**.
* Base: `https://monitoringapi.solaredge.com`

## Template reference

Generated from the shipped broker template `solaredge` (`-routeCode SOLAREDGE`). It lists every event the template defines.

### Auth

The template sets no auth header. Check the event headers below.

### Template parameters

| Placeholder | Type | Description | Required |
| - | - | - | - |
| `RouteName` | string | Name of the SolarEdge connector | no |
| `BaseUrl` | string | SolarEdge base URL without trailing slash (e.g. [https://monitoringapi.solaredge.com](https://monitoringapi.solaredge.com)) | yes |

`BASE_ADDRESS` default: `https://monitoringapi.solaredge.com`.

### Events

| Event | Method | Endpoint | Request topic | Response topic | Payload fields |
| - | - | - | - | - | - |
| `Listsites` | GET | `/site/list?api_key={value.json.api_token}` | `energy/solaredge/sites/list` | `energy/solaredge/sites/list/response` | `api_token` |
| `Getoverview` | GET | `/site/{value.json.site_id}/overview?api_key={value.json.api_token}` | `energy/solaredge/sites/overview` | `energy/solaredge/sites/overview/response` | `api_token`, `site_id` |

### Deploy

Get the template card (JSON with `template` and `metadata`) from the broker, then deploy the connector:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_pub -t '$SYS/Coreflux/Command' -m "-routeCode SOLAREDGE"
```

The deployable connector from the REST API app, with `BASE_ADDRESS` already filled in:

```lot theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
DEFINE ROUTE SolarEdgeRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://monitoringapi.solaredge.com"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '60'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT Listsites
        WITH SOURCE_TOPIC "energy/solaredge/sites/list"
        WITH DESTINATION_TOPIC "energy/solaredge/sites/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/site/list?api_key={value.json.api_token}"
        WITH HEADERS
            ADD "Accept" "application/json"
    ADD EVENT Getoverview
        WITH SOURCE_TOPIC "energy/solaredge/sites/overview"
        WITH DESTINATION_TOPIC "energy/solaredge/sites/overview/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/site/{value.json.site_id}/overview?api_key={value.json.api_token}"
        WITH HEADERS
            ADD "Accept" "application/json"
```

Deploy it with `-addRoute` (do not include `ADD METADATA`).

### Usage example

Call `Listsites` by publishing a JSON payload to its request topic, and read the reply on the response topic:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_sub -t 'energy/solaredge/sites/list/response' &
mosquitto_pub -t 'energy/solaredge/sites/list' -m '{"api_token": "<api_token>"}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.