Saltar al contenido principal

Integración domótica Zurich Power Tariffs (EKZ), gratuita y de código abierto

Integración Zurich Power Tariffs (EKZ) para Gladys Assistant

Unofficial: EKZ quarter-hour electricity tariffs (Zurich), dynamic or fixed, for scenes.

info

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

Unofficial integration, not endorsed by EKZ. It shows the electricity tariffs of EKZ (Elektrizitätswerke des Kantons Zürich) for every quarter of an hour: the dynamic tariff (EKZ Energie Dynamisch + EKZ Netz 400D, prices that change every 15 minutes) or a fixed tariff (400ST, 400F, 400WP), for EKZ and EKZ Einsiedeln. Data: the public EKZ Tariffs API, without an account or a key. Nothing is ever controlled: the integration only reads prices; your scenes decide what to do with them.

It has never been tested with a real EKZ contract or a real EMS: the reading is checked against real answers of the API (December 2026) by the tests, and the API was called for real from a test machine. Please report any difference with your bill.

Your tariff: choose it yourself​

The public API gives every EKZ tariff; it does not know your metering point. Pick yours (on your bill or in myEKZ). Limits to know:

  • the dynamic grid tariff (Netz 400D) depends on the network area of your transformer station (EKZ "Tarifcluster"); the public API gives one profile, so your bill may differ slightly. The per-customer endpoint of EKZ (/customerTariffs, myEKZ login, EMS registration with EKZ) is not used in this version;
  • prices are without VAT (8.1 %) and without the regional fees (energy efficiency fund, concession fees); the monthly base fees are not counted.

Set up​

  1. Install the integration (Gladys 5.3.0 or later).
  2. In its configuration, choose your tariff(s) (6 at most, one device each):
    • EKZ dynamic tariff 400D: energy + grid + national fees (integrated_400D), the all-in price of the dynamic tariff; Einsiedeln: integrated_400D_E;
    • EKZ Energie Dynamisch: energy only (electricity_dynamic);
    • EKZ Netz 400D with national fees: grid only (grid_400D_inclFees, and _E for Einsiedeln);
    • the fixed tariffs 400ST (standard), 400F, 400WP (heat pump), all-in, for EKZ and EKZ Einsiedeln.
  3. Optionally set Cheap quarters per day and Expensive quarters per day (16 each by default, 4 hours; 0 to 48) for the scene triggers.
  4. Create the devices in Discovery.

Each device has six read-only features, in CHF per kWh without VAT: price now, next quarter, today's lowest, today's highest, today's average and tomorrow's average. A value not known yet (tomorrow before its publication, the next quarter at 23:45) is not published: it never shows as 0. Gladys keeps the last value of a feature until a new one comes, so a tile without a new value is not emptied: from midnight until the tomorrow prices come (about 18:05), "Tomorrow average" still shows the previous value (the average of the day that has just started); during an outage, "Price now" stays at the last quarter known. Look at the time of the value.

When prices are read​

EKZ publishes tomorrow's dynamic prices every day before 18:00. The integration reads each day once: today's at the start if it does not hold them yet, tomorrow's from 18:05, again every 30 minutes until they come. A day fully read is not read again (EKZ: once published, prices do not change), unless /data was unreadable at a restart. What was read is kept in /data (yesterday to tomorrow), so a restart makes no new request. A day that has started without its prices is asked again every hour (a dynamic day: once after its deadline, it would be published too late anyway).

Errors: a network error or an unreadable answer is retried after 5 minutes, then 10, 20 and so on up to an hour (30 minutes for tomorrow). A 429 or a 5xx answer pauses every request for what EKZ asks (Retry-After), at least a minute, doubling up to 6 hours; the pause survives a restart. Requests go one at a time, at least 5 seconds apart, with the integration's own User-Agent, answers cut at 256 kB and 30 seconds.

Fallback: the standard tariff​

