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 — the same service the mobile app uses — and creates up to four devices in Gladys: solar production, home consumption, grid exchanges and home battery.

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
Revenue today*€ / $Revenue computed by SolarEdge from your tariff

* Only when you have entered a feed-in tariff in the SolarEdge portal (see "Revenue today" below). Without a tariff the feature is not created at all.

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 SolarEdge measures the imported energy and knows the site's commissioning date.

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.

SolarEdge has no lifetime import counter: the integration rebuilds it (the import up to yesterday, read once a day, plus today's import). It therefore moves at the pace of the daily breakdown (30 min by default).

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-1The "critical" flag reported by SolarEdge
Stored energy*kWhEnergy actually available in the battery
Battery temperature*°CInternal temperature of the pack

* Only when the Detailed battery telemetry setting is enabled.

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, today's revenue (when a tariff is entered in the SolarEdge portal) 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), today's revenue when it exists 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 when SolarEdge raises its critical flag. 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 300 requests/day budget applies.

Setup​

1. Get a SolarEdge API key​

The key is generated from the SolarEdge monitoring portal, with an account holding admin rights on the site:

  1. Sign in at https://monitoring.solaredge.com/.
  2. Open Admin → Site Access → API Access.
  3. Accept the terms of service, then click Generate a new key and Save.
  4. Copy the key (32 uppercase characters) and the site id shown on the same page.

If the "API Access" menu is not there, your account does not have the admin role on the installation: ask your installer for it.

2. Fill in the integration​

  1. Open the Configuration tab of the integration in Gladys.
  2. Paste your API key.
  3. Leave Site ID empty when your key covers a single site: it is detected automatically. Otherwise, press List my sites to find the id to enter.
  4. Save, then press Test the connection. The message shown under the button confirms the site name and the list of available devices.
  5. The devices appear in the Discovery tab, ready to be added.

3. Choose the refresh rate​

SolarEdge limits each API key to 300 requests per day and per site. Once the quota is spent, the API refuses everything until the next day — so the integration stops on its own before reaching it.

The budget reads as follows:

  • each refresh cycle costs 2 requests, whatever the number of devices created (they all share the same reading);
  • the daily breakdown (consumption, self-consumption, imported, exported) costs 1 request on its own, slower cadence;
  • the detailed battery telemetry, if you enable it, costs 1 more request at the daily-breakdown cadence;
  • the Import index costs 1 request a day (plus one more when the integration starts, for the past years).

With the default settings (15 min for live values, 30 min for the breakdown), the integration uses about 240 requests per day: it stays inside the budget with room to spare.

Lowering the interval to 5 minutes costs roughly 620 requests per day: the quota is reached around midday and the values freeze until tomorrow. The API usage button tells you where you stand at any moment.

Why do the devices say "every minute"? Gladys can only wake an integration at a fixed set of cadences, the slowest of which is one minute. That wake-up is just a tick: it costs no request. The integration reads SolarEdge on its own, at your Refresh interval, and publishes the values itself; a tick from Gladys only reuses the last cached reading.

Revenue today​

This one deserves an explanation, because it is easy to misread.

SolarEdge does not know your contract. The revenue it reports comes from a rate you enter yourself in the monitoring portal, under Admin → Revenue (you need account manager rights on the site). Two models are offered there: a flat rate per kWh, or a time-of-use rate.

Until that tariff is set, the API returns no revenue for the day (only a lifetime revenue of 0) and the integration simply does not create the feature. That is deliberate: a feature that could never hold a value looks like a broken sensor, when it is really an unconfigured option. If you set the tariff later, run a scan from the Discovery tab and the feature appears.

Why the number misleads with self-consumption​

SolarEdge computes tariff × energy produced. Not × energy exported.

On an installation that self-consumes and sells the surplus, your production splits into two flows worth very different amounts:

  • the energy you consume on site saves you from buying from the grid, at your supply contract price;
  • the surplus is sold, at the feed-in tariff, usually much lower.

SolarEdge applies a single rate to the whole thing. Enter your feed-in tariff and the reported revenue is badly overstated; enter your purchase price and the savings are. The honest calculation would be (self-consumed kWh × avoided purchase price) + (exported kWh × feed-in tariff), which this field cannot express.

Our advice: only set the tariff if you know exactly what you want out of it, and remember the figure covers total production. A missing feature is more honest than a wrong number.

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 key, resolves the site and lists the devices your installation can feed.
  • List my sites — shows every site the key gives access to, with its id, ready to copy into the matching setting.
  • Refresh now — reads SolarEdge immediately, without waiting for the next cycle.
  • API usage — how many requests were used today and how many refreshes are left.

Troubleshooting​

"SolarEdge refused the API key" — the key is invalid, has been regenerated, or does not grant access to this site. Generate a new one from the portal and paste it again (trailing spaces are stripped automatically).

"Site not found", or several sites — your key covers more than one installation: press List my sites and copy the id you want into the Site ID setting.

The Consumption and Grid devices do not show up — your installation has no consumption meter. SolarEdge still lists empty "Grid" and "Consumption" slots in its answers: the integration only creates a device for a value that is really measured. This is a hardware option (a Modbus meter) fitted by the installer; without it, SolarEdge only knows about production.

One reading stays empty while the others fill in — SolarEdge does not report that one for your site. The integration never publishes 0 in place of a missing value: a 0 would be indistinguishable from a genuine zero and would skew your charts and your scenes. The usual causes are a Modbus meter that stopped communicating (imported and exported energy stay empty, while grid power may show a real 0 reported by the inverter), or a feed-in tariff that was never configured.

Revenue today is not in the list of readings — expected when no tariff is set in the SolarEdge portal: see "Revenue today" above. After entering the tariff, run a scan from the Discovery tab for the feature to appear.

Values stop moving in the afternoon — the daily quota is probably spent. Check with API usage and raise the refresh interval. An orange dot then appears on the devices to signal that the values are no longer refreshed.

An "unreachable" badge on the devices — the SolarEdge cloud is not answering. The integration retries automatically; the integration logs (LOG_LEVEL=debug for the full detail) show the exact cause.

Privacy​

The integration only talks to monitoringapi.solaredge.com, read only. Your API key is stored by Gladys as a secret and is never sent back to the frontend. 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 pasossectionNoEsta integración lee su instalación a través de la API SolarEdge Monitoring. Genere una clave de API en el portal de monitorización (Admin > Site Access > API Access), péguela abajo y pulse «Probar conexión». SolarEdge permite 300 solicitudes al día por sitio: el intervalo de actualización predeterminado queda muy por debajo de ese límite.
Clave de APIsecretSíClave de la API SolarEdge Monitoring, generada en Admin > Site Access > API Access.
ID del sitiostringNoID numérico del sitio. Déjelo vacío si la clave de API solo da acceso a un sitio: se detecta automáticamente. Si no, use el botón «Listar mis sitios».
Intervalo de actualización (s)numberNoFrecuencia de actualización de los valores en directo (flujo de potencia, contadores de producción). Cada ciclo consume 2 de las 300 solicitudes diarias que permite SolarEdge, sea cual sea el número de dispositivos.
Intervalo del balance diario (s)numberNoFrecuencia de actualización del balance del día (consumo, autoconsumo, energía importada y exportada). Más lenta que los valores en directo a propósito: cada actualización consume una solicitud más.
Telemetría detallada de la bateríabooleanNoAñade la energía almacenada y la temperatura de la batería, leídas en el endpoint de almacenamiento. Consume una solicitud más por ciclo de balance diario y solo afecta a los sitios con batería.
Presupuesto diario de solicitudesnumberNoLa integración deja de llamar a SolarEdge cuando alcanza este número de solicitudes en el día, para que la clave de API nunca quede bloqueada. El límite de SolarEdge es de 300 al día por sitio.
Moneda de los ingresosselectNoMoneda de los ingresos diarios que comunica SolarEdge, tal como está configurada en su sitio.

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:1.4.2), 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.1.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 🙂