I’m very happy with the energy addition to HA, and want to connect my DSMR meter also. Currently I have this interfaced via the GitHub - daniel-jong/esp8266_p1meter: DSMR5 P1 meter to mqtt using esp8266 solution (by MQTT), but the ESPHome “Slimmelezer” seems to be the prefered way. The Slimmelezer software is on github, but the hardware I cannot find. Is there any (open) hardware design available that is able to run the ESPhome DSMR component succesfully?
Despite the claim in the blog that this is “open source hardware” I suspect it isn’t.
Why would you need another p1 reader? You are not going to get more or less info from another one.
Besides the ESPHome is just an ESP32 or 8266 with almost the same design as your github link
I hope to reach a more stable, but also more accessible device through ESPhome, which has better logging possibilities and is better manageable from remote.
If the schematic is not open, I will try to design one myself. Anyone else who did this?
How do you think it will differ from the one you have?
I guess it needs a hardware invert of Rx, as the ESPHome solution does not support the software invert that is used now.
Have a look at GitHub - mmakaay/esphome-smartmeter: An ESPHome smartmeter project (hardware + ESPHome config)
Thanks! Very interesting!
I am currently working on a new revision of the board, mainly because me and Jos found some differences in the power supply side of things between DMSR v4 and DSMR v5. This is already reflected in the documentation on my GitHub repo, telling that you should not add the 1000 uF capacitor when using DSMR v5.
My new board design has a jumper that enables or disable the 1000 uF capacitor. That would allow a simple upgrade path when a v4 meter is replaced with a v5 meter.
There were some more changes. The current design status of the board looks like this:
The implemented changes so far are:
2021-08-27
- Use thermal isolation for the ground pads to make soldering easier. Thanks to Azimath on the ESPHome Discord.
2021-08-26
- Added a breakout header for exposing 3V3, GND and unused pins (GPIO0, GPIO2, TXD). Thanks to Frank Bakker on the ESPHome Discord.
- Various small layout changes. Thanks to Jos (and his OCD) on the ESPHome Discord.
2021-08-24
- Introduced a jumper that can be used to enable or disable the 1000 uF capacitor for DSMR v4 compatibility. When using the board directly for a DSMR v5 meter, then the capacitor can be omitted. The main idea of the jumper is to make it possible to move from a DSMR v4 to a DSMR v5 meter by simply removing the jumper.
- The GND at the bottom side is now implemented using a copper pour. Thanks to stoic on the ESPHome Discord.
2021-08-23
- One less 1000 uF capacitor, a single one is all we need here (I’m running on a v4.2 here with 1000 uF installed, and it’s running very stable).
- Added the jumper for enabling the 1000 uF for DSMR v4.
- RST is now pulled high using a 10k resistor (I had no problems with it being floating in the previous design, but better make that an explicit pull up).
- Added a 100 nF capacitor on the input side, because that was suggested in the DSMR v5 companion documentation.
- Moved the RJ12 connector a bit outside the board, to make it easier to expose it from an enclosure.
- Added some holes at the corner so it can be screwed into an enclosure.
- Did some manual routing, to have all routes on top of the board, except for GND which is routed via the bottom of the board.
- No traces below the antenna of the ESP-01. I use a 2x4 header there, making the ESP-01 float 12mm above the board, so I have no problems with the antenna. But keeping the area free of traces should allow one to solder the ESP-01 directly onto the board. Thanks to stoic on the ESPHome Discord.
- Added debug pads for easier trouble shooting.
2021-07-23
- Initial circuit and board layout created.
After even more tweaking, I now have the following design:
Changelog
2021-09-08
- Added the new “Made for ESPHome” logo to the design and README.md.
- Updated the project to change its name to “DSMR Reader for ESPHome”.
New repo url: https://github.com/mmakaay/dsmr-reader-for-esphome - Added the 3D printing STL files to the project.
2021-09-03
- Swapped out the RJ12 connector part with another one, that has the soldering holes a bit closer to each other. With the original part, I had to bend the connector pins a bit to get them to fit in the holes.
- Added a 100nF capacitor to the reset switch connector for debouncing button presses.
- Rearranged the board to remove all components from under the ESP-01 MCU. This makes it easy to solder the ESP-01 directly onto the board if one desires to do so.
- Made the mounting holes a bit bigger to allow the use of M3 screws.
2021-08-28
- Changed the placement of the ESP-01, to bring the WiFi antenna to the outside of the board. Thanks to Frank Bakker on the ESPHome Discord for asking me why I hadn’t done so. I had no answer to that
- Exposed all pins that are required for flashing to the breakout header (practically meaning: I added the RXD header), as requested by Frnk.
- To make flashing easier, I added two jumpers that can be used for resetting and putting the ESP-01 into flash mode (i.e. connecting GPIO0 to GND).
- Improved the routing of a 3.3V trace. Thanks to Azimath on the ESPHome Discord.
- Fixed the use of the wrong voltage regulator (change LM1117 to AMS1117). Thanks to Azimath for the heads up.
3D printed box design ready
Printed the box, nice fit!
With support from @mmakaay I have now a working standalone (no external power needed!) unit to read my smartmeter (DSMR 4.2). Thanks a lot!
Hello,
i need help to make my dsmr reader work, i make @mmakaay project
my smart reader is a belgium with dsmr 5, so i don’t soldering all the components (capacitor 1000uF and jumper dsmr4)
d1 mini is connected over my network but all entities is unknow, and i change setup on esphome file for belgium smart meter
Hey. The best point to start, is enabling the UART debugger to see if the device is able to read the serial data stream from the P1 port. The most useful debug output in your case, is string output, since your meter doesn’t use encrypted telegrams. You can set this up by adding the following debug config to your uart:
configuration in the device YAML file:
uart:
debug:
direction: RX
after:
delimiter: "\r\n"
sequence:
- lambda: UARTDebug::log_string(direction, bytes);
thanks for your help, ok try this tomorow
so on my esphome yaml i have:
uart:
rx_pin: D7
baud_rate: 115200
rx_buffer_size: 1500
debug:
direction: RX
after:
delimiter: "\r\n"
sequence:
- lambda: UARTDebug::log_string(direction, bytes);
Hello,
i add you code to esphome yaml dans i have nothing
reader is connected but no information
Can you post your complete yaml config and maybe some pictures of your device, (bottom & top). Also did you check your cable between meter and device (RJ12 straight connections)?
Here you have some pictures
and my yaml
substitutions:
name: dsmr-reader
friendly_name: DSMR Reader
esphome:
name: dsmr
platform: ESP8266
board: d1_mini
# Enable Home Assistant API
api:
password: "xxx"
ota:
password: "xxx"
wifi:
ssid: xxx
password: xxx
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Dsmr Fallback Hotspot"
password: "xxx"
captive_portal:
logger:
# Serial logging is disabled by setting the logger baud rate to 0.
# Otherwise the logger will occupy the hardware UART, making it unavailable
# for receiving smart meter data on pin D7 (GPIO13).
baud_rate: 0
level: VERBOSE
uart:
rx_pin: D7
baud_rate: 115200
rx_buffer_size: 1500
debug:
direction: RX
after:
delimiter: "\r\n"
sequence:
- lambda: UARTDebug::log_string(direction, bytes);
dsmr:
sensor:
- platform: dsmr
energy_delivered_tariff1:
name: ${friendly_name} Energy Delivered Tariff 1
state_class: total_increasing
energy_delivered_tariff2:
name: ${friendly_name} Energy Delivered Tariff 2
state_class: total_increasing
energy_returned_tariff1:
name: ${friendly_name} Energy Returned Tariff 1
energy_returned_tariff2:
name: ${friendly_name} Energy Returned Tariff 2
power_delivered:
name: ${friendly_name} Power Consumed
power_returned:
name: ${friendly_name} Power Returned
electricity_failures:
name: ${friendly_name} Electricity Failures
electricity_long_failures:
name: ${friendly_name} Electricity Long Failures
voltage_l1:
name: ${friendly_name} Voltage L1
voltage_l2:
name: ${friendly_name} Voltage L2
voltage_l3:
name: ${friendly_name} Voltage L3
current_l1:
name: ${friendly_name} Current L1
current_l2:
name: ${friendly_name} Current L2
current_l3:
name: ${friendly_name} Current L3
power_delivered_l1:
name: ${friendly_name} Power Delivered L1
power_delivered_l2:
name: ${friendly_name} Power Delivered L2
power_delivered_l3:
name: ${friendly_name} Power Delivered L3
power_returned_l1:
name: ${friendly_name} Power Returned L1
power_returned_l2:
name: ${friendly_name} Power Returned L2
power_returned_l3:
name: ${friendly_name} Power Returned L3
gas_delivered_be:
name: ${friendly_name} Gas Delivered BE
text_sensor:
- platform: dsmr
identification:
name: ${friendly_name} Identification
p1_version_be:
name: ${friendly_name} Version BE
i test my rj12 with a electric tester and work fine
The latest version of @mmakaay DSMR reader design (which you are using) uses a request_pin
to trigger the reading from the P1-port. So please enter the follow two lines just under de dsmr:
tag and before the sensor:
tag
request_pin: D5
request_interval: 15s
so it looks like:
dsmr:
request_pin: D5
request_interval: 15s
sensor:
- platform: dsmr
energy_delivered_tariff1:
name: ${friendly_name} Energy Delivered Tariff 1
state_class: total_increasing
These two lines are missing in his example.yaml on github. The 15s is the interval I’m using on my device, of course you can enter your interval instead.
Furthermore, if you are using a DSMR v5, remove the jumper labeled DSMR4
. Using the capacitor on a v5 version can trigger a reboot loop. (brownout situation during setup).
Yes, @jsuanet is right. The request_pin
is required for this version of the board. Without setting the pin, the firmware will never activate the pin, resulting in the device never requesting data from the P1 port.
I updated the example.yaml
in the repository to include the pin config.