esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

SML component has checksum failure with ESP32 #4973

Open MichaBub opened 11 months ago

MichaBub commented 11 months ago

The problem

SML component logs checksum failure, even though data will be parsed.

Which version of ESPHome has the issue?

2023.9.3

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2023.10.2

What platform are you using?

ESP32

Board

esp32dev with chip ESP-WROOM-32

Component causing the issue

sml

Example YAML snippet

esphome:
  name:  ${device_name}
  friendly_name: ${device_name_readable}
  platform: esp32
  board: esp32dev

uart:
  id: uart_bus
#  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 9600
  data_bits: 8
  parity: NONE
  stop_bits: 1
#  rx_buffer_size: 2048

sml:
  id: mysml
  uart_id: uart_bus

sensor:
  - platform: sml
    name: "Total Energy Consumed"
    sml_id: mysml
    obis_code: "1-0:1.8.0"
    unit_of_measurement: kWh
    accuracy_decimals: 3
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.0001
  - platform: sml
    name: "Total Energy Delivered"
    sml_id: mysml
    obis_code: "1-0:2.8.0"
    unit_of_measurement: kWh
    accuracy_decimals: 3
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.0001
  - platform: sml
    name: "Current Power Total"
    sml_id: mysml
    obis_code: "1-0:16.7.0"
    unit_of_measurement: W
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
  - platform: sml
    name: "Current Power L1"
    sml_id: mysml
    obis_code: "1-0:36.7.0"
    unit_of_measurement: W
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
  - platform: sml
    name: "Current Power L2"
    sml_id: mysml
    obis_code: "1-0:56.7.0"
    unit_of_measurement: W
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
  - platform: sml
    name: "Current Power L3"
    sml_id: mysml
    obis_code: "1-0:76.7.0"
    unit_of_measurement: W
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
  - platform: sml
    name: "Current Voltage L1"
    sml_id: mysml
    obis_code: "1-0:32.7.0"
    unit_of_measurement: V
    accuracy_decimals: 1
    device_class: voltage
    state_class: measurement    
    filters:
      - multiply: 0.1
  - platform: sml
    name: "Current Voltage L2"
    sml_id: mysml
    obis_code: "1-0:52.7.0"
    unit_of_measurement: V
    accuracy_decimals: 1
    device_class: voltage
    state_class: measurement    
    filters:
      - multiply: 0.1
  - platform: sml
    name: "Current Voltage L3"
    sml_id: mysml
    obis_code: "1-0:72.7.0"
    unit_of_measurement: V
    accuracy_decimals: 1
    device_class: voltage
    state_class: measurement    
    filters:
      - multiply: 0.1
  - platform: sml
    name: "Current Current L1"
    sml_id: mysml
    obis_code: "1-0:31.7.0"
    unit_of_measurement: A
    accuracy_decimals: 2
    device_class: current
    state_class: measurement    
    filters:
      - multiply: 0.01
  - platform: sml
    name: "Current Current L2"
    sml_id: mysml
    obis_code: "1-0:51.7.0"
    unit_of_measurement: A
    accuracy_decimals: 2
    device_class: current
    state_class: measurement    
    filters:
      - multiply: 0.01
  - platform: sml
    name: "Current Current L3"
    sml_id: mysml
    obis_code: "1-0:71.7.0"
    unit_of_measurement: A
    accuracy_decimals: 2
    device_class: current
    state_class: measurement    
    filters:
      - multiply: 0.01
  - platform: sml
    name: "Current Frequency"
    sml_id: mysml
    obis_code: "1-0:14.7.0"
    unit_of_measurement: Hz
    accuracy_decimals: 2
    device_class: frequency
    state_class: measurement    
    filters:
      - multiply: 0.1

Anything in the logs that might be useful for us?

Reading out a single value:

