The ADC platform of esphome supports update_interval which is set at default to 60s. I believe your recruirement will be fullflied by changing that to 10min or so. Did you try this?
lambda: return 100 - x/10.24;
‘’’
This is the log
[10:36:30][D][switch:021]: ‘VDD_s_humedad’ Turning ON.
[10:36:30][D][switch:045]: ‘VDD_s_humedad’: Sending state ON
[10:36:30][D][adc:056]: ‘Humedad del suelo’: Got voltage=0.05V
[10:36:30][D][sensor:092]: ‘Humedad del suelo’: Sending state 99.99533 V with 0 decimals of accuracy
[10:36:35][D][switch:025]: ‘VDD_s_humedad’ Turning OFF.
[10:36:35][D][switch:045]: ‘VDD_s_humedad’: Sending state OFF
Just to close the issue a couple of things.
I had to put a delay before updating ADC, as the values recorded were incorrect. The final configuration is:
and the log:
[17:06:30][D][switch:021]: ‘VDD_s_humedad’ Turning ON.
[17:06:30][D][switch:045]: ‘VDD_s_humedad’: Sending state ON
[17:06:32][D][adc:056]: ‘Humedad del suelo’: Got voltage=0.35V
[17:06:32][D][sensor:092]: ‘Humedad del suelo’: Sending state 65.42969 V with 0 decimals of accuracy
[17:06:35][D][switch:025]: ‘VDD_s_humedad’ Turning OFF.
[17:06:35][D][switch:045]: ‘VDD_s_humedad’: Sending state OFF
What I would like to do is to filter out the values obtained with the sensor not powered, wich are always in the range of 0,01V (90 after the conversion)
I’ve tried “on_value_range” and several lambdas formulas, but I always get compilation errors.
eHc