Easymeter Q3AA, Hichi Lesekopf und ESPHome funktioniert nicht

Ich probiere jetzt schon eine Woche lang, fast jeden Abend meinen Stromzähler mit ESP Home auszulesen. Nichts klappt. Mit Tasmota ist es kein Problem, alles super, aber ESP Home = Fail.
Es scheitert schon an dem Punkt wenn ich den Lesekopf auf dem Stromzähler platziere, in dem Moment Crasht dann schon das Programm auf dem Lesekopf. Ich kann also gar nichts auslesen. Hier mal mein funktionierendes Tasmota Script und das was ich mit ESP Home probiert habe. Vielleicht hat jemand eine Idee dazu?!

>D

>B

=>sensor53 r

>M 1

+1,3,s,0,9600,Haus

1,77070100010801ff@1000,Verbrauch_Tarif_1,kWh,Verbrauch_T1,4

1,77070100010802ff@1000,Verbrauch_Tarif_2,kWh,Verbrauch_T2,4

1,77070100010800ff@1000,Verbrauch_Summe,kWh,Verbrauch_Summe,4

1,77070100020800ff@1000,Einspeisung_Summe,kWh,Einspeisung_Summe,4

1,=h--

1,77070100240700ff@1,Leistung_L1,W,Watt_L1,2

1,77070100380700ff@1,Leistung_L2,W,Watt_L2,2

1,770701004c0700ff@1,Leistung_L3,W,Watt_L3,2

1,77070100100700ff@1,Leistung_Summe,W,Watt_Summe,2

1,=h--

1,77070100200700ff@1,Spannung_L1,V,Volt_L1,1

1,77070100340700ff@1,Spannung_L2,V,Volt_L2,1

1,77070100480700ff@1,Spannung_L3,V,Volt_L3,1

esphome:
  name: esphome-web-cf7ffc
  friendly_name: Hausstromzaehler

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "***"

ota:


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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-Cf7Ffc"
    password: "***"

#captive_portal:

web_server:
  port: 80
  # Enable fallback hotspot (captive portal) in case wifi connection fails

time:
  - platform: homeassistant
    id: homeassistant_time

captive_portal:

external_components:
  - source: github://alengwenus/esphome_components@main
    refresh: 0s
    components: [sml]

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

sml:
  id: mysml
  uart_id: uart_bus

sensor:
  - platform: sml
    name: "Total energy"
    sml_id: mysml
    server_id: "0123456789abcdef"
    obis_code: "1-0:1.8.0"
    unit_of_measurement: kWh
    accuracy_decimals: 1
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.0001

:crayon:by HarryP: Codezeilen formatiert (bitte immer in </> einbinden)

Ich habe den ESPHome Code absichlich ganz kurz gehalten. Aber selbst mit nur der einen Abfrage stürzt der ESP gleich ab, bzw. endet in einer Bootfolge. Aus meinem Zähler kann man folgende Obis Codes finden. Aber erst ab dem Punkt wo ich den Lesekopf auf den Zähler tue, wenn also seriell etwas empfangen wird.

1.8.0 Zählerstand Bezug
2.8.0 Zählerstand Lieferung
10.7.0 Wirkleistung total
24.7.0 Wirkleistung L1
38.7.0 Wirkleistung L2
4C.7.0 Wirkleistung L3
20.7.0 Spannung L1
34.7.0 Spannung L2
48.7.0 Spannung L3

bist du weitergekommen? ich lese meinen EasyMeter Q3A auch mit Tasmota aus aber will nun gerne auf ESPHome umsteigen.

Nein, anscheinend kann leider niemand helfen. Bei mir läuft immer noch Tasmota.

habs jetzt geschafft. der lesekopf ist bei mir an gpio16 und 17 eines esp32. komischerweise musste ich den tx port im code angeben. die beschriftung am lesekopf scheint also vertauscht zu sein.

hier meine yaml:

substitutions:
  devicename: "esphome-32-02"
  friendlyname: "ESPHome-32_02"
  chipname: "ESP32"
  boardname: "esp32dev"
  
esphome:
  name: ${devicename}
  friendly_name: ${friendlyname}
  platform: ${chipname}
  board: ${boardname}

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: "${devicename} Fallback Hotspot"
    password: !secret wifi_fallback

# Enable Home Assistant API
api:
  encryption:
    key: !secret esphome_api
    
# Enable "over the air" updates
ota:
  - platform: esphome
    password: !secret esphome_ota
