ESPHome DSMR Slimmelezer sends strange data

Yes, the UART debug looks strange, however I think there is some interference between UART and serial logger. It is advised to disable the serial logger by setting the baud_rate to zero

logger:
  baud_rate: 0

See also: DSMR Component — ESPHome.

And yes, you have to open a feature request instead of an issue: GitHub - esphome/feature-requests: ESPHome Feature Request Tracker.

I tried with pure UART, data is the same bad.
Tomorrow I’ll check it with external USB power attached.

[22:08:31][D][uart_debug:158]: <<< "/AUX59902734768\r\n"
[22:08:31][D][uart_debug:158]: <<< "\r\n"
[22:08:31][D][uart_debug:158]: <<< "0-0:1.0.0(220101220830W)\r\n"
[22:08:31][D][uart_debug:158]: <<< "2)\r\n"
[22:08:31][D][uart_debug:158]: <<< "482.627*kWh)\r\n"
[22:08:31][D][uart_debug:158]: <<< "-0:2000*kWh)\r\n"
[22:08:31][D][uart_debug:158]: <<< ".8.0(000081.090*kvarh)\r\n"
[22:08:31][D][uart_debug:158]: <<< "-0:7.8.0(000000.000*kvarh)\r\n"
[22:08:31][D][uart_debug:158]: <<< ".7.0(236.2*V)\r\n"
[22:08:31][D][uart_debug:158]: <<< "1-0:33.7.0(0.999)\r\n"
[22:08:31][D][uart_debug:158]: <<< "7.0(49.99*Hz)\r\n"
[22:08:31][D][uart_debug:158]: <<< "1-0:1.7.0(01.987*kW)\r\n"
[22:08:31][D][uart_debug:158]: <<< "1-0:2.7.0(00.000*kW)\r\n"
[22:08:31][D][uart_debug:158]: <<< "1-0:5.7.0(00.000*kvar)\r\n"
[22:08:31][D][uart_debug:158]: <<< "1-0:6.7.0(00.000*kvar)\r\n"
[22:08:31][D][uart_debug:158]: <<< "1-0:7.7.0(00.000*kvar)\r\n"
[22:08:31][D][uart_debug:158]: <<< "1-0:8.7.0(00.119*kvar)\r\n"
[22:08:31][D][uart_debug:158]: <<< "0-0:98.1.0(220101000000W)(004984.093*kWh)(002539.569*kWh)(002444.524*kWh)(000000.000*kWh)(000000.000*kWh)(000000.000*kWh)(000080.797*kvarh)(000473.402"
[22:08:31][D][uart_debug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\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xF
[22:08:32][D][uart_debug:158]: <<< "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF)\r\n"
[22:08:32][D][uart_debug:158]: <<< "!4689\r\n"
[22:08:32][E][dsmr:265]: 482.627*kWh)
  ^
Obis ID has number over 255

Some news. Adjusting debug output, I’ve succeeded to catch one series of bytes at initialisation with the less possible error. All messages after are even more corrupt, bytes are missing, bytes inside OBIS codes are mismatched, line breaks are inserted randomly, parsing not possible. Left is the first series, right is one of all following series:

Hi György,

Looking at the YAML you posted I haven some questions:

Which version of ESPHome are you using. If you are using the current 2021.12 branch there is no need to use the external component part anymore, so it’s better to remove this.

What happens if you remove the 3 lines in the DSMR part. (just keep DSMR: )

  • Based on the specification you posted, I don’t think the telegram_length is more than 1500 bytes (the default).
  • crc_check: false should only be done for older smart meters not providing a CRC. If there is a CRC and you use this setting, things are going wrong, the CRC bytes will be evaluated as regular part of the telegram-data.
  • receive_timeout: 200ms is also the default value, so not necessary, however should also not be the cause of your problem.

Also be sure the baud_rate: in the logger part is set to zero.

Hi Jos,
yes, version is 2021.12.1. Suggested parts removed.
Telegram length needed to be increased because of this issue: issue #2393

[E][dsmr:152]: Error: telegram larger than buffer (1500 bytes)

CRC check is re-enabled. Strange that it passes despite of the corrupt communication. I can think of three possibilities: 1) bytes are the same bad when sender calculates CRC 2) UART debug output is false and CRC is the same correct on sender and receiver side. 3) long telegram error doesn’t let CRC fault to pop up.

Checking…

Are you on the ESPHome discord, there is another person from Hungary posting about problems with a Sanxing SX631 smart meter. This person is using a telegram size of 3000. See Discord

Yes, this is a region specific problem with the long text message. Setting back telegram length to 3000 CRC fault appears as suspected in scenario 3) above:

[13:15:32][E][dsmr:265]: !6F7E
 ^
Checksum mismatch

