Getting VEML6075 Working with External Components

I have just changed over to 2025.2.0 and the external components change has caused an issue with VEML6075 UVA Detectors.
Currently the config looks like this

  includes:
    - veml6075_custom_sensor.h
  libraries:
    - "Wire"
    - "https://github.com/sparkfun/SparkFun_VEML6075_Arduino_Library"

and

  # UV 6075 Sensor
  - platform: custom
    lambda: |-
      auto veml6075 = new VEML6075CustomSensor(50000);
      App.register_component(veml6075);
      return {veml6075->uva_sensor, veml6075->uvb_sensor};
    sensors:
    - name: "uva"
      id: zelva_uva
      unit_of_measurement: "µW/c²"
    accuracy_decimals: 0
    - name: "uvb"
      id: zelva_uvb
      unit_of_measurement: "µW/c²"
    accuracy_decimals: 0

Has anyone been able to convert this to an external_component ?

Try with this approach:

3 Likes

While this has worked is there anyone that has got some way to make it work with an external component ?

Someone would have to write the external component code first. So far no one has stepped up to do that. Someone who has the sensor would need to know how to create an external component (or learn how first). If you have a decent background in programming in general (and firmware concepts) plus c++ AND Python AND esphome it would not be too hard. If you are missing one or more it will be challenging to VERY challenging.

If you just want your sensor to work so you can do other things, just use the method provided. It does pretty much exactly what esphome did before they removed support for custom components.

1 Like