Zurich Power Tariffs (EKZ) Smart-Home-Integration, kostenlos und Open Source

Unofficial: EKZ quarter-hour electricity tariffs (Zurich), dynamic or fixed, for scenes.
Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.
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
- Install the integration (Gladys 5.3.0 or later).
- 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_Efor Einsiedeln);- the fixed tariffs
400ST(standard),400F,400WP(heat pump), all-in, for EKZ and EKZ Einsiedeln.
- Optionally set Cheap quarters per day and Expensive quarters per day (16 each by default, 4 hours; 0 to 48) for the scene triggers.
- 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_400STforintegrated_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 thesourceof 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.
Konfigurationseinstellungen
Diese Einstellungen fragt Zurich Power Tariffs (EKZ) in seinem Konfigurationsbildschirm in Gladys ab.
| Einstellung | Typ | Pflichtfeld | Beschreibung |
|---|---|---|---|
| EKZ electricity tariffs | section | Nein | Unofficial, 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_select | Ja | 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 day | number | Nein | The cheapest quarters of the day that count as "low price" for the scene triggers (16 = 4 hours; 0 = none). |
| Expensive quarters per day | number | Nein | The dearest quarters of the day that count as "high price" (16 = 4 hours; 0 = none). |
So installierst du Zurich Power Tariffs (EKZ) in Gladys
- Öffne in Gladys Integrationen: Zurich Power Tariffs (EKZ) erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
- Klicke auf Installieren. Gladys lädt das Docker-Image (
ghcr.io/lm1lc3n7/gladys-zurich-power-tariffs:0.1.1) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration). - Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
- Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/LM1LC3N7/gladys-zurich-power-tariffs.
Zurich Power Tariffs (EKZ) benötigt Gladys >=5.3.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.
Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.
Über externe Integrationen
Zurich Power Tariffs (EKZ) ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von LM1LC3N7 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.
- Alle Integrationen durchsuchen, native und aus der Community
- Deine eigene externe Integration bauen und veröffentlichen
- Quellcode auf GitHub — Quelle dieser Dokumentation