[21:00:09][C][sml:092]: SML:
[21:00:09][C][sml_sensor:033]: SML 'Total Energy Consumed'
[21:00:09][C][sml_sensor:033]:   Device Class: 'energy'
[21:00:10][C][sml_sensor:033]:   State Class: 'total_increasing'
[21:00:10][C][sml_sensor:033]:   Unit of Measurement: 'kWh'
[21:00:10][C][sml_sensor:033]:   Accuracy Decimals: 3
[21:00:10][C][sml_sensor:037]:   OBIS Code: 1-0:1.8.0
[21:00:10][D][sml:066]: OBIS info:
[21:00:10][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:96.50.1 [0x4c4f47]
[21:00:10][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:96.1.0 [0x0a014c4f4700057ddb2b]
[21:00:10][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:1.8.0 [0x00000000000206ed]
[21:00:10][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:2.8.0 [0x0000000001c3dc71]
[21:00:10][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:16.7.0 [0x000000000000000d]
[21:00:10][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:36.7.0 [0x0000000000000006]
[21:00:10][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:56.7.0 [0x0000000000000006]
[21:00:10][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:76.7.0 [0x0000000000000000]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:32.7.0 [0x0000000000000958]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:52.7.0 [0x000000000000095a]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:72.7.0 [0x0000000000000953]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:31.7.0 [0x0000000000000031]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:51.7.0 [0x000000000000002e]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:71.7.0 [0x000000000000002f]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.1 [0x00000000000004ab]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.2 [0x000000000000095a]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.4 [0x0000000000000aac]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.15 [0x0000000000000aad]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.26 [0x0000000000000a8c]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:14.7.0 [0x00000000000001f4]
[21:00:11][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:0.2.0 [0x3036]
[21:00:12][W][sml:116]: Checksum error in received SML data.
[21:00:12][W][component:204]: Component sml took a long time for an operation (1.97 s).
[21:00:12][W][component:205]: Components should block for at most 20-30ms.

Reading out multiple values:
[08:24:44][D][sml:066]: OBIS info:
[08:24:44][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:96.50.1 [0x4c4f47]
[08:24:44][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:96.1.0 [0x0a014c4f4700057ddb2b]
[08:24:44][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:1.8.0 [0x0000000000020c9b]
[08:24:44][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:2.8.0 [0x0000000001c3e1ce]
[08:24:44][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:16.7.0 [0xfffffffffffffe48]
[08:24:44][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:36.7.0 [0xffffffffffffff6a]
[08:24:45][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:56.7.0 [0xffffffffffffff76]
[08:24:45][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:76.7.0 [0xffffffffffffff69]
[08:24:45][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:32.7.0 [0x0000000000000960]
[08:24:45][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:52.7.0 [0x0000000000000957]
[08:24:45][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:72.7.0 [0x0000000000000956]
[08:24:45][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:31.7.0 [0x000000000000005c]
[08:24:45][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:51.7.0 [0x0000000000000059]
[08:24:45][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:71.7.0 [0x0000000000000058]
[08:24:45][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.1 [0x00000000000004ac]
[08:24:45][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.2 [0x000000000000096e]
[08:24:45][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.4 [0x0000000000000897]
[08:24:46][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.15 [0x0000000000000893]
[08:24:46][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.26 [0x0000000000000875]
[08:24:46][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:14.7.0 [0x00000000000001f4]
[08:24:46][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:0.2.0 [0x3036]
[08:24:46][W][sml:116]: Checksum error in received SML data.
[08:24:46][W][component:204]: Component sml took a long time for an operation (3.25 s).
[08:24:46][W][component:205]: Components should block for at most 20-30ms.
[08:24:47][D][sensor:094]: 'Total Energy Consumed': Sending state 13.42990 kWh with 3 decimals of accuracy
[08:24:47][D][sensor:094]: 'Total Energy Delivered': Sending state 2961.45483 kWh with 3 decimals of accuracy
[08:24:47][D][sensor:094]: 'Current Power Total': Sending state -449.00000 W with 0 decimals of accuracy
[08:24:47][D][sensor:094]: 'Current Power L1': Sending state -153.00000 W with 0 decimals of accuracy
[08:24:47][D][sensor:094]: 'Current Power L2': Sending state -143.00000 W with 0 decimals of accuracy
[08:24:47][D][sensor:094]: 'Current Power L3': Sending state -152.00000 W with 0 decimals of accuracy
[08:24:47][D][sensor:094]: 'Current Voltage L1': Sending state 239.70000 V with 1 decimals of accuracy
[08:24:47][D][sensor:094]: 'Current Voltage L2': Sending state 238.60001 V with 1 decimals of accuracy
[08:24:47][D][sensor:094]: 'Current Voltage L3': Sending state 238.90001 V with 1 decimals of accuracy
[08:24:48][D][sensor:094]: 'Current Current L1': Sending state 0.91000 A with 2 decimals of accuracy
[08:24:48][D][sensor:094]: 'Current Current L2': Sending state 0.86000 A with 2 decimals of accuracy
[08:24:48][D][sensor:094]: 'Current Current L3': Sending state 0.88000 A with 2 decimals of accuracy
[08:24:48][D][sensor:094]: 'Current Frequency': Sending state 50.00000 Hz with 2 decimals of accuracy
[08:24:48][D][sml:066]: OBIS info:
[08:24:48][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:96.50.1 [0x4c4f47]
[08:24:48][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:96.1.0 [0x0a014c4f4700057ddb2b]
[08:24:48][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:1.8.0 [0x0000000000020c9b]
[08:24:48][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:2.8.0 [0x0000000001c3e1d3]
[08:24:48][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:16.7.0 [0xfffffffffffffe3f]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:36.7.0 [0xffffffffffffff67]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:56.7.0 [0xffffffffffffff71]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:76.7.0 [0xffffffffffffff68]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:32.7.0 [0x000000000000095d]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:52.7.0 [0x0000000000000952]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:72.7.0 [0x0000000000000955]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:31.7.0 [0x000000000000005b]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:51.7.0 [0x0000000000000056]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:71.7.0 [0x0000000000000058]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.1 [0x00000000000004aa]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.2 [0x000000000000096e]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.4 [0x0000000000000891]
[08:24:49][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.15 [0x0000000000000889]
[08:24:50][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:81.7.26 [0x0000000000000870]
[08:24:50][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:14.7.0 [0x00000000000001f4]
[08:24:50][D][sml:072]:   (0a014c4f4700057ddb2b) 1-0:0.2.0 [0x3036]
[08:24:50][W][sml:116]: Checksum error in received SML data.

Additional information

using following logarex smartmeter: https://tasmota.github.io/docs/Smart-Meter-Interface/#logarex-lk13be-sml-eg-lk13be6067x9

github-actions[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.