Giter Club home page Giter Club logo

p1ib's Introduction

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


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

  4. Press the button "+ ADD CARD". Scroll to the bottom and select under Manual, "Need to add a custom card or just want to manually write the YAML?"

Paste the following code into the editor window:

type: custom:apexcharts-card
graph_span: 60h
experimental:
  color_threshold: true
header:
  title: Energy usage and cost estimation (nordpool)
  show: true
apex_config:
  yaxis:
    min: 0
hours_12: false
span:
  start: hour
  offset: '-22h'
now:
  show: true
  label: Now
series:
  - entity: sensor.nordpool_kwh_se3_sek_3_10_025
    type: column
    data_generator: |
      return (entity.attributes.raw_today.map((start, index) => {
        return [new Date(start["start"]).getTime(), entity.attributes.raw_today[index]["value"]];
      })).concat(entity.attributes.raw_tomorrow.map((start, index) => {
        return [new Date(start["start"]).getTime(), entity.attributes.raw_tomorrow[index]["value"]];
      }));
    color_threshold:
      - value: 0
        color: green
      - value: 1
        color: orange
      - value: 2
        color: red
      - value: 3
        color: darkred
      - value: 4
        color: black
  - entity: sensor.energy_consumption_kwh_hour
    type: column
    group_by:
      func: max
      duration: 1h
    color: blue
    show:
      header_color_threshold: true
      extremas: true

Change the "sensor.nordpool_kwh_se3_sek_3_10_025" to your nordpool sensor of choice in the code above. The sensor is named based on your geographical location.

  1. Press "Save". Your done!

Example: Current gauges

Current meters

  1. Go to your dashboard of choice in home assistant, press the "..." icon and "Edit dashboard".

  2. Press the button "+ ADD CARD". Scroll to the bottom and select under Manual, "Need to add a custom card or just want to manually write the YAML?"

  3. Paste the following code into the text editor:

type: vertical-stack
cards:
  - type: gauge
    entity: sensor.p1ib_current_l1
    max: 25
    unit: A
    needle: true
    severity:
      green: 0
      yellow: 16
      red: 20
  - type: gauge
    entity: sensor.p1ib_current_l2
    max: 25
    unit: A
    severity:
      green: 0
      yellow: 16
      red: 20
    needle: true
  - type: gauge
    entity: sensor.p1ib_current_l3
    max: 25
    unit: A
    needle: true
    severity:
      green: 0
      yellow: 16
      red: 20
view_layout:
  position: sidebar
  1. Adjust the "green:", "yellow:" and "red:" values based on your main fuse amperage and limits you want to have in the gauges.

  2. Press "Save". Your done!

Examples of automations in Home Assistant

The examples requires some knowledge about the automation system in Home Assistant. https://www.home-assistant.io/docs/automation

Example: Disable power switch when fuse amperage is above a given threshold

todo: add example

Homey App

P1IB supports homey! A homey app is available at https://homey.app/sv-se/app/nu.ahlner.p1ib/p1ib

The app is developed by Erik Ahlner (whyz). Source code available at https://github.com/whyz/homey-p1ib.

Homey1 Homey2

FAQ / Trouble shooting

Q: I have changed WiFi settings and set the p1ib to connect to my home WiFi accesspoint - but I cannot find p1ib on my local network.

