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
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:
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.
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:
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
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.
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.
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\x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FF\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
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
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
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.