Saltar al contenido principal

Integración domótica SolarEdge, gratuita y de código abierto

Integración SolarEdge para Gladys Assistant

Producción solar, consumo de la casa, intercambios con la red y batería desde SolarEdge.

info

La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.

This integration connects your SolarEdge photovoltaic installation to Gladys Assistant. It reads the SolarEdge Monitoring API V2 and creates up to four devices in Gladys: solar production, home consumption, grid exchanges and home battery.

SolarEdge retired the V1 API on 3 November 2026. Since then the old API keys (those of the portal, Admin → Site Access → API Access) are refused and the 1.x versions of the integration receive nothing. Version 2 uses V2: you create a (free) SolarEdge developer account and connect the integration once. See "Upgrading from version 1.x" below.

This version was written from the official V2 documentation, without a real V2 account to test it: feedback welcome.

No extra hardware is needed: everything goes through the SolarEdge cloud, read only. The integration never sends a command to your inverter.

What you get​

Which devices are created depends on what your installation can report: only sites fitted with a consumption meter (a SolarEdge Modbus meter) expose consumption and grid, and only sites with a battery expose the battery device. The integration detects all of this on its own at startup.

SolarEdge — Solar production​

Always created.

ReadingUnitDescription
Produced powerWInstantaneous output of the panels
Production todaykWhEnergy produced since midnight
Total productionkWhLifetime counter since commissioning

Total production is the counter of the inverter (or of the production meter), read once a day, plus today's production.

The revenue today of the 1.x versions is gone: the V2 API does not provide it.

Production this month and this year are not features: the Solar production widget shows them. Gladys has no type for an energy that resets every month or every year, and the closest one is counted by Gladys as house consumption (see "Upgrading from version 1.1.0").

SolarEdge — Consumption​

Created when your installation has a consumption meter.

ReadingUnitDescription
Consumed powerWInstantaneous consumption of the house
Consumption todaykWhEnergy consumed since midnight
Self-consumption todaykWhShare covered by the panels and the battery

SolarEdge — Grid​

Created when your installation measures the grid exchanges.

ReadingUnitDescription
Grid powerWPositive when importing, negative when exporting
Imported todaykWhEnergy bought from the grid since midnight
Exported todaykWhSurplus sold since midnight
Import index*kWhEnergy bought from the grid since commissioning

* When the SolarEdge meter measures the imported energy.

The sign of the grid power is what makes scenes interesting: "when grid power drops below −1000 W, start the water heater" means exactly "use the surplus instead of selling it".

The "today" energies (consumption, self-consumption, imported, exported) are totals since midnight, published with Gladys's index today type: the Gladys energy module does not count them as consumption to bill.

The Gladys energy module​

The Gladys energy module (30-minute consumption and cost, energy dashboard, contract) reads an index: a counter that only goes up. The Import index is that index. It is the energy you buy from the grid, the one your supplier bills. Gladys adds "(consumption)" and "(cost)" to it and computes your billed consumption with your contract's rates. The house consumption is not used as an index: it includes the self-consumed solar, which costs you nothing.

The integration reads the import counter of the SolarEdge meter once a day and adds today's import to it: it moves at the pace of the refreshes, and never goes down.

If Gladys already has a Linky meter as its main meter, that meter measures the same energy: the Import index sits under it by default, and you can turn its history off if you do not want the duplicate.

A site without a SolarEdge meter (inverter alone) has no Import index: SolarEdge only knows its production.

SolarEdge — Battery​

Created when your site has storage (SolarEdge Energy Bank, LG RESU…).

ReadingUnitDescription
Charge level%Battery state of charge
Battery powerWPositive when charging, negative when discharging
Battery statetextCharging / discharging / idle / disabled
Battery low0-1Charge level at 10 % or below
Stored energy*kWhEnergy actually available in the battery
Battery temperature*°CInternal temperature of the pack

* Only when the Detailed battery telemetry setting is enabled.

V2 no longer gives SolarEdge's "critical" flag (the live power flow is kept for paid developer plans): Battery low now flags a charge level of 10 % or below.

Dashboard widgets​

