Skip to main content

SiL Lausanne smart home integration, free and open source

SiL Lausanne integration for Gladys Assistant

Track your SiL Lausanne smart electricity meter: grid consumption, solar feed-in and cost.

Track your Services Industriels de Lausanne (SiL) smart electricity meter in Gladys: grid consumption every 30 minutes, priced by Gladys with your energy contract, and the solar feed-in (refoulement).

Data comes from the SiL "Ma consommation" portal, which publishes the meter readings with a delay of one day or more (sometimes weeks): this is not real-time metering. Self-consumed solar energy is not measured by the meter, so only grid import and grid export are known.

Requirements​

  • A SiL Lausanne account with a smart meter ("Ma consommation" section).
  • Gladys >= 5.2.0 (energy contracts).

Configuration​

  1. Account. Enter the email and password of your lausanne.ch account. The integration logs in by itself, and logs in again when the portal session expires. The password is only sent to www.lausanne.ch, never logged, and kept in the Gladys configuration only.
  2. Contract. If your account holds several SiL contracts (for example after a move), enter the contract reference of the current one (shown in the contract selector at the top of the portal): the portal only returns the readings of the activated contract. Otherwise leave it empty.
  3. Leave Meter device id and Logical register numbers empty: they are read from the portal after logging in (fill them in only to override them). Once the device is created, never change the meter id: it names the device.
  4. Click Test the SiL connection: it shows the newest day available.
  5. In Discovery, add the Compteur SiL Lausanne device.
  6. Click Import the full history (backfill) to load the available past. A long history goes on in the background after the button answers.

Cost: your energy contract​

The integration computes no cost. Create your contract in Gladys and attach it to this meter:

  1. Open Energy Monitoring → Contracts → Create.
  2. Meter: select the Compteur SiL Lausanne device.
  3. Template / parameters: pick or describe your SiL tariff, with its peak (HP) and off-peak (HC) hours and prices.

Gladys then prices every 30-minute slot of Grid consumption (30 min) with the contract, HP and HC hours included, and shows it in the energy widgets. A reading published late by SiL is priced when it arrives.

Device and features​

One Compteur SiL Lausanne device with:

FeatureCategory / typeRole
Grid consumption (30 min)energy-sensor / thirty-minutes-consumptionHP + HC import, priced
Grid feed-in (index)grid-sensor / output-indexcumulative refoulement (daily)

The newest day published by SiL is often incomplete: the integration re-publishes it at the next sync until it is complete.

Updating from an earlier version​

Earlier versions published cumulative indexes and their own cost. Those features are no longer fed: in Discovery, update the device to get the new Grid consumption (30 min) feature (and delete the old features if you wish), then click Import the full history again.

Login problems​

  • "Login failed, check the email and password": the portal refused the credentials. The integration stops trying until you change them (so the hourly sync cannot lock your account); Test the SiL connection retries on demand.
  • "Unexpected login step": the portal probably asks you to accept new terms of use. Log in once in a browser, accept them, then test again.

Already-imported history is kept; the sync resumes where it stopped.

Without storing your password​

You can leave the email and password empty and paste a session cookie instead: log in to the portal, open a period in "Ma consommation", open the developer tools (F12) → Network → a diamond-smart-data request → right-click → Copy → the Cookie: request header. This cookie expires after a few days and must then be pasted again. It is ignored when an email and password are set.

Configuration settings​

These are the settings SiL Lausanne asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
SiL Lausanne accountsectionNoThis integration reads the 15-minute readings of your SiL smart meter from the "Ma consommation" portal (published with a delay of one day or more). Enter the email and password of your lausanne.ch account: the integration logs in by itself, and again when the session expires. The cost is computed by Gladys from the energy contract you attach to this meter (Energy Monitoring).
Account emailstringNoThe email you use to log in to your lausanne.ch account.
Account passwordsecretNoYour lausanne.ch password. It is only sent to www.lausanne.ch to log in, and never logged.
Contract reference (optional)stringNoIf your account holds several SiL contracts (e.g. after a move), the reference of the current one, shown in the contract selector at the top of the portal. The portal only returns the readings of the activated contract. Leave empty to use your default contract.
Session cookie (optional)secretNoOnly if you do not want to store your password: the full Cookie header of an authenticated session (DevTools -> Network -> a diamond-smart-data request -> Copy -> request headers). It expires after a few days. Ignored when an email and password are set.
Meter device id (optional)stringNoLeave empty: it is read from the portal after logging in. It names the device in Gladys: once the device is created, never change it (a new value creates a new, empty device).
Logical register numbers (optional)stringNoLeave empty: the meter's registers are read from the portal after logging in. Fill in only to override them (comma-separated list).
History start date (YYYY-MM-DD)stringNoEarliest day to import on the first backfill. Leave empty to start ~13 months back (the portal keeps limited history).
Refresh interval (s)numberNoHow often the portal is polled, in seconds. Data is daily, so one hour is plenty (one minute minimum).

How to install SiL Lausanne in Gladys​

  1. In Gladys, open Integrations: SiL Lausanne appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/sylvainpelissier/gladys-sil:0.0.1), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/sylvainpelissier/gladys-sil.

SiL Lausanne requires Gladys >=5.2.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

SiL Lausanne is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by sylvainpelissier, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