I planned to connect external supply on USB but I’m not sure whether this is ok with RJ12 side supply in the same time. What do you think?

No power supply to the ESP form both the P1-port and USB is not a good idea. I’m using the p1-reader from GitHub - mmakaay/dsmr-reader-for-esphome: A smartmeter project, made for ESPHome (hardware + ESPHome config). This design has the possibility to use an external supply via USB or from the P1-port by using a jumper.

This looks good and complicated. I think I give esp-link firmware a second chance. Or find a cheap P1 reader over ehternet or USB to validate SlimmeLezer output.

I found a feature request from Hungary for supporting my meter however I don’t think it will solve the corrupt data problem: issue #1491

So moral is that plug & play means plug and play until it starts working :slight_smile:

Update: bravely tested with external USB PS. No improvement, data is the same strange.

Maybe there are some ‘bad’ connections/soldering on your device. Otherwise you could contact the builder of your device. If you have CRC-errors, the data is corrupt at the moment the data is parsed by the DSMR parser. The UART debugger is just dumping the data from the UART bus.

Maybe yes, I tried again to connect to my LAN with esp-link without success. Checked with external supply, firewall off, fix IP, DHCP.

Thanks for your enthusiastic help on this first Sunday 2022. I subscribed for an ethernet version of the device here: p1-reader-ethernet. Also start to order parts for the WEMOS project you showed me (link to Gerber file seems to be broken). One of these must work.

Br, György

You’re welcome. Yes that link is broken, I will send a message to Maurice, however, the gerber files are here: dsmr-reader-for-esphome/schematic.zip at fc566eb147db5c3782d424468b2d3f0a1075dc47 · mmakaay/dsmr-reader-for-esphome · GitHub.

I’m very happy with this version of the p1-reader, so I’m pretty sure it will work for you as well!

And just to be sure: can you check the config dump that you get when connecting the log viewer to the device? In the UART section you can see if the device is really using hardware UART. I don’t think I’ve ever seen bytes being dropped when using actual hardware UART. That is a symptom that pops up a lot when using software UART.

Hi Maurice,

defining rx buffer size at 3000 solved the missing bytes problem, communication now runs steadily with CRC check on. Hardware UART is used. Device recognized in HomeAssistant, but still no data. Is this because of the parsing problem listed at the end of the log below?

