esphome-dlms-meter: Bug since esphome 2025-02: "custom" component has been removed

Failed config

custom_component: [source /config/esphome/smartmeter-esp.yaml:307]
  
  The "custom" component has been removed. Consider conversion to an external component.
  https://esphome.io/guides/contributing#a-note-about-custom-components.
  - lambda: |-
      
      auto dlms_meter = new esphome::espdm::DlmsMeter(id(mbus));
      
      uint8_t key[] = {};
      dlms_meter->set_key(key, 16); // Pass your decryption key and key length here
      
      dlms_meter->set_voltage_sensors(id(meter01_voltage_l1), id(meter01_voltage_l2), id(meter01_voltage_l3)); // Set sensors to use for voltage (optional)
      
      dlms_meter->set_current_sensors(id(meter01_current_l1), id(meter01_current_l2), id(meter01_current_l3)); // Set sensors to use for current (optional)
      

Can anyone update the tescription to use it as external component?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 3
  • Comments: 29

Most upvoted comments

@ximex I agree, will have a look on Simon’s project (it might be working for me too after all).

Also, he implemented the ESPHome component structure in a different way than I did, which looks quite interesting.

I don’t know how actively this repo is still maintained, but getting all the implementations merged into one thats working and easily configurable with the new external_components structure definitly makes sense.

@mariopenzendorfer

Which provider do you have?

Yes. Heavily inspired by the dsmr component. Hope this makes implementing more sensors easier / less copy paste.

Which repo do you mean? Domis or mine? For me: I work on this in my free time, so obviously not everything will happen instantly but if issues arise i will try to fix them.

Agreed, this is why i already merged a few implementations into mine. And now trying to get this upstreamed into esphome itself.

Hi @firegore,

Great so see you here. Big thanks also to you for initially figuring out the evn stuff.

yes it was a copy/paste error. i copied to codeblock from another PR and forgot to change to component

ximex: I am a bit confused, This does not work for me, so i tested the code from https://github.com/DomiStyle/esphome-dlms-meter/issues/47#issuecomment-2671025166

maybe this PR helps someone: esphome/esphome#8009

external_components:

  • source: github://pr#8009 components: [ i2c ]

but if i change it to

external_components:
  - source: github://pr#8009
    components: [ dlms_meter ]

it works for me! Do i misunderstand something?

You change is correct. I think just a typo from @ximex .

@ximex I agree, will have a look on Simon’s project (it might be working for me too after all).

Also, he implemented the ESPHome component structure in a different way than I did, which looks quite interesting.

I don’t know how actively this repo is still maintained, but getting all the implementations merged into one thats working and easily configurable with the new external_components structure definitly makes sense.

@mariopenzendorfer

Which provider do you have?

Yes. Heavily inspired by the dsmr component. Hope this makes implementing more sensors easier / less copy paste.

Which repo do you mean? Domis or mine? For me: I work on this in my free time, so obviously not everything will happen instantly but if issues arise i will try to fix them.

Agreed, this is why i already merged a few implementations into mine. And now trying to get this upstreamed into esphome itself.

The problem is that the ESP Home custom_component was replaced by the external_component.

Here is a link to the announcement of the removal: https://esphome.io/guides/contributing#a-note-about-custom-components

And here is the link to the external component documentation: https://esphome.io/components/external_components

@DomiStyle - can you please check the code and rewrite? Thank you - greeting aus Höchst 😉