Hi, i hv a problem with the connection to a KAIFA Smartmeter in Austria. Here are the log entry which i cant solve:
[09:31:27][W][component:237]: Component took a long time for an operation (1855 ms).
[09:31:27][W][component:238]: Components should block for at most 30 ms.
[09:31:27][E][espdm:053]: MBUS: Start bytes do not match
[…]
My UART config:
uart:
tx_pin: GPIO1
rx_pin: D7
baud_rate: 2400
rx_buffer_size: 1700
id: mbus
Thanks a lot for your help !!!
Erich
This is my yaml:
substitutions:
device_name: slimmelezer
device_description: "DIY P1 module to read your smart meter"
esphome:
name: ${device_name}
comment: "${device_description}"
platform: ESP8266
board: d1_mini
includes:
- /config/esphome/esphome-dlms-meter
# Enable logging
logger:
level: DEBUG # (VERBOSE funktioniert nicht)
baud_rate: 0
# Enable Home Assistant API
api:
encryption:
key: !secret api_encryption_key
ota:
password: "af528ad48112c9d8a37b7e8d7901de61"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# fast_connect: true
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Smartmeter Fallback Hotspot"
password: !secret wifi_password
# captive_portal:
web_server:
port: 80
uart:
tx_pin: GPIO1
rx_pin: D7
baud_rate: 2400
rx_buffer_size: 1700
id: mbus
sensor:
- platform: template
id: meter01_voltage_l1
name: meter01_voltage_l1
unit_of_measurement: V
accuracy_decimals: 1
device_class: "voltage"
state_class: "measurement"
- platform: template
id: meter01_voltage_l2
name: meter01_voltage_l2
unit_of_measurement: V
accuracy_decimals: 1
device_class: "voltage"
state_class: "measurement"
- platform: template
id: meter01_voltage_l3
name: meter01_voltage_l3
unit_of_measurement: V
accuracy_decimals: 1
device_class: "voltage"
state_class: "measurement"
- platform: template
id: meter01_current_l1
name: meter01_current_l1
unit_of_measurement: A
accuracy_decimals: 2
device_class: "current"
state_class: "measurement"
- platform: template
id: meter01_current_l2
name: meter01_current_l2
unit_of_measurement: A
accuracy_decimals: 2
device_class: "current"
state_class: "measurement"
- platform: template
id: meter01_current_l3
name: meter01_current_l3
unit_of_measurement: A
accuracy_decimals: 2
device_class: "current"
state_class: "measurement"
- platform: template
id: meter01_active_power_plus
name: meter01_active_power_plus
unit_of_measurement: W
accuracy_decimals: 0
device_class: "power"
state_class: "measurement"
- platform: template
id: meter01_active_power_minus
name: meter01_active_power_minus
unit_of_measurement: W
accuracy_decimals: 0
device_class: "power"
state_class: "measurement"
- platform: template
id: meter01_active_energy_plus
name: meter01_active_energy_plus
unit_of_measurement: Wh
accuracy_decimals: 0
device_class: "energy"
state_class: "total_increasing"
- platform: template
id: meter01_active_energy_minus
name: meter01_active_energy_minus
unit_of_measurement: Wh
accuracy_decimals: 0
device_class: "energy"
state_class: "total_increasing"
- platform: template
id: meter01_reactive_energy_plus
name: meter01_reactive_energy_plus
unit_of_measurement: Wh
accuracy_decimals: 0
device_class: "energy"
state_class: "total_increasing"
- platform: template
id: meter01_reactive_energy_minus
name: meter01_reactive_energy_minus
unit_of_measurement: Wh
accuracy_decimals: 0
device_class: "energy"
state_class: "total_increasing"
text_sensor:
- platform: template
id: meter01_timestamp
name: meter01_timestamp
- platform: wifi_info
ip_address:
name: "IP Address"
ssid:
name: "Wi-Fi SSID"
bssid:
name: "Wi-Fi BSSID"
mqtt:
broker: "192.168.1.30"
port: "1883"
username: "AAA"
password: "bbb"
id: mqtt_broker
discovery: true
custom_component:
- lambda: |-
auto dlms_meter = new esphome::espdm::DlmsMeter(id(mbus));
uint8_t key[] = {0xXX, 0xD2, 0x40, 0x24, 0xXX, 0xB4, 0xD3, 0xB3, 0x2F, 0x8F, 0x80, 0x3A, 0x01, 0xE3, 0x1F, 0xDC};
dlms_meter->set_key(key, 16);
dlms_meter->set_voltage_sensors(id(meter01_voltage_l1), id(meter01_voltage_l2), id(meter01_voltage_l3));
dlms_meter->set_current_sensors(id(meter01_current_l1), id(meter01_current_l2), id(meter01_current_l3));
dlms_meter->set_active_power_sensors(id(meter01_active_power_plus), id(meter01_active_power_minus));
dlms_meter->set_active_energy_sensors(id(meter01_active_energy_plus), id(meter01_active_energy_minus));
dlms_meter->set_reactive_energy_sensors(id(meter01_reactive_energy_plus), id(meter01_reactive_energy_minus));
dlms_meter->set_timestamp_sensor(id(meter01_timestamp)); // Set sensor to use for timestamp (optional)
dlms_meter->enable_mqtt(id(mqtt_broker), "meter01/data");
return {dlms_meter};