feature-requests icon indicating copy to clipboard operation
feature-requests copied to clipboard

GUVA-S12SD

Open mastersf opened this issue 1 year ago • 1 comments

Looking for official support of GUVA-S12SD. I don't see the implementation guidance. As has been implemented by me from various resources across Google search results I'm still not getting a correct UV value. Values randomly appear as 10, or 9, late at night, and 0 during the morning (with no value change throughout the day). For this, https://community.home-assistant.io/t/unsupported-module-in-esphome-guva-s12sd-and-mq-135/375313/3 was used.

I'm looking to get accurate UV values.

There are numerous guidances available, which can potentially speed up the availability of this integration. For example, https://community.blynk.cc/t/esp32-blynk-analog-read-uv-sensor/65787. In addition, here are a few other resources- https://github.com/Abidh56/UV-Index-meter/blob/main/Code/UVindexmeter.ino, https://forum.arduino.cc/t/adafruit-guva-s12sd-not-working/1146308, https://forum.arduino.cc/t/help-guva-s12sd-uv-sensor-analog-reading-problem/392993 and finally https://forum.arduino.cc/t/guva-s12sd-giving-huge-voltage-values/915283/8.

Appreciate the consideration!

mastersf avatar Jan 28 '24 18:01 mastersf

Try this:

substitutions:
  uv_calibration_factor: "1.07"   # UV-sensor kalibratie
   - platform: adc
    pin: GPIO04
    id: uv_raw
    name: "UV Sensor Spanning"
    update_interval: 15s
    accuracy_decimals: 3
    filters:
      - multiply: ${uv_calibration_factor}
      - sliding_window_moving_average:
          window_size: 3
          send_every: 2

  - platform: template
    name: "UV-Index"
    id: uv_index
    unit_of_measurement: ""
    icon: "mdi:sun-wireless"
    update_interval: 15s
    accuracy_decimals: 1
    lambda: |-
      float voltage = id(uv_raw).state;
      if (voltage < 0.030) return 0.0;
      float uv_index = (voltage / 0.110) * 1.00;
      return fmax(uv_index, 0.0);

BliXem1 avatar Jun 20 '25 11:06 BliXem1