With Gladys 5.1 or newer, the integration offers three widgets (Edit dashboard → Add a widget). They are built from what the integration already holds in memory: showing a widget never costs a SolarEdge request, even with ten dashboards open. Tiles and charts are bound to the device features and update live as soon as a value is published; today's balance comes from the last SolarEdge reading, whose time is shown as "Updated at".

The devices must have been added from the Discovery tab: a tile bound to a feature Gladys does not have stays empty.

  • Energy flow — the installation at a glance. Up to four live tiles: production, consumption, grid (positive when importing, negative when exporting) and battery (positive when charging, negative when discharging), depending on what your site measures. A chart of the powers (production, consumption and grid) over the period chosen in the widget settings (24 hours or a week). Then today's balance: production, consumption, self-consumption, imported and exported energy, and the battery level with its state. The Refresh button reads SolarEdge right away, like the Refresh now button of the configuration screen: it counts against the request budget, and once the day's budget is spent the widget says so instead of calling the API.
  • Solar production — production today, this month, this year and since commissioning as tiles (no decimals from 1000 kWh on; month, year and total come from the last SolarEdge reading), the PV power curve over the chosen period (24 hours, a week or a month) and the time of the last reading.
  • Battery — the charge level gauge, the battery power, its state (Charging in green, Discharging in blue, Idle or Disabled in grey), the stored energy and the temperature when Detailed battery telemetry is enabled, and a red Battery low row at 10 % or below. On a site without a battery the widget simply says so.

Widgets refresh every five minutes at most, and as soon as a new SolarEdge reading lands. The values therefore never move faster than your refresh interval: the same SolarEdge credit budget applies.

Setup​

You need Gladys 5.2 or later (the "Connect" button came with 5.2).

1. Create the SolarEdge developer account and application​

This is the path SolarEdge provides for homeowners ("Homeowner and Self-Access" guide of the SolarEdge documentation). It is free.

  1. Go to https://developer.solaredge.com/ and sign in with your mySolarEdge login (the site owner's). Fill in the developer profile: as company name, your own name will do (unaccented letters and digits only); industry "Other / Hobbyist", usage "Low - personal project". The Free plan is enabled right away: 2,000 credits a month.
  2. Click Create Application: a name ("Gladys", for instance), the Monitoring API service, then Site Access.
  3. In the OAuth configuration of the application:
    • Redirect URI: the address shown in Gladys under the Connect button (Configuration tab of the integration), usually https://my.gladysassistant.com/redirect/oauth;
    • Origin URL: https://my.gladysassistant.com;
    • scopes: SITE_DATA and DEVICE_DATA (without DEVICE_DATA, only the production is available).
  4. Copy the Client ID and the Client Secret. The secret is shown only once.
  5. Note your site ID: mySolarEdge app, site details, or the number in the address bar of the https://monitoring.solaredge.com/ portal.

