esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
289 stars 36 forks source link

DSMR ESP-IDF Support #3982

Open LarsStegman opened 1 year ago

LarsStegman commented 1 year ago

The problem

I want to upgrade an esp8266 d1 mini to an esp32 d1 mini and I am currently using DSMR. I want to use the ESP-IDF Framework because I want to use the new ESP for the Bluetooth Proxy function as well. I get an error in the editor indicating the DSMR component is only available on the Arduino framework.

Which version of ESPHome has the issue?

2022.12.3

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2022.12.8

What platform are you using?

ESP32-IDF

Board

esp32_d1_mini

Component causing the issue

dsmr

Example YAML snippet

substitutions:
  name: bluetooth-proxy-test

esphome:
  name: ${name}

esp32:
  board: wemos_d1_mini32
  framework:
    type: esp-idf

# Enable logging
logger:
  level: DEBUG

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

ota:
  password: "xxxx"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bluetooth-Proxy-Test"
    password: "xxxx"

#captive_portal:
improv_serial:

esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
    active: true

bluetooth_proxy:
  active: true

# Slimme meter seriele poort
uart:
  rx_pin: 
    number: GPIO10
    inverted: true
  baud_rate: 115200

dsmr:  # << Error: This feature is only available with frameworks ['arduino'].

sensor:
  # Slimme meter
  - platform: dsmr
    energy_delivered_tariff1:
      name: Energy Consumed Tariff 1
    energy_delivered_tariff2:
      name: Energy Consumed Tariff 2
    energy_returned_tariff1:
      name: Energy Returned Tariff 1
    energy_returned_tariff2:
      name: Energy Returned Tariff 2
    power_delivered:
      name: Power Consumed
    power_returned:
      name: Power Returned
    gas_delivered:
      name: Gas Consumed
    electricity_failures:
      name: Electricity Failures
    electricity_long_failures:
      name: Long Electricity Failures
    voltage_l1:
      name: Voltage Line 1
    #voltage_l2:
    #  name: Voltage Line 2
    #voltage_l3:
    #  name: Voltage Line 3
    current_l1:
      name: Current Line 1
    #current_l2:
    #  name: Current Line 2
    #current_l3:
    #  name: Current Line 3
    power_delivered_l1:
      name: Power Consumed Line 1
    #power_delivered_l2:
    #  name: Power Consumed Line 2
    #power_delivered_l3:
    #  name: Power Consumed Line 3
    power_returned_l1:
      name: Power Returned Line 1
    #power_returned_l2:
    #  name: Power Returned Line 2
    #power_returned_l3:
    #  name: Power Returned Line 3

text_sensor:
  # Slimme meter
  - platform: dsmr
    identification:
      name: "DSMR Identification"
    p1_version:
      name: "DSMR Version"
    timestamp:
      name: "DSMR Timestamp"
    electricity_tariff:
      name: "DSMR Tariff"
    electricity_failure_log:
      name: "DSMR Electricity Failure Log"
    message_short:
      name: "DSMR Message Short"
    message_long:
      name: "DSMR Message Long"
    gas_equipment_id:
      name: "Gas Meter Equipment ID"
    #water_equipment_id:
    #  name: "Water Meter Equipment ID"
    #sub_equipment_id:
    #  name: "Sub Meter Equipment ID"

Anything in the logs that might be useful for us?

No response

Additional information

No response

RoboMagus commented 1 year ago

The DSMR component uses the glmnet/Dsmr Arduino library. Doesn't look like there's a "simple fix" to get this to work without the Arduino framework.