Sense Energy Monitor Smart-Home-Integration, kostenlos und Open Source

Unofficial: Sense energy monitor (US/Canada), live power, daily energy and detected devices.
Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.
Unofficial connector, not affiliated with Sense Labs. It brings your Sense energy monitor (United States and Canada) into Gladys: the power your home consumes (and produces, with solar) in real time, the voltage and the frequency, the hourly consumption for the Gladys energy monitoring, and, as an option, the devices Sense detected. It uses the same cloud API as the Sense app, which Sense does not document and may change at any time.
Never tested with a real Sense monitor or account. It was built from the sense-energy library used by Home Assistant and tested against sample answers only. Please report what works and what does not.
What you get
| Surface | Content |
|---|---|
| One device per Sense monitor | power consumed (W), voltage L1 and L2 (V), frequency (Hz), the 30-minute consumption for the energy monitoring |
| With solar | power produced (W), grid power (W, signed: positive when importing, negative when exporting) |
| Option Devices detected by Sense | one device per appliance Sense detected: on/off and power (W), read only |
| Buttons | Test the connection, Enter the two-factor code |
Installation
- Install the integration, enter the e-mail and password of your Sense account, and save.
- If your account uses two-factor authentication, the status asks for a code: click Enter the two-factor code and type the current 6-digit code of your authenticator app. Done once: the session is then kept and renewed by itself, also after a restart.
- Click Test the connection: the monitor and the real-time state show.
- Open Discovery and add the Sense monitor (and the detected devices, if you turned the option on).
Energy monitoring
The real-time feed gives power, not energy. The integration therefore reads Sense's hourly consumption every 15 minutes and publishes each finished hour of today and yesterday as two dated half hours on the "Consumption (30 min)" feature: the energy monitoring gets the right energy in the right half hour, and can price it with your contract; the energy of a day is the sum of its half hours. Yesterday is read again at every refresh during the first 3 hours of the day (monitor time), for its last hours. Only today and yesterday are read: no older history is filled in, so a Gladys stopped for more than a day keeps a gap. The production, the import and the export have no daily total yet (the grid power shows the exchange in real time).
Detected devices
With the option on, every appliance Sense lists in its app (hidden and merged ones left out) becomes a device with its on/off and its power. Sense needs time to detect appliances, and its detection can be wrong; the devices are read again every 6 hours. These states are optional: when the Gladys state budget is reached, they wait for the next minute, never the monitor's.
Limits
- Sense accounts of the United States and Canada; the first monitor of the account only.
- Calls: one real-time WebSocket; today's hourly consumption every 15 minutes, yesterday's once a day (at every refresh during the first 3 hours of the day), the detected devices every 6 hours. Published states: the monitor at most every 10 seconds, the power of the detected devices at most every minute.
- Reconnection of the real-time feed: from 5 seconds up to 5 minutes, with a random part. After a failed sign-in: 5, 15, then every 60 minutes. Refused e-mail or password: every 6 hours. When Sense asks to slow down (429), every call waits the time asked (15 minutes otherwise), between 1 minute and 6 hours.
- Gladys has no frequency unit: the frequency is a plain number.
- The half hours are those of the monitor's clock hours: a time zone offset by 45 minutes (Gladys or monitor) does not fit the 30-minute grid of Gladys, and the energy monitoring then refuses them.
Troubleshooting
- "Sense refused the e-mail or the password": check them in the Sense app, correct them and save.
- "Your Sense account asks for a two-factor code": use Enter the two-factor code. A refused code: type the current one (it changes every 30 seconds).
- Real time "connecting…" for long: the monitor may be offline; the feed reconnects by itself.
- No energy in the energy monitoring: check that the Sense monitor device is created; the hours appear once finished.
- Logs: set the integration's
LOG_LEVELvariable.
Privacy
The password is kept by Gladys in its database, not encrypted (in clear in
the Gladys database and in its backups), never shown again, and only sent to
api.sense.com to sign in. The session tokens (access and refresh) are kept in
the same place, also not encrypted, in the integration's configuration, outside
the form. Protect the Gladys backups accordingly.
Nothing is logged with the e-mail, the password or a token.
Credits
The API logic is ported from sense-energy (MIT, © 2018 Scott Belisle), the library of the Home Assistant Sense integration.
Konfigurationseinstellungen
Diese Einstellungen fragt Sense Energy Monitor in seinem Konfigurationsbildschirm in Gladys ab.
| Einstellung | Typ | Pflichtfeld | Beschreibung |
|---|---|---|---|
| Sense account (United States and Canada) | section | Nein | Unofficial connector, not affiliated with Sense Labs: it uses the same cloud API as the Sense app, which Sense does not document and may change. Enter the e-mail and password of your Sense account. If your account uses two-factor authentication, save, then enter the 6-digit code of your authenticator app with the "Enter the two-factor code" button below: the session is then kept and renewed by itself. |
| Sense e-mail | string | Ja | |
| Sense password | secret | Ja | Kept by Gladys in its database, never shown again, and only sent to api.sense.com to sign in. The session tokens are kept in the same place. |
| Devices detected by Sense | boolean | Nein | Also offer one device per appliance Sense detected (on/off and power, read only). |
So installierst du Sense Energy Monitor in Gladys
- Öffne in Gladys Integrationen: Sense Energy Monitor erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
- Klicke auf Installieren. Gladys lädt das Docker-Image (
ghcr.io/lm1lc3n7/gladys-sense: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-sense.
Sense Energy Monitor 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
Sense Energy Monitor 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