Only the site owner can connect a site. If your login is not the owner, ask your installer to make you the owner (or use SolarEdge's site ownership transfer form).

2. Connect the integration​

  1. Open the Configuration tab of the integration in Gladys.
  2. Fill in the Client ID, the Client Secret and the Site ID, then save.
  3. Press Connect. The SolarEdge page opens: sign in with your mySolarEdge login, pick the site if you have several, then approve. You come back to Gladys and the status turns to "connected".
  4. Press Test the connection: the message confirms the site name and the list of available devices.
  5. The devices show up in the Discovery tab, ready to be added.

The authorization renews itself every two hours. It only expires after 14 days without any refresh (Gladys stopped for two weeks, for instance): the connection status then says so, and pressing Connect again is enough.

Installers: with an installer account and a Fleet Access application, paste the Fleet API key in its field instead, without "Connect". The site ID can stay empty when the key covers a single site; otherwise List my sites gives the IDs.

3. The refresh rate​

The free plan gives 2,000 credits a month for the whole developer account, and every API call costs one. Once they are spent, SolarEdge refuses everything until the next billing cycle: the integration therefore never spends more than 1/31 of your Monthly credits a day (64 on the free plan), keeping a small reserve for your buttons.

One refresh costs:

  • 2 requests for a lone inverter (today's balance and the power);
  • 1 more with a meter (home and grid powers), unless that meter measures the production too;
  • 1 more with a battery, and 1 more again with Detailed battery telemetry (the temperature);
  • and every day, 2 or 3 requests for the month, the year, the total production and the Import index.

The integration stretches your Refresh interval on its own until it fits in that budget. On the free plan, expect a reading about every 50 minutes for a lone inverter, every 80 minutes with a meter, every 1 h 45 with a meter and a battery. The API usage button tells the interval actually used.

With a paid plan (Business Starter: 20,000 credits), fill in your Monthly credits: the interval comes down to the one you chose, 15 minutes at the shortest (the finest resolution of the API). If other applications use the same developer account, lower that setting accordingly.

Why do the devices say "every minute"? Gladys can only wake an integration up at predefined rates, the slowest being one minute. That wake-up is a mere heartbeat: it costs no request. The integration reads SolarEdge on its own and publishes the values itself; a Gladys heartbeat only gets the last cached reading.

Upgrading from version 1.x (V2 API)​

  1. Update Gladys to 5.2 or later if needed, then the integration.
  2. Follow "Setup" above: developer account, application, Connect. The old API key is no longer used (you can clear the field; left as is, it is ignored as soon as the application is filled in).
  3. Your devices and their history are kept: same IDs, same readings. If your site had a tariff, the Solar production device shows Update in the Discovery tab: clicking it deletes the Revenue today feature, which V2 no longer provides (with its history). Without a click, it just stays frozen.
  4. Revenue today also leaves the widgets, and the Revenue currency setting leaves the form.

Upgrading from version 1.2.0​

On a metered site, the SolarEdge — Grid device shows Update in the Discovery tab: click it to add the Import index. Nothing is deleted. On a site without a meter, nothing changes.

Upgrading from version 1.1.0​

Version 1.1.0 published production this month, production this year, energy imported and exported today (and the battery's stored energy) with a type Gladys 5.1 treats as a consumption meter. Gladys then added two features of its own to each, "… (consumption)" and "… (cost)": your production and the surplus you sell were counted as house consumption, and billed. On a site without a meter, 1.1.0 also created a Grid device stuck at 0 W and a Revenue today feature that never held a value.

Once the integration is updated:

  1. Open the integration's Discovery tab. Every affected device shows Update: click it, device by device. Gladys then applies the new list of features:
    • the features the integration no longer publishes (production this month, this year, revenue today without a tariff) are deleted, with their history;
    • the "(consumption)" and "(cost)" features Gladys had added are deleted, with their history: this is what removes the false consumption from your energy dashboards;
    • the features that only change type (today's energies, stored energy) stay the same features and keep their history.
  2. On a site without a consumption meter, the SolarEdge — Grid device is no longer offered at all (and the integration sends it nothing). Delete it from the integration's Devices tab: its "(consumption)" and "(cost)" features go with it.
  3. If a widget or a scene used a deleted feature, edit it: the SolarEdge widgets adapt on their own.

Until you click "Update", Gladys keeps the old types in its database and keeps computing a false consumption from the energy imported and exported today, which the integration still publishes.

Available actions​

  • Test the connection — checks the SolarEdge access, resolves the site and lists the devices your installation can feed.
  • List my sites — with a Fleet key, every site it covers with its ID; with "Connect", the authorized site.
  • Refresh now — reads SolarEdge right away, without waiting for the next cycle (within the same budget).
  • API usage — requests used today, the daily share of the monthly credits, the cost of one refresh and the interval actually used.

Troubleshooting​

"SolarEdge retired its V1 API" — the integration has no V2 application yet: follow "Setup".

"SolarEdge refused access" — check the Site ID (it must be the site you authorized), and that the application has the DEVICE_DATA scope. An old V1 API key left alone in the Fleet field ends up here too.

"SolarEdge access expired or was refused" — the Client Secret is wrong, or the authorization expired (14 days without a refresh) or was revoked: check the secret, save, then press Connect.

"Connect" shows a redirect error at SolarEdge — the redirect URI declared in the SolarEdge application must be exactly the one shown under the button in Gladys.

The Consumption and Grid devices do not appear — your installation has no meter (a hardware option fitted by the installer), or the application lacks the DEVICE_DATA scope. The integration only creates a device for a value that is actually measured.

A reading stays empty while the others fill in — SolarEdge does not report it for your site. The integration never publishes 0 in place of a missing value: a 0 could not be told from a real zero. One exception, the produced power: a sleeping inverter (at night) sends nothing, and that is 0 W.

The values stop moving — the day's budget is spent (it resets at midnight UTC), or the month's credits are (they reset at the next billing cycle). API usage tells where you stand; an orange badge shows on the devices.

An "unreachable" badge on the devices — the SolarEdge cloud does not answer. The integration retries on its own; its logs (LOG_LEVEL=debug for the details) give the exact cause.

Privacy​

The integration only talks to monitoringapi.solaredge.com, read only. The Client Secret and the Fleet key are stored by Gladys as secrets, never sent back to the interface; the access tokens are kept by the integration in its configuration, outside the form. During "Connect", SolarEdge sends your browser to the Gladys redirect page (my.gladysassistant.com), which sends it straight back to your instance: it sees the authorization code go by, useless without the Client Secret. No data is sent anywhere else.

Parámetros de configuración​

Estos son los parámetros que SolarEdge te pide en su pantalla de configuración en Gladys.

ParámetroTipoObligatorioDescripción
Primeros pasossectionNoSolarEdge retiró su API V1 (y sus claves de API) el 3 de noviembre de 2026. Para leer su instalación: 1. inicie sesión en developer.solaredge.com con sus credenciales de mySolarEdge y cree la cuenta de desarrollador gratuita; 2. cree una aplicación, servicio Monitoring API, acceso «Site Access», ámbitos SITE_DATA y DEVICE_DATA, y declare la dirección de redirección que aparece bajo el botón «Conectar»; 3. pegue su Client ID y su Client Secret, y el ID de su sitio (aplicación mySolarEdge, detalles del sitio), y guarde; 4. pulse «Conectar» y autorice con sus credenciales de mySolarEdge. El plan gratuito ofrece 2000 solicitudes al mes: el intervalo de actualización se adapta a ello.
Client IDstringNoClient ID de su aplicación «Site Access», en la consola de desarrollador de SolarEdge.
Client SecretsecretNoSolo se muestra una vez, al crear la aplicación.
ID del sitiostringNoID numérico de su sitio (aplicación mySolarEdge, detalles del sitio; o barra de direcciones del portal de monitorización). Obligatorio con «Conectar»; puede quedar vacío con una clave Fleet que solo cubre un sitio.
Acceso a SolarEdgeoauth2NoGuarde primero los campos de arriba y conéctese con sus credenciales de mySolarEdge (las del propietario del sitio). Solo hay que repetirlo si el acceso caduca (14 días sin ninguna actualización).
Clave de API Fleet (instaladores)secretNoSolo para una cuenta de instalador con una aplicación «Fleet Access», en lugar de «Conectar». Las antiguas claves de API V1 ya no funcionan.
Intervalo de actualización (s)numberNoIntervalo deseado entre dos lecturas. Se alarga automáticamente para no superar los créditos mensuales: unos 50 min para un inversor solo con el plan gratuito, más con un contador o una batería (vea «Uso de la API»).
Créditos mensualesnumberNoAsignación mensual de su cuenta de desarrollador de SolarEdge (2000 con el plan gratuito, 20 000 con Business Starter). La integración gasta como máximo 1/31 al día. Redúzcala si otras aplicaciones comparten la cuenta.
Telemetría detallada de la bateríabooleanNoAñade la temperatura de la batería. Consume una solicitud más por actualización (por tanto, un intervalo más largo) y solo afecta a los sitios con batería.

Cómo instalar SolarEdge en Gladys​

  1. En Gladys, abre Integraciones: SolarEdge aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
  2. Haz clic en Instalar. Gladys descarga la imagen Docker (ghcr.io/guim31/gladys-solaredge:2.0.0), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración).
  3. Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
  4. También puedes instalarla directamente desde la URL de su repositorio: https://github.com/guim31/gladys-solaredge.

SolarEdge requiere Gladys >=5.2.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.

¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.

Sobre las integraciones externas​

SolarEdge es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene guim31, no el equipo principal de Gladys.

Suscríbete a la newsletter de Gladys Assistant

Unos pocos correos al mes sobre nuevas versiones y novedades del proyecto. Enviados por Pierre-Gilles Leymarie, fundador del proyecto. Puedes darte de baja cuando quieras 🙂