A: There are several reasons and solutions:

  1. You entered incorrect password for your accesspoint - in this case p1ib will return to AP-mode in a couple of seconds. Wait and watch out for the p1ib-ssid in your wifi scanning.
  2. Your device does not support mDNS (http://p1ib.local). You need to figure out what IP-address the p1ib have been assigned to. Go to your router/DHCP-servers client list to find out the IP.
  3. Get help in the community facebook group named "P1IB / P1 Interface Bridge - support" (https://www.facebook.com/groups/385403882937131).
  4. If 1 och 2 does not solve the problem, then the best way to understand the problem is to connect the p1ib to your PC via USB. Install the CH340 drivers if needed (http://www.wch-ic.com/downloads/CH341SER_EXE.html), linux users doesn't need any drivers). Connect to the usb-serial port with your favorite terminal program (putty for instance), baud rate 2000000. The P1IB will log current state to the usb connection.
  5. Flash new firmware onto the device via USB, which will reset all settings and force p1ib to AP-mode. https://remne.github.io/p1ib/webflash/
  6. Send email to m.nu ([email protected]) if you have bought your device from m.nu.
  7. Send email to [email protected].

Q: The LED light pulses with red color, what does it mean?

A: It means p1ib is in AP mode, and needs to be configured. Connect to the Wi-Fi access point named "p1ib" and browse to http://192.168.1.1. You might need to disable "Mobile data" on your phone to be able to access it.

Q: What does the intermitten blue pulse LED light mean?

A: That a power meter messages was correctly parsed and verified (crc check was ok).

Q: What does intermitten red pulses mean?

A: That p1ib received an incomplete message from your powermeter and/or crc check did not pass.

Q: I cannot access p1ib by http://p1ib.local/ after I have selected an access point in the settings menu and entered a password

A1: If p1ib is still available in the devices list of access points, then p1ib could not connect to your AP SSID. Connect to it and double check that you entered the correct password. You can press the 'eye' icon to make the password visible in clear text.

A2: Your client might not support mDNS protocol, which must be activated to be able to resolve p1ib.local to an IP address. If this is the case, use the IP address given by your router instead.

Q: I have Home Assistant and I want all data as sensors.

A: Its easy! Just enable "MQTT" option, enter IP and port and possible username / password to your mqtt broker. P1ib automatically register a sensor for each measurement point from your AMS into HA.

Q: I have a different home automation system than HA or Homey I want to use together with my p1ib.

A: MQTT is the prefered protocol in p1ib. Messages will be sent out periodically if connected to an power meter. Easiest way is to "sniff" the messages with an local mqtt client (for example mosquitto_sub) to find out all topics available. Subscribe the topic '#' with mosquitto_sub to see all messages and topics. There is also a webservice providing the meter data. It can be found att http://p1ib.local/meterData

Q: I cannot see any graphs in the dashboard while in AP mode.

A: The graphs rely on the 'chartjs' library, which is not included in the firmware (due to the library size). Once connected to your Wi-Fi access point (and the internet), the library will be downloaded by your webbrowser and the graphs will work.

p1ib's People

Contributors

remne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

p1ib's Issues

Updated HA and P1ib - not working

Hi,

Updated HA Core to 2024.2.4 and restarted p1ib, no sensors gets unavailable.
Updated p1ib to latest stable (20240212), I see 30+ MQTT messages being sent to topic like homeassistant/sensor/p1ib/p1ib_h_active_imp_q1_q4/config

All sensors are still unavailable

Also noted in HA logs

2024-02-27 19:24:46.409 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.p1ib_reactive_power_minus_l3 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'kVAr' which is not a valid unit for the device class ('reactive_power') it is using; expected one of ['var']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
2024-02-27 19:24:46.410 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.p1ib_reactive_power_plus_l3 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'kVAr' which is not a valid unit for the device class ('reactive_power') it is using; expected one of ['var']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
2024-02-27 19:24:46.417 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.p1ib_reactive_power_minus_l2 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'kVAr' which is not a valid unit for the device class ('reactive_power') it is using; expected one of ['var']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
2024-02-27 19:24:46.418 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.p1ib_reactive_power_plus_l2 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'kVAr' which is not a valid unit for the device class ('reactive_power') it is using; expected one of ['var']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
2024-02-27 19:24:46.419 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.p1ib_reactive_power_minus_l1 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'kVAr' which is not a valid unit for the device class ('reactive_power') it is using; expected one of ['var']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
2024-02-27 19:24:46.420 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.p1ib_reactive_power_plus_l1 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'kVAr' which is not a valid unit for the device class ('reactive_power') it is using; expected one of ['var']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
2024-02-27 19:24:46.424 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.p1ib_reactive_power_minus_q3_q4 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'kVAr' which is not a valid unit for the device class ('reactive_power') it is using; expected one of ['var']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
2024-02-27 19:24:46.426 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.p1ib_reactive_power_plus_q1_q2 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'kVAr' which is not a valid unit for the device class ('reactive_power') it is using; expected one of ['var']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
2024-02-27 19:24:46.433 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.p1ib_reactive_energy_export_q3_q4 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'kVArh' which is not a valid unit for the device class ('energy') it is using; expected one of ['Wh', 'kWh', 'GJ', 'MJ', 'MWh']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
2024-02-27 19:24:46.435 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.p1ib_reactive_energy_import_q1_q2 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'kVArh' which is not a valid unit for the device class ('energy') it is using; expected one of ['Wh', 'kWh', 'GJ', 'MJ', 'MWh']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22

Red/Blue Blinking LED

I can't reach my P1IB anymore. The problem occurred a few days after I connected it to an HAN switch (as I have new load balancer for my new EV charger). I suspect it might be due to low power, even though the load balancer is working just fine.

In any way, the P1IB LED is blinking blue a few times, then a brief red blink, then back to blue blinking, and so on. What does this pattern mean?

Feature request: composite MQTT messages

Currently p1ib publishes 1 topic per metric.
It would be nice if there would be an option to get a single topic with a composite JSON document with all metrics instead.
This would simplify some calculations and improve performance for some clients.

Wi-fi reconnection

Hej,

What does the p1ib do if the wi-fi connection is interrupted? From what I can tell, it goes into AP mode and doesn't try to reconnect to the wi-fi (at least within 10-20 minutes) without a restart. Is this the intended behavior?

-Nate

MQTT reconnection behavior

Installation and setup worked as expected. However, I've noticed that restarting the MQTT broker (Eclipse Mosquitto) causes the connection with the P1ib to break. It appears that the P1ib doesn't reconnect to the broker automatically, but needs to be restarted via its web interface. Upon restarting, the P1ib resumes publishing notices to the broker as expected. More precisely, Home Assistant doesn't find new data from the P1ib. (I haven't used another method to monitor the MQTT broker directly.)

Currently running the development firmware (f7b009f) on the P1ib.

Feature request: admin password

Option to set admin password during configuration, now the p1ib is free for all on the local network, would be nice with a lockdown for changing settings.

MQTT password limited to max 30 characters in GUI

I have a MQTT password over 30 characters. I edited the HTML in chrome inspector to max="60" and saved the settings and now it works. But now I have to do that every time I need to save settings or the password is truncated. Please change the max length to something higher than 30.

Prepare device before using the HAN-port

Hello!

I've just bought the device and would like the opportunity to prepare the device before the meeter is switched. Since it's a remote place, I'm planning to setup the wifi connection and then plug it into the meeter once it's switched. There is a risk that they won't be able to turn the HAN-port on the same day, and I might not be there when it's turned on.

So, basically what I'm wondering, can I power the device using a USB-a power source, do my configurations to the wifi, and then shut it down and just have it laying there offline until the meeter is switched and the HAN-port is activated? Think I can leave a note to the people doing the meeter switch to plug it into the new meter :-)

Reconnect MQTT on lost connection

For different reasons my HA server was re-started a couple of times.
On each occasion I had to log in to the p1ib and save settings/restart for it to reconnect.
Is this expected behaviour? Can it be improved?

Entity state class warnings

Logger: homeassistant.components.sensor
Source: components/sensor/init.py:500
Integration: Sensor (documentation, issues)
First occurred: 18:57:56 (3 occurrences)
Last logged: 19:12:03

Entity sensor.p1ib_telegram_received (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using state class 'measurement' which is impossible considering device class ('timestamp') it is using; expected None; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22

Entity sensor.p1ib_reactive_energy_export_q3_q4 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total_increasing', 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22

Entity sensor.p1ib_reactive_energy_import_q1_q2 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total_increasing', 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22

WiFi issue

Hello!

I run a Unifi network that consists of 3 WiFi access points. They all broadcast 2 networks, 1 for all my IOT devices (2,4ghz only) and one for the rest. When configuring the P1IB unit to connect to my IOT network it didn't work. Doing a scan showed 3 IOT networks and 3 of my regular network. Was unable to get it to connect.

My solution now was to create another separate 2,4 ghz network that was only broadcasted by the outdoor wifi AP. Then it worked just fine.

Just wanted to inform about this issue and if someone else might have the same problem.

Feature request: Additions to Home assistant auto discovery

Hi

The home assistant MQTT auto discovery has the possibility to group multiple entries into devices for better mapping. Looking at the current implementation in p1ib it does not to expose this. The optional field is described here:
https://www.home-assistant.io/integrations/sensor.mqtt/#device.

Also the availability tag could be good if data varies or the unit is closed down. Described here https://www.home-assistant.io/integrations/sensor.mqtt/#availability. (This probably needs that p1ib also needs a birth and will message to be added)

Current exposed json:

{
  "name": "p1ib_active_power_minus_l1",
  "stat_t": "homeassistant/sensor/p1ib/p1ib_active_power_m_l1/state",
  "device_class": "energy",
  "unit_of_measurement": "kW",
  "state_class": "measurement"
}

example from zigbee2mqtt:

{
  "availability": [
    {
      "topic": "zigbee2mqtt/bridge/state"
    }
  ],
 "device": {
    "identifiers": [
      "zigbee2mqtt_0x84fd27fffe6e1d13"
    ],
    "manufacturer": "IKEA",
    "model": "TRADFRI ON/OFF switch (E1743)",
    "name": "....",
    "sw_version": "Zigbee2MQTT 1.21.2"
  },
...
}
zigbee2mqtt/bridge/state: online or offline

Regards, Marky

Invalid state message warnings in HomeAssistant

Logger: homeassistant.components.mqtt.sensor
Source: components/mqtt/sensor.py:245
Integration: MQTT (documentation, issues)
First occurred: 19:08:38 (23 occurrences)
Last logged: 19:08:59

Invalid state message { "p1ib_clock_date": null, "p1ib_hourly_active_import_q1_q4": 5213.196, "p1ib_hourly_active_export_q2_q3": 0, "p1ib_hourly_reactive_import_q1_q2": 0.955, "p1ib_hourly_reactive_export_q3_q4": 418.856, "p1ib_active_power_plus_q1_q4": 4.164, "p1ib_active_power_minus_q2_q3": 0, "p1ib_reactive_power_plus_q1_q2": 0, "p1ib_reactive_power_minus_q3_q4": 0.303, "p1ib_active_power_plus_l1": 1.3, "p1ib_active_power_minus_l1": 0, "p1ib_active_power_plus_l2": 1.342, "p1ib_active_power_minus_l2": 0, "p1ib_active_power_plus_l3": 1.522, "p1ib_active_power_minus_l3": 0, "p1ib_reactive_power_plus_l1": 0, "p1ib_reactive_power_minus_l1": 0.224, "p1ib_reactive_power_plus_l2": 0.052, "p1ib_reactive_power_minus_l2": 0, "p1ib_reactive_power_plus_l3": 0, "p1ib_reactive_power_minus_l3": 0.131, "p1ib_voltage_l1": 231.2, "p1ib_voltage_l2": 232, "p1ib_voltage_l3": 233.5, "p1ib_current_l1": 5.7, "p1ib_current_l2": 5.7, "p1ib_current_l3": 6.6, "p1ib_firmware": "e9309dd", "p1ib_update_available": "", "p1ib_import_export_l1": null, "p1ib_import_export_l2": null, "p1ib_import_export_l3": "1.522", "p1ib_import_export": null, "p1ib_rssi": "-78", "p1ib_meter": "KAM5", "p1ib_mac": "********", "p1ib_telegrams_crc_ok": 173538, "p1ib_ip": "**.**.**.**" }
from 'power/p1ib/sensor_state'

Feature-request: Add telnet (TCP server) for raw telegrams

For applications that have their own sw decoding of P1 messages the de-facto standard is that the meter interface acts as a telnet TCP server that just echoes the telegrams received from the meter.

It would be very nice if this could be added, as the P1IB then would be compatible also with this way of interfacing to HAN-P1.

It also means compatibility with other software expecting directly connected P1->USB cables

Examples;

https://community.home-assistant.io/t/norway-sweden-electric-meter-reading-ams-han/384646
https://www.home-assistant.io/integrations/dsmr/
https://github.com/legolasbo/smartmeterBridge
ser2net
https://github.com/DavyLandman/p1-esp8266
https://currently.one/
https://www.zuidwijk.com/product/p1-reader-ethernet/
https://www.domoticz.com/

And from https://smartgateways.se/

(in Swedish)

Avläsning av smarta mätare via Telnet
Gatewayn har en inbyggd Telnet-server. Denna server erbjuder data från den smarta mätaren oförändrat. Detta gör det möjligt att själv konvertera data från den smarta mätaren till användbara data.
Gatewayn stöder upp till 5 samtidiga Telnet-sessioner. Detta gör det möjligt att använda olika hemautomatiseringspaket som DSMR Reader, Home Assistant och Domoticz samtidigt. Perfekt för användare som vill migrera långsamt till annan hemautomatiseringsprogramvara eller som vill läsa av den smarta mätaren med flera paket samtidigt.
 

telnet 192.168.31.193
Trying 192.168.31.193...
Connected to 192.168.31.193.
Escape character is '^]'.
/KAM5

0-0:1.0.0(231203182105W)
1-0:1.8.0(00000850.824kWh)
1-0:2.8.0(00000000.000
kWh)
1-0:3.8.0(00000001.882kVArh)
1-0:4.8.0(00000046.800
kVArh)
1-0:1.7.0(0002.876kW)
1-0:2.7.0(0000.000
kW)
1-0:3.7.0(0000.000kVAr)
1-0:4.7.0(0000.265
kVAr)
1-0:21.7.0(0000.836kW)
1-0:41.7.0(0001.713
kW)
1-0:61.7.0(0000.327kW)
1-0:22.7.0(0000.000
kW)
1-0:42.7.0(0000.000kW)
1-0:62.7.0(0000.000
kW)
1-0:23.7.0(0000.000kVAr)
1-0:43.7.0(0000.158
kVAr)
1-0:63.7.0(0000.000kVAr)
1-0:24.7.0(0000.266
kVAr)
1-0:44.7.0(0000.000kVAr)
1-0:64.7.0(0000.157
kVAr)
1-0:32.7.0(229.9V)
1-0:52.7.0(230.5
V)
1-0:72.7.0(229.8V)
1-0:31.7.0(003.9
A)
1-0:51.7.0(007.5A)
1-0:71.7.0(001.7
A)
!233A

Energy usage differ

Hi!

Energy usage in HA versus Tibber differ about 5 kWh/day, Tibber shows the higher value. Any Idea what can cause that? I'm using the sensor sensor.p1ib_active_energy_import_q1_q4 in the Energy Dashboard.

Active power L1-3 (solar) show power

Hi,

Recently connected the P1ib as I got a new power meter.
I note that Active power L1-3 (solar) show power even though my solar system is not producing due to evening/dark condtions, see picture.
What could be wrong?

Best regards,
Mika
IMG_0346

Reactive power incorrectly reported

The P1ib is reporting reactive power (power returned to the grid) even though there is no power production or storage available. These values are reported via both MQTT and the P1ib dashboard (web interface).

Firmware: development build f7b009f.

Rate limit data sent to MQTT?

Is it possible to put some limit on the update frequency on the messages being sent to mqtt?
For me it should be enough to get the state posted every 10th second or so.

Feature request: AWS IoT hub compatibility

I plan to use AWS IoT for analyzing the smart meter data.
I tried and had to write a wrapper layer, but with a few tweaks it works. It would be nice if the p1ib could support those things out of the box.

Azure IoT hub seems to have similar requirements although it seems to require username and can alternatively use an authentication key instead of X.509 certificate
https://learn.microsoft.com/en-us/azure/iot/iot-mqtt-connect-to-iot-hub#using-the-mqtt-protocol-directly-as-a-device

P1ib get disconnected in HomeAssistant if I restarrt HA

Hi,

If I restart HomeAssistant the sensors gets "unknown" which I think relates that HA loose the state and p1ib just send homeassistant messages at startup (= if I restart p1ib then it works again)

Any configuration possible to get this smoother?

/ Joacim

Home Assistant loose P1ib EVERY time HA is restarted (Unavailable entities)

Hi,

Every time I restart Home Assistant it looses P1ib entities and they became "Unavailable".
Restarting P1ib doesn't help but I can see the entities flick for <1sec.
image

Removing P1ib device and entities, restarting HA and P1ib several times can make it work again.
Very annoying!

"P1IB Telegram received" is received every ~10 sec

I can see MQTT messages being sent and device/entities gets created but Unavailable

HA Core: 2024.3.1
HA: Supervisor: 2024.03.0
HA Operating System: 12.1
HA Frontend: 20240307.0

P1ib Build: aae1e85
P1ib Build Date: 20240212

Looking for technical details regarding Kamstrup OMNIPOWER Three-phase meter DK-8660

I just moved to a newly built house where the electricity company has installed the Kamstrup OMNIPOWER Three-pase meter DK-8660. I see in a lot of web shops for various devices that the OMNIPOWER is not supported, but rarely any details on what exactly is wrong with this specific meter.

I see in the README.md that the P1ib can be modified to support my OMNIPOWER but not recommended. Can anyone here share some more technical details what is actually wrong with the OMNIPOWER and what needs to be modified in the P1ib?

Any help is appreciated before I go down the rabbit hole of trying to figure it out myself.

MQTT Topic Prefix not working on development version b896624

Found a small issue on development version b896624.

Data is still published without the MQTT Topic Prefix even when it is set.

The homeassistant auto discovery data still indicates that it should be published on mqtttopicprefix/p1ib/... but it is actually published on p1ib/...

image image image

Not able to OTA upgrade to fcd8d4a

I have some problems with p1ib not reconnecting after temporary loosing wifi-connection and i wanted to test the development firmware to see if this has been solved but every time i try to upgrade firmware from 97b55c9 to fcd8d4a it fails with error message "Error in server response!".

Documentation for firmware programming

Is there perhaps already documentation on how one could go about modifying the firmware of the device?

I mean specifically for the communication to P1, as the user interface seems quite robust to me (I can't see anything I would like to add).

I would really like to contribute to this project, and doing that while working on connecting to a temperamental electricity meter sounds fun to me (I am weird like that).

HA Entities Warning

Hello!

I recently saw this warning popup i Home Assistant:
image

Anything I can do in HA to fix this or is a firmware fix required?

/P

Device not booting up on active HAN port

Hi,

I have just received my device (https://www.m.nu/sensorer-wifi/elmatare-for-p1-han-port-med-wifi)

Connected it to a Kaifa MA304H4D with activated HAN-port, but nothing happens. The LED does not light up.
For clarity:

  • I am using the original crossed RJ12 cable that was supplied from m.nu
  • The HAN port indicator on the meter display is active, indicating the HAN port is active. Have double-checked with the supplier too.
  • Edit: Tried powering the device via the USB port, which works fine. But does not seem to receive any data.

Since the MA304 is listed as a supported meter, I am assuming something is off?
Any ideas on how I can troubleshoot this issue?

If this is the wrong place to ask, or if more information is needed, let me know.

Feature request: Remote restart function

I have at times noticed that P1IB sometimes loses the MQTT connection. It's rare but it has happened. A quick reboot solves the issue.

In Home Assistant, I have an automation that notifies me if P1IB hasn't updated in a while. I would like to see a webhook or even a Home Assistant service to restart P1IB in a similar automation.

Cheers!

Feature request: limited data

Possibility to enable a "limited data"-mode where:

  • data is only sent when changed
  • selectable measurement points (obis codes)

Kamstrup Omnipower How will it not work and how to make it work?

Hejsan.
Too late I realized tht Omni and Omnipower is not the same thing. I have already bought th p1ib.
In what way will it not work?
In what way is the P1-port not compatible to standard?

Connected to the meter nothing happens (however i dont know i my meter is activated yet).
But connecting it only to USB it wakes up.
How do i modify my p1ib to make it work?

Yours
Ebbe Ardinge /Karlskoga

How to delete orphan entities?

Hi!

I purchased this, but my Meter didn't support opening the P1 port, so I sold it to a friend.
I have all my entites still in Home Assistant, and cannot find a way to delete them? :)

This entity ('sensor.p1ib_active_power_minus_l1') does not have a unique ID, therefore its settings cannot be managed from the UI. See the documentation for more detail.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.