# Enable logging
logger:
  baud_rate: 0  # Disable logging over the serial port
  level: DEBUG

# Enable webserver
web_server:

captive_portal:

uart:
  id: uart_bus
  rx_pin: GPIO17
  baud_rate: 9600
  data_bits: 8
  parity: NONE
  stop_bits: 1
  debug: 

sml:
  id: mysml
  uart_id: uart_bus

text_sensor:
  - platform: sml
    name: "EasyMeterQ3A"
    sml_id: mysml
    server_id: !secret esphome_sml_server_id
    #Change to your server ID as visiable fro the text debug console
    obis_code: "129-129:199.130.3"
    format: text
sensor:
  - platform: sml
    name: "1-0:0.0.9"
    sml_id: mysml
    obis_code: "1-0:0.0.9"
    unit_of_measurement: kWh
    accuracy_decimals: 4
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 1
  - platform: sml
    name: "zaehlerstand"
    sml_id: mysml
    obis_code: "1-0:1.8.0"
    unit_of_measurement: kWh
    accuracy_decimals: 4
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.0000001
  - platform: sml
    name: "aktueller verbrauch"
    sml_id: mysml
    obis_code: "1-0:16.7.0"
    unit_of_measurement: W
    accuracy_decimals: 0
    device_class: energy
    filters:
      - multiply: 0.01
  - platform: sml
    name: "aktueller verbrauch phase a"
    sml_id: mysml
    obis_code: "1-0:36.7.0"
    unit_of_measurement: W
    accuracy_decimals: 0
    device_class: energy
    filters:
      - multiply: 0.01
  - platform: sml
    name: "aktueller verbrauch phase b"
    sml_id: mysml
    obis_code: "1-0:56.7.0"
    unit_of_measurement: W
    accuracy_decimals: 0
    device_class: energy
    filters:
      - multiply: 0.01
  - platform: sml
    name: "aktueller verbrauch phase c"
    sml_id: mysml
    obis_code: "1-0:76.7.0"
    unit_of_measurement: W
    accuracy_decimals: 0
    device_class: energy
    filters:
      - multiply: 0.01
  - platform: sml
    name: "volt phase a"
    sml_id: mysml
    obis_code: "1-0:32.7.0"
    unit_of_measurement: kWh
    accuracy_decimals: 4
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 1
  - platform: sml
    name: "volt phase b"
    sml_id: mysml
    obis_code: "1-0:52.7.0"
    unit_of_measurement: kWh
    accuracy_decimals: 4
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 1
  - platform: sml
    name: "volt phase c"
    sml_id: mysml
    obis_code: "1-0:72.7.0"
    unit_of_measurement: kWh
    accuracy_decimals: 4
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 1
  - platform: sml
    name: "zaehlernummer"
    sml_id: mysml
    obis_code: "1-0:0.0.0"
    unit_of_measurement: kWh
    accuracy_decimals: 4
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 1

Super, das probiere ich nachher sofort mal aus! Wie kommst du auf den Obis Code vom text_sensor?

ich hatte den logger für sml eingeschaltet. als ich das teil rangehalten hab, hab ich einen textblock erhalten in dem sich alles raussuchen ließ.

Ok, konnte alles umsetzen, was allerdings nicht geht ist die Zählernummer anzuzeigen. Wobei das auch eigentlich bei Obis Code 1-0:0.0.9 sein sollte. Wird bei dir eine Zählernummer angezeigt?

zählernummer war: 1-0:0.0.0
1-0:0.0.9 ist die server id
hab ihn aber noch nicht im einsatz. fest kann ich es dir erst in paar tagen sagen

Das kann mein Zähler alles. Im Log wird die Server Id angezeigt, aber nicht in der Web Oberfläche und auch nicht im EspHome abgebildet.
129-129:199.130.3
129-129:199.130.5
1-0:0.0.9
1-0:1.8.0
1-0:2.8.0
1-0:1.8.1
1-0:1.8.2
1-0:16.7.0
1-0:36.7.0
1-0:56.7.0
1-0:76.7.0
1-0:0.0.0
1-0:32.7.0
1-0:52.7.0
1-0:72.7.0

da hast du einen zweirichtungszähler? ich habe leider nur die variante mit rücklaufsperre. er zählt also leider nicht meine einspeisung.

