Zum Hauptinhalt springen

Iskra Smart-Home-Integration, kostenlos und Open Source

Iskra-Integration für Gladys Assistant

Unofficial: Iskra meters behind a Smart Gateway, on your network: power and indexes.

Info

Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.

Unofficial integration, not affiliated with Iskra. It reads the Iskra energy meters connected to an Iskra Smart Gateway (SG), through the local REST API of the gateway: no cloud, no account, nothing sent to the gateway but read requests (GET), one round every 30 seconds at most.

Never tested with a real Iskra gateway: it was built from the maker's own Python library (pyiskra, the one Home Assistant uses). Feedback welcome.

Supported meters​

The meters the library reads behind a Smart Gateway: IE38, IE35, IE14 (IMPACT), WM3M4, WM3, WM1, MC, iMC, MT, iMT (Measuring Centres). Other models listed by the gateway are named in the status and not read. At most 16 meters are read (the others are counted in the status). A meter reached directly over Modbus TCP, without the gateway, is not supported yet.

The consumption index comes from the non-resettable energy registers: the IE38, IE35, IE14, WM3 and WM3M4 have them. For the MC, iMC, MT, iMT and WM1, pyiskra only knows resettable registers: these meters give no consumption index (power and phases only), and the status says so.

What you get​

One device per meter, named after its model and serial number (Iskra IE38MD 41000001), with the values the meter gives:

FeatureKind
Active power (see below)energy sensor, W
Consumption indexenergy index, kWh
Injection index (kWh)plain sensor
Voltage L1, L2, L3energy sensor, V, no history
Current L1, L2, L3energy sensor, A, no history
Power L1, L2, L3 (W)plain sensor, no history
Power factor, frequency (Hz)plain sensor, no history
Meter temperaturedevice temperature, °C, no history
  • The consumption index feeds the Gladys energy monitoring: Gladys derives the consumption and its cost from it. It comes from the first non-resettable register of active energy imported by the meter (chosen the first time the meter is read, then kept with its position and its name). If another register takes its place, the index waits (status note). Deleting and creating the device again chooses the register again. It is published once a minute at most and checked first: never 0; any drop, even of 1 Wh, or a jump larger than the meter could have measured (the "highest plausible power" of the configuration, 100 kW by default, over the time since the last value) is held back (the last accepted value is sent again) and shown in the integration status. If it is right (a new meter, a long outage), click Accept the held index twice (see Buttons). Saving the configuration never accepts it.
  • The injection (the first non-resettable register of active energy exported) is never in the energy monitoring (it would be billed as consumption): a plain sensor.
  • The resettable registers are not read: a register that can be reset is never an index.
  • The active power is the total of the meter. Its sign when the site injects is to be confirmed on a real meter (probably negative).
  • The live values are sent at each read, only when they change (and every 10 minutes otherwise). The interval grows with many meters (8 seconds per meter, so 80 seconds with 10 meters), so that Gladys never receives more than it accepts.
  • When all the live values of a meter (voltages to 0.1 V, frequency to 0.01 Hz, currents...) stay exactly the same for 15 minutes, the gateway is probably serving an old copy: they are no longer sent and the status says so, also after a restart. The index is not affected.

Setup​

  1. Find the IP address of the Smart Gateway (in your router, or the Iskra tools) and preferably give it a fixed address in your router.
  2. In Gladys, open the integration, enter this address. If the web interface of the gateway asks for a login, enter its user name and password too; otherwise leave them empty. Save.
  3. In the Discover tab, create the device of each meter.

The login​

The password is kept by Gladys in its database, never shown again, never written in the logs. It is sent only to the address of the gateway, as the gateway asks: in a cookie, over plain HTTP on your network (the gateway offers nothing else). If the gateway refuses the login, the reads stop and the status says so: correct the user name or the password and save, or click Test the connection to try once more. The integration never tries a refused login again by itself, even after a restart. To recognise "the same login" after a restart, it keeps in /data only 8 bits of a salted hash of the refused password (never the password itself).

Buttons​

  • Test the connection: reads the gateway once when a read is due (never more than one every 30 seconds), otherwise tells the last read: the gateway, its meters, their power and index. After a refused login, it tries once more; only a success lifts the refusal.
  • Accept the held index, in two clicks. The first click lists the indexes held back, per meter, and takes nothing. The second click, a few seconds to 5 minutes later, takes exactly what the first listed, and for each meter only if its held value has not changed since (beyond what the meter may have measured meanwhile); a meter held after the first click is never taken. A jump is counted at once as consumption; a drop bills nothing.

When something goes wrong​

  • Unreachable or wrong answer: new try after 30 seconds, then doubled up to 10 minutes.
  • The gateway asks to wait (429) or fails (5xx): reads paused from 1 minute to 6 hours, also after a restart.
  • One meter cannot be read (its page refused, failing or not answering): the others go on, and the status names it. A round stops starting new meters after about a minute: the meters left go first the next time.
  • The list of meters changes during a read: the meter whose port changed gets nothing from that read. Each meter is keyed by its serial number: its values never go to another meter's device.
  • The same serial number on two ports (one meter seen through two interfaces, or two meters with a default number): those ports are not read, nor offered in Discovery; the status names them.
  • The register of the index changed (another register at its place, after the registers were set up again): the index waits, the status says so; delete and create the device again to choose the register again.

Privacy​

Everything stays on your network. The integration only sends GET requests to the address you entered, with the login when you gave one.

Konfigurationseinstellungen​

Diese Einstellungen fragt Iskra in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
Iskra Smart GatewaysectionNeinUnofficial connector, not affiliated with Iskra. It reads the Iskra meters (IE38, IE35, IE14, WM, MC, iMC, MT, iMT) connected to an Iskra Smart Gateway (SG), through the local REST API of the gateway, without any cloud: one device per meter with its active power, the voltage, current and power of each phase, the frequency, the power factor and the temperature, and, for the meters with non-resettable energy registers (IE38, IE35, IE14, WM3, WM3M4), its consumption index for the Gladys energy monitoring (the injection as a plain sensor); MC, iMC, MT, iMT and WM1 meters give no index. Read-only. A meter reached directly by Modbus TCP is not supported yet. Never tested with a real Iskra gateway.
Gateway addressstringJaThe IP address of the Smart Gateway on your network (shown by your router), with a port only if it is not 80. Preferably give it a fixed address in your router; if it changes, enter the new one: each meter keeps its device and history (they are keyed by their serial number).
User name (optional)stringNeinOnly if the web interface of the gateway asks for a login: its user name. Leave empty otherwise.
Password (optional)secretNeinThe password of that login. Kept by Gladys in its database, never shown again, never logged, sent only to the gateway address above (plain HTTP on your network, as the gateway asks). If the gateway refuses it, reads stop until you change it or click "Test the connection".
Highest plausible power of a meter (kW)numberNeinThe guard of the consumption index holds back a rise larger than this power over the time since the last value (100 kW by default). Raise it only for a meter of a large installation.

So installierst du Iskra in Gladys​

  1. Öffne in Gladys Integrationen: Iskra erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
  2. Klicke auf Installieren. Gladys lädt das Docker-Image (ghcr.io/lm1lc3n7/gladys-iskra:0.1.1) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration).
  3. Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
  4. Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/LM1LC3N7/gladys-iskra.

Iskra benötigt Gladys >=5.2.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​

Iskra 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.

Abonniere den Newsletter von Gladys Assistant

Ein paar E-Mails im Monat zu neuen Releases und Neuigkeiten aus dem Projekt. Verschickt von Pierre-Gilles Leymarie, dem Gründer des Projekts. Jederzeit abbestellbar 🙂