Skip to content

Instantly share code, notes, and snippets.

@thomasvt1
Created September 6, 2021 19:42
Show Gist options
  • Save thomasvt1/6b7167295730a40df6f3eee9a4c275d5 to your computer and use it in GitHub Desktop.
Save thomasvt1/6b7167295730a40df6f3eee9a4c275d5 to your computer and use it in GitHub Desktop.
DSMR Logger 4.5 for esphome
esphome:
name: dsmr-logger
platform: ESP8266
board: nodemcu
# Enable logging
logger:
baud_rate: 0
# Enable Home Assistant API
api:
ota:
password: "xxxxx"
wifi:
ssid: "xxxxx"
password: "xxxxx"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Dsmr-Logger Fallback Hotspot"
password: "xxxxx"
captive_portal:
uart:
rx_pin: GPIO13
baud_rate: 115200
output:
- platform: gpio
pin: GPIO12
id: request_data
interval:
- interval: 30s
then:
- output.turn_on: request_data
- delay: 500ms
- output.turn_off: request_data
sensor:
- platform: dsmr
energy_delivered_tariff1:
name: Energy Consumed Tariff 1
state_class: total_increasing
energy_delivered_tariff2:
name: Energy Consumed Tariff 2
state_class: total_increasing
power_delivered:
name: Power Delivered
state_class: measurement
accuracy_decimals: 0
filters:
- multiply: 1000
electricity_failures:
name: Electricity Failures
voltage_l1:
name: Voltage L1
state_class: measurement
current_l1:
name: Current L1
state_class: measurement
gas_delivered:
name: Gas Delivered
state_class: total_increasing
text_sensor:
- platform: dsmr
identification:
name: "DSMR Identification"
p1_version:
name: "DSMR Version"
@thomasvt1
Copy link
Author

Based on the DSMRLogger 4.5 combined with a v5 smart meter.

Information used for the GPIO ports/logic;
https://willem.aandewiel.nl/index.php/2019/04/09/dsmr-logger-v4-slimme-meter-uitlezer/

image

@thomasvt1
Copy link
Author

Interval for data retrieval can be changed by modifying
interval: 30s

If it's an older smart meter (pre v4 for example). Baud rate has to be changed to 9600 (source)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment