Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save BillyNate/430d28f4e496c8cd1fd9a5b3e732b6c4 to your computer and use it in GitHub Desktop.

Select an option

Save BillyNate/430d28f4e496c8cd1fd9a5b3e732b6c4 to your computer and use it in GitHub Desktop.
Super Simple ESPHome ESP32 C3 SuperMini DSMR P1 Energy Monitor

Super Simple ESPHome ESP32 C3 SuperMini DSMR P1 Energy Monitor

This is a super simplistic setup of an DSMR (P1) energy monitor utilizing the ESP32-C3 (SuperMini) you can get for €1-€2.
The ESP32 is flashed with ESPHome and can easily be integrated into Home Assistant.
It is tested on a DSMR 4. The ESP32-C3 is externally powered by usb since the "slimme meter" couldn't power it.
The update rate is controlled by the meter. It should be possible to use the data request pin, but this would require more parts (optocoupler etc).

Parts

Only three parts are used for building

  • ESP32-C3 SuperMini
  • RJ12 plug/cable
  • 10k resistor

Of course you'll also need something to power the ESP32

Schematic

Make sure you've thoroughly checked the wiring and pinout yourself. I'm not responsible for anything at all.
Wiring diagram

ESPHome

The ESPHome configuration is in the attached yaml file.
The web_server part can be removed, but might come in handy to check when debugging.
The debug in uart is also only included for debugging purposes.
How to flash ESPHome to the ESP32-C3 can be found elsewhere 😉

esphome:
name: esphome-p1-energy-monitor
friendly_name: "DSMR energy monitor"
esp32:
board: esp32-c3-devkitm-1
variant: esp32c3
framework:
type: arduino
logger:
level: DEBUG
logs:
component: ERROR
sensor: WARN
baud_rate: 115200
deassert_rts_dtr: true
hardware_uart: USB_CDC
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
output_power: 8.5
api:
web_server:
port: 80
ota:
- platform: esphome
uart:
- id: p1_uart
rx_pin:
number: GPIO3
inverted: true
mode:
input: true
pullup: true
baud_rate: 115200
rx_buffer_size: 1700
debug:
direction: RX
after:
delimiter: "\r\n"
sequence:
- lambda: UARTDebug::log_string(direction, bytes);
dsmr:
uart_id: p1_uart
max_telegram_length: 1700
sensor:
- platform: dsmr
energy_delivered_tariff1:
name: Energy consumed tariff 1
energy_delivered_tariff2:
name: Energy consumed tariff 2
power_delivered:
name: Power consumed
electricity_failures:
name: Power failures
electricity_long_failures:
name: Long power failures
electricity_sags_l1:
name: Energy sags l1
electricity_sags_l2:
name: Energy sags l2
electricity_sags_l3:
name: Energy sags l3
electricity_swells_l1:
name: Energy swells l1
electricity_swells_l2:
name: Energy swells l2
electricity_swells_l3:
name: Energy swells l3
voltage_l1:
name: Voltage l1
voltage_l2:
name: Voltage l2
voltage_l3:
name: Voltage l3
current_l1:
name: Current l1
current_l2:
name: Current l2
current_l3:
name: Current l3
gas_delivered:
name: Gas consumed
text_sensor:
- platform: dsmr
p1_version:
name: DSMR version
timestamp:
name: Timestamp
message_short:
name: Message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment