eGauge Smart-Home-Integration, kostenlos und Open Source

Unofficial: eGauge energy meters on your network: power and energy of every register.
Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.
Unofficial integration, not affiliated with eGauge Systems. It reads an
eGauge energy meter (EG4xxx, EG30xx with a firmware that offers the
WebAPI) through its official WebAPI, over HTTPS on your home network,
without any cloud. Read-only: the meter is never commanded nor
configured (the /api/cmd services — reboot, clear, factory restore — and
/api/config are never called).
Never tested with a real eGauge meter: built from the WebAPI documentation (webapi.egauge.net) and the maker's egauge-python library (MIT), and tested against a fake meter built from them.
Requirements
- An eGauge meter on your network, reachable from Gladys over HTTPS (port 443 by default);
- an account of the meter (Settings > Access Control in its web interface). An account that may only view the data is enough (without the "View settings" right, the meter is identified by its certificate, see "Identity"): create one for Gladys rather than giving the owner account.
Configuration
- Meter address: its IP address (or local host name), with a port only if it is not 443. Give it a fixed address in your router.
- User name and password of the account. The password is kept by
Gladys in its database, never shown again, and never leaves Gladys: the
integration signs in with the digest login of the WebAPI (it proves it
knows the password without sending it) and gets a token valid for about
ten minutes. The user name, the password, the token and the serial number
of the meter are never written to the logs, the status nor
/data. - Certificate fingerprint (optional): see below.
- Registers counted as consumption and as production (optional): the exact register names, separated by commas, whose energy goes into the Gladys energy monitoring. A register is in one list at most.
The certificate
The meter shows a self-signed certificate, which no authority vouches for.
Nothing is sent to the meter until you confirm its certificate: at the
first read, the integration only makes the TLS handshake and shows the
SHA-256 fingerprint met in the status. Open https://<meter address> in your
browser, show the certificate and compare its SHA-256 fingerprint, then:
- click Trust the certificate: the first click reads the certificate
again (a TLS handshake, nothing sent) and gives its fingerprint; the
second, 3 seconds to 5 minutes later, trusts it if the meter still shows
the same one; the fingerprint is kept in
/data; - or copy the fingerprint into the Certificate fingerprint field and save: it is then the one that counts.
If the certificate changes later (a meter replaced or reset), nothing is sent any more and the status shows the new fingerprint: it is never learned again by itself, you confirm it the same way. The check by an authority is off for the requests to the meter only (the fingerprint decides instead), never for the whole module.
Then open the Discover tab and create the registers you want.
What you get
One device per register of a supported type, read every 30 seconds:
- Power register (type P: circuits, solar, grid):
- not listed: its power (W, signed as the meter gives it, a plain
sensor); for a register whose name ends with
+,-or|, its lifetime energy (kWh, a plain sensor, not counted); - listed as consumption: consumption power (W) and consumption index (kWh); the Gladys energy monitoring derives the consumption per half hour from it (the 30-minute feature is declared with it, Gladys fills it);
- listed as production: production power (W, the standby draw of an inverter at night shows as 0) and production index (kWh), with its production per half hour.
- not listed: its power (W, signed as the meter gives it, a plain
sensor); for a register whose name ends with
- Voltage (V), current (A), frequency (Hz) and temperature (°C) of the registers of those types.
A value outside the bounds declared to Gladys (a power beyond ±10 MW, a temperature outside −100 to 1000 °C...) is no measure: it is not published. A listed register that counts nothing (no power, or a lifetime energy at or below 0) is said in the status.
Other types (humidity, flow, irradiance...) are not offered (the status counts them).
Which registers to list?
The meter accumulates each register in W·s. The suffix of a physical
register says what it accumulates: + the positive power only, - the
negative power only (shown here with the sign turned: what was exported),
| the absolute value; without a suffix, the net power, which may go up
and down. A net register not listed therefore has no energy in Gladys: a net
value that goes down is no counter.
Typically:
- as consumption, the total use of the home (the virtual register often
named
use) and, if you want to follow them, circuits; - as production, the solar (
gen,Solar+...); - for the grid, prefer
Grid+(bought) andGrid-(sold) registers created in the meter over the netGrid.
A value read is the meter's since the creation of its database (raw):
changing the "epoch" in the meter does not make it go down.
Lifetime counters
Every lifetime energy (index or plain sensor) goes through a guard: never 0, and an impossible drop or jump is never published by itself, nor confirmed by time. The value is held back (the last good one stays), the status shows it and the device gets an orange badge. If it is right (a meter replaced, a register reset), click Accept the held values twice (3 seconds to 5 minutes apart): a jump accepted is counted at once, a drop accepted counts nothing and the counter goes on from there. Saving the configuration never accepts. A listed net register that goes down by 0.2 kWh at most (the standby draw of an inverter at night) is neither published nor held: the last value stays until it rises again.
Identity
At every read, the integration reads the serial number of the meter and
compares it with the one of the first read (a salted hash in /data, never
the number). If that number cannot be read (an account without the "View
settings" right: the WebAPI refuses it with a 401 or an error in its
answer), the registers are read all the same, and the meter is then
identified by the certificate you confirmed (the status says so); a new
certificate trusted then counts as "another meter" until your two clicks,
even when the serial number becomes readable.
Another meter at the address: nothing is published until you
accept it (two clicks on Accept the held values), so that its counters
are never mixed with the first one's.
Buttons
- Test the connection: reads the meter if a read is due (never more than one every 30 seconds), otherwise tells the last read. After a refused login, it tries once more.
- Trust the certificate: see above.
- Accept the held values: see above.
What happens when...
- The meter refuses the user name or the password: nothing is read by itself until another one is saved or Test the connection succeeds. A read refused right after a successful login (the rights of the account) is not a refusal of the password.
- The meter answers "too many requests" (429) or a 5xx error: the reads pause, from 1 minute to 6 hours (or what the meter asks), kept across a restart.
- The meter does not answer: tried again after 30 seconds, doubled up to 5 minutes.
- The latest row of the meter is more than 2 hours old (the meter's
clock, its
Dateheader): nothing is published. /datacannot be read: nothing is published nor offered (the meter cannot be identified), the button cannot trust a certificate (type the fingerprint), the file is never overwritten./datacannot be written: the lifetime counters are held back, and nothing is published until the identity of the meter is kept there (first read).
Gladys takes at most 250 values a minute from the integration: with many registers, the devices take turns.
Konfigurationseinstellungen
Diese Einstellungen fragt eGauge in seinem Konfigurationsbildschirm in Gladys ab.
| Einstellung | Typ | Pflichtfeld | Beschreibung |
|---|---|---|---|
| eGauge meter | section | Nein | Unofficial connector, not affiliated with eGauge Systems. It reads an eGauge energy meter (EG4xxx, EG30xx with a firmware that offers the WebAPI) through its official WebAPI, over HTTPS on your network, without any cloud: the power of every register (circuits, solar, grid), its voltage, current, frequency or temperature, and the energy of the registers you choose for the Gladys energy monitoring. Read-only: the meter is never commanded nor configured. Never tested with a real eGauge meter. |
| Meter address | string | Ja | The IP address (or local host name) of the meter on your home network, with a port only if it is not 443. Preferably give it a fixed address. |
| User name | string | Ja | An account of the meter, as in its web interface (Settings > Access Control). An account that may only view the data is enough (without the "View settings" right, the meter is identified by its certificate). |
| Password | secret | Ja | The password of that account. Kept by Gladys in its database, never shown again, used only to sign in to the meter above: the integration proves it knows it (digest login of the WebAPI) without ever sending it; never logged. |
| Certificate fingerprint (optional) | string | Nein | The meter shows a self-signed certificate: nothing is sent to it until you confirm it. Leave empty and use the "Trust the certificate" button, or copy here the SHA-256 fingerprint the status shows (after checking it in your browser) and save. |
| Registers counted as consumption (optional) | string | Nein | Exact register names, separated by commas, whose energy goes into the Gladys energy monitoring as consumption (an energy index). Typically the total use of the home (a virtual register often named "use") or a circuit. Leave empty: their power is still shown. |
| Registers counted as production (optional) | string | Nein | Exact register names, separated by commas, whose energy goes into the Gladys energy monitoring as production (typically the solar register, often "gen" or "Solar+"). A register is in one list at most. |
So installierst du eGauge in Gladys
- Öffne in Gladys Integrationen: eGauge erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
- Klicke auf Installieren. Gladys lädt das Docker-Image (
ghcr.io/lm1lc3n7/gladys-egauge: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-egauge.
eGauge benötigt Gladys >=5.1.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
eGauge 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