INFO Reading configuration /config/esphome/slimmelezer.yaml...
INFO Starting log output from slimmelezer.local using esphome API
INFO Successfully connected to slimmelezer.local
[21:49:55][I][app:102]: ESPHome version 2021.12.1 compiled on Jan  2 2022, 21:43:02
[21:49:55][C][wifi:488]: WiFi:
[21:49:55][C][wifi:350]:   Local MAC: C4:5B:BE:62:B0:C5
[21:49:55][C][wifi:351]:   SSID: [redacted]
[21:49:55][C][wifi:352]:   IP Address: 192.168.1.102
[21:49:55][C][wifi:354]:   BSSID: [redacted]
[21:49:55][C][wifi:355]:   Hostname: 'slimmelezer'
[21:49:55][C][wifi:357]:   Signal strength: -69 dB ▂▄▆█
[21:49:55][V][wifi:359]:   Priority: -4.0
[21:49:55][C][wifi:361]:   Channel: 4
[21:49:55][C][wifi:362]:   Subnet: 255.255.255.0
[21:49:55][C][wifi:363]:   Gateway: 192.168.1.1
[21:49:55][C][wifi:364]:   DNS1: 192.168.1.1
[21:49:55][C][wifi:365]:   DNS2: 0.0.0.0
[21:49:55][C][logger:233]: Logger:
[21:49:55][C][logger:234]:   Level: VERY_VERBOSE
[21:49:55][C][logger:235]:   Log Baud Rate: 0
[21:49:55][C][logger:236]:   Hardware UART: UART0
[21:49:55][C][uart.arduino_esp8266:100]: UART Bus:
[21:49:55][C][uart.arduino_esp8266:102]:   RX Pin: GPIO13
[21:49:55][C][uart.arduino_esp8266:104]:   RX Buffer Size: 3000
[21:49:55][C][uart.arduino_esp8266:106]:   Baud Rate: 115200 baud
[21:49:55][C][uart.arduino_esp8266:107]:   Data Bits: 8
[21:49:55][C][uart.arduino_esp8266:108]:   Parity: NONE
[21:49:55][C][uart.arduino_esp8266:109]:   Stop bits: 1
[21:49:55][C][uart.arduino_esp8266:111]:   Using hardware serial interface.
[21:49:55][C][dsmr:275]: DSMR:
[21:49:55][C][dsmr:276]:   Max telegram length: 3000
[21:49:55][C][dsmr:277]:   Receive timeout: 0.2s
[21:49:55][C][captive_portal:144]: Captive Portal:
[21:49:55][C][ota:082]: Over-The-Air Updates:
[21:49:55][C][ota:083]:   Address: slimmelezer.local:8266
[21:49:55][C][ota:086]:   Using Password.
[21:49:55][C][api:134]: API Server:
[21:49:55][C][api:135]:   Address: slimmelezer.local:6053
[21:49:55][C][api:139]:   Using noise encryption: NO
[21:49:55][C][mdns:084]: mDNS:
[21:49:55][C][mdns:085]:   Hostname: slimmelezer
[21:49:55][V][mdns:086]:   Services:
[21:49:55][V][mdns:088]:   - _esphomelib, _tcp, 6053
[21:49:55][V][mdns:090]:     TXT: version = 2021.12.1
[21:49:55][V][mdns:090]:     TXT: mac = c45bbe62b0c5
[21:49:55][V][mdns:090]:     TXT: platform = ESP8266
[21:49:55][V][mdns:090]:     TXT: board = esp01_1m
[21:50:00][VV][api.service:337]: on_ping_request: PingRequest {}
[21:50:00][VV][api.service:043]: send_ping_response: PingResponse {}
[21:50:01][V][dsmr:142]: Header of telegram found
[21:50:01][D][uart_debug:158]: <<< "/AUX59902734768\r\n"
[21:50:01][D][uart_debug:158]: <<< "\r\n"
[21:50:01][D][uart_debug:158]: <<< "0-0:1.0.0(220102215000W)\r\n"
[21:50:01][D][uart_debug:158]: <<< "0-0:42.0.0(AUX1030302734768)\r\n"
[21:50:01][D][uart_debug:158]: <<< "0-0:96.1.0(9902734768)\r\n"
[21:50:02][D][uart_debug:158]: <<< "0-0:96.14.0(0002)\r\n"
[21:50:02][D][uart_debug:158]: <<< "0-0:96.50.68(ON)\r\n"
[21:50:02][D][uart_debug:158]: <<< "0-0:17.0.0(90.000*kW)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:1.8.0(005057.626*kWh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:1.8.1(002539.569*kWh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:1.8.2(002518.057*kWh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:1.8.3(000000.000*kWh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:1.8.4(000000.000*kWh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:2.8.0(000000.000*kWh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:2.8.1(000000.000*kWh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:2.8.2(000000.000*kWh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:2.8.3(000000.000*kWh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:2.8.4(000000.000*kWh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:3.8.0(000081.590*kvarh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:4.8.0(000478.508*kvarh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:5.8.0(000081.590*kvarh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:6.8.0(000000.000*kvarh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:7.8.0(000000.000*kvarh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:8.8.0(000478.508*kvarh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:15.8.0(005057.627*kWh)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:32.7.0(234.3*V)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:52.7.0(237.2*V)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:72.7.0(235.0*V)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:31.7.0(007*A)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:51.7.0(000*A)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:71.7.0(001*A)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:13.7.0(0.998)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:33.7.0(0.999)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:53.7.0(0.913)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:73.7.0(0.947)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:14.7.0(50.01*Hz)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:1.7.0(01.939*kW)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:2.7.0(00.000*kW)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:5.7.0(00.000*kvar)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:6.7.0(00.000*kvar)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:7.7.0(00.000*kvar)\r\n"
[21:50:02][D][uart_debug:158]: <<< "1-0:8.7.0(00.121*kvar)\r\n"
[21:50:02][D][uart_debug:158]: <<< "0-0:98.1.0(220101000000W)(004984.093*kWh)(002539.569*kWh)(002444.524*kWh)(000000.000*kWh)(000000.000*kWh)(000000.000*kWh)(000080.797*kvarh)(000473.402"
[21:50:02][D][uart_debug:158]: <<< "*kvarh)(000080.797*kvarh)(000000.000*kvarh)(000000.000*kvarh)(000473.402*kvarh)(004984.096*kWh)(07.692*kW)(07.692*kW)(06.024*kW)(00.000*kW)(00.000*kW)"
[21:50:02][D][uart_debug:158]: <<< "(00.000*kW)\r\n"
[21:50:02][D][uart_debug:158]: <<< "0-0:96.13.0(\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xF
[21:50:02][D][uart_debug:158]: <<< "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\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xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xF
[21:50:02][D][uart_debug:158]: <<< "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xF
[21:50:02][V][dsmr:176]: Footer of telegram found
[21:50:02][D][uart_debug:158]: <<< "!82C7\r\n"
[21:50:02][V][dsmr:257]: Trying to parse telegram
[21:50:02][V][dsmr:118]: Stop reading data from P1 port
[21:50:02][V][component:199]: Component dsmr took a long time for an operation (0.72 s).
[21:50:02][V][component:200]: Components should block for at most 20-30ms.
[21:50:02][V][dsmr:105]: Start reading data from P1 port

