Im trying to make a small sensor with a nodmcu lolin V3 that can measure light (for automation) and the UV, to know how much sun there is and calculate the mW/cm^2. So the light sensor was a brease and have it working with ESPHome without any hicups, but the UV sensor is another story.
Seems ESPhome doesnt have a sensor specific for it (the ML8511 sensor) wich means i need to do this via arduino code (C++), so my question is can i make a costum sensor with all the code i need to convert the voltage reading (from ML8511) to mW/cm^2 without using arduino code?
Here is the code i have currently (i can see the voltage reading from the uv sensor) in ESPhome:
esphome:
name: solar-sensor
platform: ESP8266
board: nodemcuv2
/# Enable logging
logger:
/# Enable Home Assistant API
api:
ota:
password: "8a6e8e7d3263e0b03992f19297e31f9f"
wifi:
ssid: "AKIWIFI 44710"
password: !secret wifi_password
/ # Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Solar-Sensor Fallback Hotspot"
password: "XXXXXXXXX"
captive_portal:
/# I2C Lumen sensor
i2c:
sda: GPIO4
scl: GPIO5
scan: true
id: bus_a
/# Example configuration entry
sensor:
- platform: bh1750
name: "BH1750 Illuminance"
address: 0x23
measurement_duration: 69
update_interval: 20s
- platform: adc
pin: A0
name: "UV Read"
update_interval: 10s
filters:
- multiply: 3.3
I want to use the code given by this website on my uv sensor:
https://www.esp8266learning.com/wemos-ml8511-example.php
Thanks in advance!