Skip to main content

P1 Monitor smart home integration, free and open source

P1 Monitor integration for Gladys Assistant

Unofficial: P1 Monitor (ztatz) on your network: smart meter power, indexes, gas, water.

Unofficial integration, not affiliated with P1 Monitor (ztatz). It reads P1 Monitor, the software (often on a Raspberry Pi) plugged into the P1 port of your smart meter (Belgium, Netherlands), through its local API, without any cloud or account.

Never tested with a real P1 Monitor. The integration was written from the p1monitor library (used by Home Assistant) and simulated answers. Your feedback on the Gladys forum is welcome.

This is not…​

  • the DSMR Reader integration (by GBoulvin), which reads another software, DSMR Reader;
  • the YouLess integration, which reads the YouLess box;
  • the HomeWizard integration, which reads the HomeWizard box (P1 Meter).

Use the one that matches what is plugged into your meter: two of them on the same meter would count the consumption twice in the energy monitoring.

What you get​

One "P1 Monitor" device, with only what your meter gives:

ValuePaceType in Gladys
Power taken from the grid (W)10 senergy sensor, power
Power injected into the grid (W)10 splain sensor
Consumption index (kWh): low tariff + high tariff1 minenergy sensor, index: energy monitoring
Consumption index per tariff, low and high (kWh)1 minplain sensors
Injection index, total and per tariff (kWh)1 minplain sensors, never billed
Current tariff (1 = low, 2 = high)1 minplain sensor
Per phase: power taken and injected (W), voltage, current10 ssensors without history by default
Gas (m³)1 minvolume sensor, out of the energy monitoring
Water (m³), when a water meter is wired to P1 Monitor5 minvolume sensor, out of the energy monitoring
Prices set in P1 Monitor (€/kWh, €/m³)15 minplain sensors

The Gladys energy monitoring derives the consumption per half hour and its cost from the consumption index by itself (low + high tariff of the meter, two cumulative counters: never a daily total, never the injection). Injection, gas and water stay apart: Gladys would price gas at the electricity tariff, and the injection would be counted as a consumption. The P1 Monitor prices are only shown: the cost in Gladys comes from your Gladys energy contracts.

"Low tariff" and "high tariff" are the names P1 Monitor uses (LOW and HIGH, "dal" and "piek"; tariff code D or P). On a Belgian meter, where tariff 1 is the day tariff, check which one matches your bill (not verified).

Installation​

  1. Preferably give the device running P1 Monitor a fixed IP address in your router. If it changes, enter the new one: the Gladys device (one per integration) and its history are kept.
  2. In Gladys, install the P1 Monitor integration from the store, open its configuration and enter the address (e.g. 192.168.1.40, with :port only if it is not 80).
  3. Click Test the connection: the power and index read are shown.
  4. In the Discover tab, create the P1 Monitor device. The values arrive at once.

The API is read over plain HTTP on your network, without a password (as Home Assistant does); the HTTPS of P1 Monitor is not used.

Good to know​

  • P1 Monitor unreachable: the integration status says so, and it tries again after 10 s, then 20 s, 40 s… up to 5 minutes, never giving up. Saving the configuration tries again at once.
  • Secondary pages (phases, prices, water meter) failing: the power and the indexes go on; the status says so, and the page is tried again every 5 minutes. Without a water meter, the water page is asked again only once an hour (a meter added later appears).
  • Frozen reading: when P1 Monitor gives the same meter reading for 5 minutes (P1 cable unplugged, reading stopped), the power and the phases are no longer sent (they would look current) and the status says so.
  • Consumption index protected (Gladys counts every rise in full):
    • an index at 0 is never sent, nor a partial sum: a tariff missing, a tariff that was above 0 and reads 0, or a single tariff dropping give no index for that reading (a register glitching is not a drop). The tariff and injection indexes, gas and water are never sent at 0 either;
    • a drop of both tariffs (meter replaced or reset) is never accepted by itself, not by time either: it is held, the last accepted value is sent again to Gladys, and the integration status shows it. If the values come back, they go on normally, without any fictive kWh;
    • a jump up (more than 100 kW on average since the last accepted value) is never accepted by itself, not by repetition, not by time, not by a restart: every value at or above it stays held (the hold is kept in /data), the last accepted value is sent again to Gladys, and the status shows the jump, even while the P1 Monitor is unreachable;
    • to accept a held value, click Accept the held index in the configuration of the integration. The action takes exactly the value shown (plus what the home may use until the next read) and answers with what will be counted: for a jump, the difference (for instance 5000 kWh) will be counted at once as consumption, accept only if this energy was really consumed; for a drop, nothing is billed and the consumption goes on from there. Another value read afterwards stays held. Saving the configuration never accepts anything;
    • if a register stays stuck (for instance a new meter with a tariff staying at 0 when it was not) and the status keeps saying "no index", the way out is to delete the device and create it again from the Discover tab: its reference starts again;
    • the 100 kW margin counts from the last accepted value: after a long outage it grows (24 hours of outage let up to 2400 kWh through at once). A frozen reading (same value) does not move the date of the last value, so that the recovery is not taken for a jump.
  • Unchanged values are sent again only every 10 minutes; on each reconnection to Gladys, the device, all its values and the status are published again.
  • The features of the device are fixed when it is created: if a value appears later (first solar panels, a water meter), click "Update" in the Discover tab: the new values arrive at once. The device published again never loses a feature of the created one, even if a value is missing for a while.
  • The injection (power, indexes, injection prices) appears only once it is above 0: a home without panels does not see these values.

Limits​

  • One P1 Monitor per installation of the integration.
  • The dynamic tariffs and the history of P1 Monitor are not read.
  • No protected access (password, HTTPS): the local API must be reachable over HTTP from Gladys.

Credits​

API reading ported from p1monitor (MIT, Klaas Schoute). P1 Monitor is a software by ztatz. Integration code under the Apache-2.0 license.

Configuration settings​

These are the settings P1 Monitor asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
P1 MonitorsectionNoUnofficial connector, not affiliated with P1 Monitor (ztatz). It reads your P1 Monitor, the software plugged into the P1 port of your smart meter (Belgium, Netherlands), through its local API, without any cloud: the power taken and injected every 10 seconds, the electricity index every minute for the Gladys energy monitoring, and, when the meter gives them, the indexes per tariff, the injection, the phases, gas, water and the prices set in P1 Monitor. Gas and water are plain sensors in m³: they stay out of the energy monitoring. Not the DSMR Reader, YouLess or HomeWizard integrations. Never tested with a real P1 Monitor.
P1 Monitor addressstringYesThe IP address of the device running P1 Monitor 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: the device and its history are kept.

How to install P1 Monitor in Gladys​

  1. In Gladys, open Integrations: P1 Monitor appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/lm1lc3n7/gladys-p1-monitor:0.1.2), 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/LM1LC3N7/gladys-p1-monitor.

P1 Monitor 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​

P1 Monitor 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 LM1LC3N7, 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 🙂