Br, György

That last bit about the component taking too long is a mere warning. That wouldn’t stop the device from sending data.

Looking at the config you posted earlier, I don’t see any sensors that makes use of dsmr.

There’s also no need to use the external component. There are no features in dev that aren’t in the stable release. Better drop that part therefore.

Hi,
yes, I did forget to add sensors.
Now some sensor values are found, some are not supported.
I’m a lot happier than two days ago :slight_smile:
I also closed related #2891 with a comment about the fix.

Do you think a feature is possible to refer to OBIS codes alternatively like

sensor:
  - platform: dsmr
    obis_01:
      code: '1-0:32.7.0'
      name: 'Voltage Phase 1'

Sensor could be obis_01 … obis_50 to support region specific data and next DSMR standards.

Br, György

I am currently working on a refactor of the DSMR component, and the main target is to implement a DSMR parser for ESPHome, to get rid of the dependency on the Arduino parser. With that parser in place, it will be a lot easier to implement missing OBIS codes, since it will then be a one step implementation that can directly be tested.

Implementing a custom OBIS code would require more configuration than you proposed here. Not all lines are formatted in the same way for example, and units need to be specified. But it’s a nice idea to be able to specify missing OBIS codes like this. Ideally though, I’d like to see these codes implemented so all users can benefit from them.

I’m looking forward to the update. Until then I’ll build your D1 mini based P1 logger just for fun, because parts are on the way already :slight_smile:

Thanks again Jos and Maurice for your help, I’ll close this topic now and start to make beautiful power graphs.

If somebody finds this: partial solution for Hungarian DSMR with long text message can be found in issue #2891.

substitutions:
  device_name: slimmelezer
  device_description: "smart meter P1 port wi-fi transmitter"
  
esphome:
  name: slimmelezer

esp8266:
  board: esp01_1m

# Enable logging
logger:
  level: VERY_VERBOSE
  baud_rate: 0

# Enable Home Assistant API
api:

ota:
  password: "672c8b4ba6abc4b015f0349216f2d94f"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Slimmelezer Fallback Hotspot"
    password: "4C8x8eXmH1YZ"

uart:
  rx_pin: GPIO13
  baud_rate: 115200
  rx_buffer_size: 3000
#  debug:
#    direction: RX
#    after:
#      delimiter: "\r\n"
#    sequence:
#     - lambda: UARTDebug::log_string(direction, bytes);

dsmr:
  max_telegram_length: 3000
  crc_check: true
  receive_timeout: 200ms

captive_portal:

sensor:
  - platform: dsmr
    energy_delivered_lux:
      name: "Hatásos import energia (+A)"
    energy_delivered_tariff1:
      name: "Hatásos import energia (+A) – tarifa 1"
    energy_delivered_tariff2:
      name: "Hatásos import energia (+A) – tarifa 2"
    energy_returned_lux:
      name: "Hatásos export energia (-A)"
    energy_returned_tariff1:
      name: "Hatásos export energia (-A) – tarifa 1"
    energy_returned_tariff2:
      name: "Hatásos export energia (-A) – tarifa 2"
    power_delivered:
      name: "Pillanatnyi import teljesítmény (+A)"
      accuracy_decimals: 3
    power_returned:
      name: "Pillanatnyi export teljesítmény (-A)"
      accuracy_decimals: 3
    electricity_failures:
      name: "Electricity Failures"
      icon: mdi:alert
    electricity_long_failures:
      name: "Long Electricity Failures"
      icon: mdi:alert
    voltage_l1:
      name: "Pillanatnyi fázis feszültség L1"
    voltage_l2:
      name: "Pillanatnyi fázis feszültség L2"
    voltage_l3:
      name: "Pillanatnyi fázis feszültség L3"
    current_l1:
      name: "Pillanatnyi áram L1"
    current_l2:
      name: "Pillanatnyi áram L2"
    current_l3:
      name: "Pillanatnyi áram L3"
  - platform: uptime
    name: "SlimmeLezer Üzemidő"
  - platform: wifi_signal
    name: "SlimmeLezer Wi-Fi jel"
    update_interval: 60s

text_sensor:
  - platform: dsmr
    identification:
      name: "COSEM logikai készüléknév"
  - platform: wifi_info
    ip_address:
      name: "SlimmeLezer IP"
    ssid:
      name: "SlimmeLezer Wi-Fi SSID"
    bssid:
      name: "SlimmeLezer Wi-Fi BSSID"
  - platform: version
    name: "ESPHome verzió"
    hide_timestamp: true

1 Like

Hi,

I have a similar issue when trying to read the smart meter. I have created a topic here: DSMR topic

Do you have any tips to solve this?