SkillAgentSearch skills...

P1ib

P1 Interface Bridge

Install / Use

/learn @remne/P1ib

README

P1IB - P1 Interface Bridge

P1IB (pronounced p-l-i-b) is a software (and hardware) designed to read and parse advanced power meter (AMS) telegrams from the P1 interface port (RJ12) and to send the result to a consumer service, for instance Home Assistant.

Visit https://remne.tech for more information.

AMS and p1ib AMS and p1ib

Features

  • Fully configurable via web UI.
    • WiFi access point
    • DHCP/static ip
    • MQTT settings
    • And lots more...
  • Dashboard in web UI with realtime updated graphs for the majority of measurement points from the power meter.
  • Supports both protocols that the Swedish meters use at this moment:
    • DLMS/COSEM AXDR/HDLC Mode E (Aidon).
    • DLMS/COSEM ASCII Mode D (The other ones).
  • MQTT support.
  • Automatic sensor registration for Home Assistant (MQTT Auto Discovery).
  • Supports OTA firmware update via web ui (official builds fetched from this github repo).
  • Webservice with JSON response of meter data.
  • Reduced data mode
  • Logging/debug through UDP to a remote computer and/or USB serial.
  • P1IB does not require any internet connection (with the exception for over-the-air firmware updates).

Hardware

The p1ib hardware comes with an RJ12 connector for connecting to the P1 HAN port of the power meter. It also includes an USB port. The USB port does not need to be connected when plugged in with the RJ12 P1 connection of the power meter. The USB port is only for debugging (and possible changing firmware) purposes. P1IB is normally powered by the P1 port.

Communication with the p1ib are done through Wi-Fi.

The hardware can normally be bought at https://remne.tech

Hardware Case

Supported smart power meters

Verified to work on the following meters:

  • Aidon 6000 & 7000 series (6534 is the most common one, both old and upgraded versions)
  • Landis-Gyr E360
  • Sagemcom T211/S211
  • Sanxing S34U18
  • Star STZ351
  • Kamstrup OMNIA
  • Itron A100/A300
  • Kaifa MA304

Will probably work on all Mode D based AMS.

Does not work on:

  • ISKRA AM550 (E.on) - E.on cannot activate the P1 port on this meter.
  • Kamstrup OMNIPOWER - p1ib can be modified to work with this meter, however, not recommended. OMNIPOWERs P1 port is not compliant with the P1-standard.

Powermeter prerequisite

To be able to get any information out from the P1 HAN interface on your powermeter, the P1 port needs to be activated.

Visit your electricity grid owners homepage for information on how to activate the P1-port on your powermeter.

First time usage

  1. Connect your p1ib with the RJ12 cable into the P1 port of your AMS. A blue LED light will pulse a couple of times to indicate that it is booting. If no blue LED is blinking, then your HAN/P1 port is not activated. See "Powermeter prerequisite" for instructions. There is no need to connect a USB cable to the p1ib. It is powered via the P1/HAN interface.

  2. P1ib enters AP mode (named "p1ib") when no SSID is configured, or connection cannot be established to the configured SSID.

Connect to Wi-Fi access point named "p1ib" without a password with your preferred device (phone or laptop for instance). You might need to disable "Mobile data" on your phone, otherwise it will try to connect via your cellular network provider.

  1. When in AP-mode, IP 192.168.1.1 is set on the p1ib. Go to http://192.168.1.1/ or http://p1ib.local/ with the webbrowser to enter the configuration user interface.

  2. Press the menu icon in top left corner, and enter the 'Settings' menu. Here it is possible to scan for your home Wi-Fi accesspoint (SSID), set an SSID password and enable other features.

Menu

  1. Once you have entered your preferred settings, press the "Save & Restart"-button.

  2. Now you need to change back to your home Wi-Fi on your mobile phone/laptop. If you are using a device capable of mDNS (all computers more or less, probably not mobile devices) go to url http://p1ib.local/. If you are using a mobile device, you probably need to check in your home router for the IP the p1ib was assigned by your dhcp server, ie go to http://some-ip-number/

  3. When entering http://p1ib.local/ (or the IP number) in the webbrowser url you will once again see the dashboard. If you selected correct power meter option in the settings page you will see the graphs beeing updated with your current power consumption.

  4. At this point it is recommended press the menu icon once again. If the "firmware" menu option have an red badge with an '!' on it, it means that there is a new firmware available. It is recommended to always update to the latest recommended firmware in the firmware-page.

Menues

Dashboard

The dashboard provides an overview of the current state of the p1ib, and also graphs for some of the measurement points available.

Dashboard

Settings

Settings

Advanced Settings

Advanced Settings

Reduced Data Mode

The reduced data mode can be activated if you want to save bandwidth. This is useful for example for remote power monitoring in your summer house or similar where there might be a bandwidth cost from your internet service provider.

Each measurement point can be enabled or disabled, and there is also a hysteresis on each obis code to further limit data bandwidth.

Reduced Data Mode

Firmware update

When a new firmware is available, a red badge will be visible in the Firmware menu. The latest stable firmware is marked with the "recommended" text. To update the firmware, click on the firmware-download icon for the firmware that you want to update to.

Firmware badge

Firmware update

Home Assistant

An MQTT broker is needed to communicate with Home Assistant. The MQTT broker must be installed separately, and is normally not provided by default in an Home Assistant installation.

Please read the Home Assistant MQTT documentation at https://www.home-assistant.io/integrations/mqtt/ if you dont have an MQTT broker installed.

Configure MQTT in P1IB

Enable the MQTT client in the settings menu. Enter your IP/hostname and port number for your mqtt broker. If authentication is used, username and password must be provided. Once activated and connected, the plib will register a sensor in HA for each measurement point.

Make sure that the MQTT State shows connected in the dashboard.

MQTT state

<br> The p1ib registers the sensors in Home Assistant at each startup of the p1ib.

HA Device view HA Energy Dashboard

Setup the Energy board with p1ib sensors

Home Assistant needs som manual configuration to enable it to collect energy statistics over time, and to make the "energy"-dashboard show any p1ib based information.

  1. In Home Assistant press "Settings -> Dashboards -> Energy"
  2. Add sensors for consumption and return to grid:

Energy import export

  1. It will take a couple of hours for Home Assistant to collect data. If it is working as expected, your should finally, after some time, have an dashboard with some nice looking graphs:

Examples of cards in Home Assistant

Apex charts with energy consumption and electricity spot price from nordpool

Energy graph

  1. Install apex charts card https://github.com/RomRider/apexcharts-card and nordpool integration https://github.com/custom-components/nordpool

  2. Create a per hour energy (kWh) sensor based on the p1ib energy import sensor.

    • Go to home assistant
    • Click Settings -> Devices & Services -> Helpers
    • Click "+ CREATE HELPER"-button
    • Press "Utility Meter"
    • Name the sensor "energy_consumption_kwh_hour"
    • Select sensor "sensor.p1ib_active_energy_import_q1_q4
    • Meter reset cycle: hourly
    • Press "Submit"
  3. Go to your dashboard of choice in home assistant, press the "..." icon and "Edit dashboard".

    Edit dashboard

View on GitHub
GitHub Stars71
CategoryDevelopment
Updated2d ago
Forks5

Languages

Python

Security Score

80/100

Audited on Mar 29, 2026

No findings