I was looking around the Community forum and managed to connect my Capacitive Soil Moisture Sensor (v1.2) with a Wemos D1 Mini*, and flash it through ESP Home. I get everything but the readings… Maybe someone can help me sorting the issue?
I managed to get it recognized by ESP Home, as such:
But all I can get in the device Logs is this:
The error I’m getting:
Logger: frontend.js.latest.202207071
Source: components/system_log/__init__.py:190
First occurred: 15:09:59 (16 occurrences)
Last logged: 16:18:23
:0:0 ResizeObserver loop completed with undelivered notifications.
I cant get any readings from the sensor, neither any entity on ESPHome integration (only device). Tried both with 3V and 5V. I also tried with a different sensor, from the same batch.
Any ideas for what I’m doing wrong?
Thanks in advance for any help.
I finally had the time to finish some tests, and here are some answers and updates.
Since I’m close to zero knowledge in Yaml and ESPHome, I looked in the HAcommunity forum - here - and tried to follow the steps there, including copy/pasting whatever codes I found. So, I have no idea why this other component was there. But I took out this part of the code, and took in some other bits I’ve found here.
The only little thing I’m missing is that I loose a socket per minute or so. Not something too problematic…But with the genuine Wemos D1 Mini I just dont loose any socket. Perhaps something about the fact the EzDelivery D1 Mini clones are just lower quality.
The thing with these cheap moisture sensors is that they are not calibrated in factory and the output differs a lot between them. For example you copied the the values 0.61328 and 0.25488 for the maximums (dry and wet) and while that is probably true for the person posted that code it is most likely not the case for your sensor.
While you get some percentages now they probably are not representing your min/max.
It’s actually quite easy to “calibrate” these sensors. The maximum (wet) is just to put the sensor in a glass of water while the minimum would be just sitting in dry air. Next problem is only that the output of this type of sensors is not linear - something that the code you have doesn’t take into account. Best would be to try to also get values in between and then maybe just use the calibrate_linear function from esphome and ditch the custom lambda filter instead.
@orange-assistant, thank you again for your help. I calibrated mine with my values already That part I got! Certainly will look into changing from lambda to linear in the near future, and will come back with the results.