Universal P1 Port Dongle for Smart Meter

Moderator: leecollings

Post Reply
User avatar
waltervl
Posts: 7024
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Universal P1 Port Dongle for Smart Meter

Post by waltervl »

This is just for information. No questions, but you are free to ask one on this subject.

I got a smart electricity meter recently (one of the last to be transfered in the Netherlands :) ). To connect my smart meter to Domoticz I decided to use the Universal P1 Port Dongle for Smart Meter - ESP32-S3 and have it send the P1 telegrams over wifi.
It can be bought at tinytronics.nl for a small fee (currently in backorder).

There is a HA integration availabale but no Domoticz as the firmware in https://github.com/Leotro-Engineering/U ... ort-Dongle does not support it yet.

So I made a PR https://github.com/Leotro-Engineering/U ... gle/pull/9 that adds a ESPHOME configuration that forwards the P1 telegram over wifi on port 6638 (configurable). In Domoticz you can add the P1 meter by entering the IP adress and the port for the "P1 smart meter with LAN interface" hardware gateway (see also https://wiki.domoticz.com/Dutch_DSMR_sm ... th_P1_port )

After installing ESPHOME and using the example yaml file you have to modify it to with the wifi SSID and password to connect to your homenetwork. Then you can create the firmware for the Dongle and flash the device over USB for the first time.
Note: To program the module for the first time, it must be put into programming mode. Connect the module to the computer, hold down the boot button, and briefly press the reset button. Then release the boot button.
After the first time flashing the firmware you can update over Wifi if needed.

When flashing is done you can connect the dongle with a special RJ12 6P6C P1 Port Cable to the P1 Port on the smart meter, these can be bought at tinytronics.nl too.
The dongle will be powered by the P1 port so no need to add an extra USB power supply. The dongle can also relay the P1 telegram messages over the other P1 port so you can use an extra P1 splitter when you have to install an extra dongle eg for a specific home battery or other energy control device.

The firmware also has a small webpage in it that you can reach at http://<Dongle-IP> so you can see if it works.
On your wifi router it should appear as device universal-p1-port-dongle-wifi
If it cannot connect to your home wifi you can have your phone or laptop connect to it as it serves then as fallback hotspot. Then you can set your home network SSID and password.

.
universal-p1-port-dongle-esp32-s3-600x600h.jpg
universal-p1-port-dongle-esp32-s3-600x600h.jpg (30.75 KiB) Viewed 524 times
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Gravityz
Posts: 757
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2026.3
Location: Netherlands
Contact:

Re: Universal P1 Port Dongle for Smart Meter

Post by Gravityz »

Nice.
i currently have the rfxtrx433xl which has a p1 meter.
however after a recent meter swap i get an invalid data error once in a while.
nothing serious but when i get the error the reading stops so that is irritating.
i was about to order the homewizard p1 meter but this looks more promising because it can be customized.

in the current setup i have a P1 energy meter which shows the total energy.
the tarif1 and 2 counters are buried in the report section
the tarif1 and 2 are not seperate devices so i made them myself so i can instantly see the counters.

looking at this esphome code it is the other way around, devices for tarif 1 and 2 are created through mqtt-ad but the total energy device is not.
is this correct.
if this is the case tan i think a device ehich shows the total energy can be added without any problems.

love to hear from you.

thanks
User avatar
waltervl
Posts: 7024
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Universal P1 Port Dongle for Smart Meter

Post by waltervl »

Oh, I did nothing special with ESPHome, just forwarded the P1 telegram message to Domoticz over wifi and Domoticz will do the rest.

I did not use the MQTT code. As Domoticz has excellent P1 device integration on the telegram I did not had the need to change something.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Gravityz
Posts: 757
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2026.3
Location: Netherlands
Contact:

Re: Universal P1 Port Dongle for Smart Meter

Post by Gravityz »

ok. i understand now. i thought the sensors would also be discovered by mqtt-ad if i added mqtt but i understand now the solution is way easier. will order this to see if i can make it work

thanks
Post Reply