Return to Electronics

P1 Port Reader for Home Assistant

Home Assistant – Power Overview

Knowing how much electricity you are using has been increasingly important during the past couple of years. It is possible to read off live data such as power, current, and voltage from the power meter using the P1 Port.

I have made a circuit board with a custom design based on the popular P1 Port Reader for using together with Home Assistant to read data from the Sagemcom T211. The circuit is based on the Wemos D1 Mini board and using ESPHome.

This board fits well into the compartment of the T211 meter so there is no need for any enclosures. As I like indicators this board also features three LED:s that shows power and status which is helpful. The indicators are fed through the small gap in the lid, so there is no need to modify the meter case.

Here is the P1-port Reader rev 1.7 schematics (pdf) for this construction. There are extra connectors added for miscellaneous functionality not implemented. The board was produced by JLCPCB (not sponsoring this project).

You can find the firmware and ESPHome scripts on GitHub. The programming is based on Pär Svanström’s esphome-p1reader which maps 26 data points to Home Assistant. I have added support for LEDs and RTS timing hardware.

It might be possible to buy unpopulated boards from me if there is enough interest in producing the boards, contact me if you are interested.

Features

  • Discrete board that fits neatly into the meter housing of Sagemcom T211 without modifications.
  • The board is based on Wemos D1 Mini.
  • Values are sent to Home Assistant via ESPHome.
  • Requests data from the meter every 15 seconds.
  • LED indicators for power and status monitoring.
    • Red LED
      • 5V supply power from meter
    • Green LED
      • Slow flash – Heartbeat indicator circuit is alive
      • Fast flash – Receiving data
      • Status after data reception finished – on = ok, off = failed
    • Yellow LED
      • On – Request for data active (RTS)
      • Off – Request for data acknowledged
  • No additional power is needed.
  • Optional connectors for future functionality (not implemented).

Example of status log

This is the info logs that are logged as default when monitoring logs.

...
[21:37:58][I][crc:414]: > Read Telegram 30 lines. CRC: D842 = D842 : PASS.
[21:37:59][I][crc:414]: > Read Telegram 30 lines. CRC: E105 = E105 : PASS.
[21:38:13][I][crc:414]: > Read Telegram 30 lines. CRC: 93C9 = 93C9 : PASS.
...

Example of data read

This is an example of the actual data read from the meter by the Wemos D1 Mini.

[13:37:00][D][exe:390]: > Receiving Telegram ... 
[13:37:00][D][data:403]: > Read line: "/ELL5\nnnnnnnnn_A" length: 17 
[13:37:00][D][data:403]: > Read line: "" length: 0 
[13:37:00][D][data:403]: > Read line: "0-0:1.0.0(000220124115W)" length: 24 
[13:37:00][D][data:403]: > Read line: "1-0:1.8.0(00007874.250*kWh)" length: 27 
[13:37:00][D][data:403]: > Read line: "1-0:2.8.0(00000000.004*kWh)" length: 27 
[13:37:00][D][data:403]: > Read line: "1-0:3.8.0(00000001.910*kvarh)" length: 29 
[13:37:00][D][data:403]: > Read line: "1-0:4.8.0(00008806.040*kvarh)" length: 29 
[13:37:00][D][data:403]: > Read line: "1-0:1.7.0(0001.992*kW)" length: 22 
[13:37:00][D][data:403]: > Read line: "1-0:2.7.0(0000.000*kW)" length: 22 
[13:37:00][D][data:403]: > Read line: "1-0:3.7.0(0000.000*kvar)" length: 24 
[13:37:00][D][data:403]: > Read line: "1-0:4.7.0(0002.025*kvar)" length: 24 
[13:37:00][D][data:403]: > Read line: "1-0:21.7.0(0000.682*kW)" length: 23 
[13:37:00][D][data:403]: > Read line: "1-0:41.7.0(0000.740*kW)" length: 23 
[13:37:00][D][data:403]: > Read line: "1-0:61.7.0(0000.568*kW)" length: 23 
[13:37:00][D][data:403]: > Read line: "1-0:22.7.0(0000.000*kW)" length: 23 
[13:37:00][D][data:403]: > Read line: "1-0:42.7.0(0000.000*kW)" length: 23 
[13:37:00][D][data:403]: > Read line: "1-0:62.7.0(0000.000*kW)" length: 23 
[13:37:00][D][data:403]: > Read line: "1-0:23.7.0(0000.000*kvar)" length: 25 
[13:37:00][D][data:403]: > Read line: "1-0:43.7.0(0000.000*kvar)" length: 25 
[13:37:00][D][data:403]: > Read line: "1-0:63.7.0(0000.000*kvar)" length: 25 
[13:37:00][D][data:403]: > Read line: "1-0:24.7.0(0000.644*kvar)" length: 25 
[13:37:00][D][data:403]: > Read line: "1-0:44.7.0(0000.694*kvar)" length: 25 
[13:37:00][D][data:403]: > Read line: "1-0:64.7.0(0000.686*kvar)" length: 25 
[13:37:00][D][data:403]: > Read line: "1-0:32.7.0(229.6*V)" length: 19 
[13:37:00][D][data:403]: > Read line: "1-0:52.7.0(229.6*V)" length: 19 
[13:37:00][D][data:403]: > Read line: "1-0:72.7.0(231.7*V)" length: 19 
[13:37:00][D][data:403]: > Read line: "1-0:31.7.0(004.1*A)" length: 19 
[13:37:01][D][data:403]: > Read line: "1-0:51.7.0(004.5*A)" length: 19 
[13:37:01][D][data:403]: > Read line: "1-0:71.7.0(003.8*A)" length: 19 
[13:37:01][D][data:403]: > Read line: "!413C" length: 5 
[13:37:01][I][crc:414]: > Read Telegram 30 lines. CRC: 413C = 413C : PASS.

Components used for this project

The following components were used for this project:

  • 1 pcs P1 Port Reader rev 1.7 board  (custom design by Hazze Molin)
  • 1 pcs Wemos D1 Mini board
  • 2 pcs 8-pin header sockets
  • 1 pcs 47µF electrolytic capacitor
  • 3 pcs 3.3kΩ 0.1W 0603 resistors
  • 1 pcs 1kΩ 0.1W 0603 resistor
  • 3 pcs 5mm LEDs (red, green, and yellow, or any colour combination you like)
  • 3 pcs 330Ω 0.25W 0805 resistors (adjust resistances depending on actual LEDs used)
  • 2 pcs BC817-16 SOT-23 transistors
  • 1 pcs RJ12 connector
  • 1 pcs short cable with 6 wires
  • 2 pcs (optional) 10kΩ 0.1W 0603 resistors (for I2C communication)
  • 7 pcs (optional) 100Ω 0.1W 0603 resistors (for misc hardware connections)

Permanent link to this article: https://hazzemolin.se/projects/electronics/p1-port-reader-for-home-assistant/

Leave a Reply

Your e-mail address will not be published.