Adafruit VEML6075 UVA UVB and UV Index Sensor

Tags: #<Tag:0x00007f78042b9c50> #<Tag:0x00007f78042b9b10>

Did anybody ever get this sensor working in esphome ?

I have tried the following that was posted on github but it just returns 65535 and never changes values

File: veml6070_custom_sensor.h

#include "esphome.h"
#include "Adafruit_VEML6070.h"


class VEML6070CustomSensor : public PollingComponent, public Sensor {
 public:
  Adafruit_VEML6070 uv = Adafruit_VEML6070();
  VEML6070CustomSensor() : PollingComponent(15000) {}
  void setup() override {
    Wire.begin();
    uv.begin(VEML6070_1_T);
  }
  void update() override {
    uint16_t cur_uv = uv.readUV();
    ESP_LOGD("custom", "The value of sensor is: %i", cur_uv);
    publish_state(cur_uv);
  }
};

Espconfig:

esphome:
  name: wetterstation
  platform: ESP8266
  board: esp01_1m
  includes:
    - veml6070_custom_sensor.h
  libraries:
    - "https://github.com/adafruit/Adafruit_VEML6070"

...

i2c:
  sda: GPIO5
  scl: GPIO4

...

sensor:
  - platform: custom
    lambda: |-
      auto veml6070 = new VEML6070CustomSensor();
      App.register_component(veml6070);
      return {veml6070};
    sensors:
      name: "VEML6070 Custom Sensor"

The sensor i got is this one Sensor VEML6075 and on that page they state the library is the following “Library for sensor”

I have same situation If you find something let me know please, have a nice day…

Using the same code you have here and it is working without problem. the only difference I have is these

  board: nodemcuv2
...
i2c:
  sda: GPIO4
  scl: GPIO5