11-01-2023, 06:02 PM
(10-30-2023, 09:06 PM)admin Wrote: E16P have 4CH analog input ports. A1,A2 for dc 0-5v signal input. A3,A4 for 4-20mA signal input.
here is ESPHome config yaml deom for monitor analog sensor, you can check it: https://www.kincony.com/forum/showthread.php?tid=3432
if you want read SHT31 sensor, it's easy, just see SHT31 ESPHome config file at here: https://esphome.io/components/sensor/sht3xd.html
That's great thanks,
I have managed to get both water and temperature/humidity sensors setup now cheers. Here is my Yaml, As you can see i have adapted the code for one sensor on pin 36 that works by returning a value between 0-2.5v and pin 35 that works by returning a value between 0-5v, this code is to convert values from both sensors so they are displayed as a percentage on a scale so i know what % of water there is remaining in my water tank.
# Individual sensors
sensor:
- platform: sht3xd
temperature:
name: "Van Temperature i2c"
humidity:
name: "Van Humidity i2c"
address: 0x44
update_interval: 1s
#analog sensor for water level
- platform: adc
pin: 36
name: "Water level CH1 Voltage"
update_interval: 1s
attenuation: 11db
filters:
- lambda:
if (x >= 3.11) {
return x * 64.06640;
} else if (x <= 0.15) {
return 0;
} else {
return x * 60.40;
}
#ultrasonic sensor for water level
- platform: adc
pin: 35
name: "Ultrasonic water level ch2 Voltage"
update_interval: 1s
attenuation: 11db
filters:
# - multiply: 1.51515
- lambda:
if (x >= 3.11) {
return x * 32.03320;
} else if (x <= 0.10) {
return 0;
} else {
return x * 30.20;
}