hier was meiner kann:
[22:55:21][D][sml:078]: OBIS info:
[22:55:21][D][sml:084]: (090…) 129-129:199.130.3 [0x455359]
[22:55:21][D][sml:084]: (090…) 1-0:0.0.9 [0x090…]
[22:55:21][D][sml:084]: (090…) 1-0:1.8.0 [0x00000014b88c8c5a]
[22:55:21][D][sml:084]: (090…) 1-0:16.7.0 [0x0000000000004234]
[22:55:21][D][sml:084]: (090…) 1-0:36.7.0 [0x0000000000002a02]
[22:55:21][D][sml:084]: (090…) 1-0:56.7.0 [0x0000000000000a09]
[22:55:21][D][sml:084]: (090…) 1-0:76.7.0 [0x0000000000000e28]
[22:55:21][D][sml:084]: (090…) 1-0:32.7.0 [0x0941]
[22:55:21][D][sml:084]: (090…) 1-0:52.7.0 [0x093c]
[22:55:21][D][sml:084]: (090…) 1-0:72.7.0 [0x0946]
[22:55:21][D][sml:084]: (090…) 1-0:0.0.0 [0x314…]
[22:55:21][D][sml:084]: (090…) 129-129:199.240.6 [0x01073e]

So, hiermit funktioniert nun alles. Auch die Anzeige der “Zählernummer”. Ich füge die Tage noch ein das auch Mqtt Messages mit den Werten verschickt werden.

substitutions:
  name: hauszaehler
  friendly_name: Hauszaehler
  chipname: "ESP8266"
  boardname: "esp01_1m"
esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  min_version: 2024.6.0
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: '1.0'

esp8266:
  board: esp01_1m

# Enable logging
logger:
  baud_rate: 0

# Allow Over-The-Air updates
ota:
- platform: esphome


wifi:
  # Set up a wifi access point
  ap: {}

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:

# Enable Home Assistant API
api:
  encryption:
    key: ""

# Enable webserver
web_server:
  port: 80

uart:
  id: uart_bus
  rx_pin: GPIO3
  baud_rate: 9600
  data_bits: 8
  parity: NONE
  stop_bits: 1
  debug: 

sml:
  id: mysml
  uart_id: uart_bus

text_sensor:
  - platform: sml
    name: "EasyMeterQ3A"
    sml_id: mysml
    #server_id: !secret esphome_sml_server_id
    #Change to your server ID as visiable fro the text debug console
    obis_code: "129-129:199.130.3"
    format: text
  - platform: sml
    name: "Zaehlernummer"
    sml_id: mysml
    obis_code: "1-0:0.0.0"
    format: text

sensor:
  - platform: sml
    name: "Einspeisung"
    sml_id: mysml
    obis_code: "1-0:2.8.0"
    unit_of_measurement: kWh
    accuracy_decimals: 2
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.0000001
  - platform: sml
    name: "Zaehlerstand"
    sml_id: mysml
    obis_code: "1-0:1.8.0"
    unit_of_measurement: kWh
    accuracy_decimals: 2
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.0000001
  - platform: sml
    name: "aktueller Verbrauch"
    sml_id: mysml
    obis_code: "1-0:16.7.0"
    unit_of_measurement: W
    accuracy_decimals: 0
    device_class: energy
    filters:
      - multiply: 0.01
  - platform: sml
    name: "aktuelle Leistung L1"
    sml_id: mysml
    obis_code: "1-0:36.7.0"
    unit_of_measurement: W
    accuracy_decimals: 0
    device_class: energy
    filters:
      - multiply: 0.01
  - platform: sml
    name: "aktuelle Leistung L2"
    sml_id: mysml
    obis_code: "1-0:56.7.0"
    unit_of_measurement: W
    accuracy_decimals: 0
    device_class: energy
    filters:
      - multiply: 0.01
  - platform: sml
    name: "aktuelle Leistung L3"
    sml_id: mysml
    obis_code: "1-0:76.7.0"
    unit_of_measurement: W
    accuracy_decimals: 0
    device_class: energy
    filters:
      - multiply: 0.01
  - platform: sml
    name: "Volt L1"
    sml_id: mysml
    obis_code: "1-0:32.7.0"
    unit_of_measurement: V
    accuracy_decimals: 1
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.1
  - platform: sml
    name: "Volt L2"
    sml_id: mysml
    obis_code: "1-0:52.7.0"
    unit_of_measurement: V
    accuracy_decimals: 1
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.1
  - platform: sml
    name: "Volt L3"
    sml_id: mysml
    obis_code: "1-0:72.7.0"
    unit_of_measurement: V
    accuracy_decimals: 1
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.1
1 „Gefällt mir“