EKZ rule: if the dynamic prices of a day are not available on its API in time (2026: by midnight; from 2027, the tariff sheet says by 20:00 the day before), the standard tariff applies that day (EKZ Energie Erneuerbar, EKZ Netz 400ST). The integration follows it:

  • before that deadline, a day without prices stays unknown (nothing shown);
  • after it, the integration reads the standard counterpart (integrated_400ST for integrated_400D, electricity_standard, grid_400ST_inclFees) and shows it, said in the status ("the standard tariff applies"), in the Test button ("standard tariff, fallback") and in the source of the scene events (standard);
  • dynamic prices published after the deadline do not count (the standard tariff applies, says EKZ);
  • the integration cannot tell its own network outage from an EKZ outage: if it reads the dynamic prices later and their publication time is before the deadline, they replace the fallback.

Scene triggers​

  • EKZ low price started / ended: the current quarter is (is no longer) one of the N cheapest of the day (N = "Cheap quarters per day").
  • EKZ high price started / ended: the same with the N dearest.

Ties go to the earlier quarter. A quarter at the day's highest price is never "cheap", one at its lowest never "expensive": a flat day (fixed tariff, the fallback) has no low or high price. Variables: price (CHF/kWh), level (cheap, normal, expensive), source (dynamic, standard, fixed) and next_change (ISO time of the next change of level, empty when unknown).

One event per change, at the start of the quarter (a few seconds after). The first level seen after an installation is only recorded; a restart inside a period does not announce it again; a change missed while the integration was stopped for more than 2 hours is not announced. For an absolute threshold ("price below 0.20"), use the device's price now in a Gladys "device value" trigger.

Test button​

Shows, for each tariff, the price now and its source, the next quarter's, today's range and average and tomorrow's average. It makes no request.

Status​

"N tariff(s) followed. Prices of today known for K of them", then, when it applies: the fallback in use, a tariff without price for today, the last failed request, a pause asked by EKZ, /data unreadable, values of the configuration ignored. "Connected" means at least one tariff has its prices of today.

Data and credits​

Source: EKZ Tariffs API (https://api.tariffs.ekz.ch), Elektrizitätswerke des Kantons Zürich. EKZ does not endorse this integration; the prices shown are not a bill. Details in THIRD_PARTY_NOTICES.md.

Parámetros de configuración​

Estos son los parámetros que Zurich Power Tariffs (EKZ) te pide en su pantalla de configuración en Gladys.

ParámetroTipoObligatorioDescripción
EKZ electricity tariffssectionNoUnofficial, not endorsed by EKZ. Reads the public EKZ Tariffs API (no account, no key) once a day: tomorrow's prices after 18:00. Choose YOUR tariff below: the public API does not know your metering point, and the dynamic grid part of 400D depends on your local network area, so your bill may differ slightly. Prices are in CHF per kWh without VAT, regional fees not included. If the dynamic prices of a day are not published in time, EKZ applies its standard tariff that day: the integration then shows the standard tariff and says so.
Your tariff(s)multi_selectSíOne device each (6 at most). Pick the tariff of your contract: 400D for the dynamic tariff, "energy only" or "grid only" to follow one part.
Cheap quarters per daynumberNoThe cheapest quarters of the day that count as "low price" for the scene triggers (16 = 4 hours; 0 = none).
Expensive quarters per daynumberNoThe dearest quarters of the day that count as "high price" (16 = 4 hours; 0 = none).

Cómo instalar Zurich Power Tariffs (EKZ) en Gladys​

  1. En Gladys, abre Integraciones: Zurich Power Tariffs (EKZ) 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/lm1lc3n7/gladys-zurich-power-tariffs:0.1.1), 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/LM1LC3N7/gladys-zurich-power-tariffs.

Zurich Power Tariffs (EKZ) requiere Gladys >=5.3.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​

Zurich Power Tariffs (EKZ) 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 LM1LC3N7, 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 🙂