volca / april-soil-esphome-module

Custom april soil moisture sensor module for esphome
https://wiki.aprbrother.com/en/april_soil_moisture_sensor.html
2 stars 1 forks source link

% as moisture unit_of_measurement #2

Closed peterbarbosa closed 3 months ago

peterbarbosa commented 3 months ago

Hello,

Would anyone know the calculation to get the unit_of_measurement to be a % and what the correct formula would be?

volca commented 3 months ago

You can read two values for dry and put the sensor part into water. Let's say the previous one is the 0%, the last one is 100%. You can calculate the percent value depend the two values.

peterbarbosa commented 3 months ago

Any way to do that within sensor or will I need to do it within HA?

And any way to retain the value on MQTT/HA? Right now sensor shows as unavailable until next update.

volca commented 3 months ago

Please also check the ESPhome for April Soil Moisture Sensor. It should match your requirements.

peterbarbosa commented 3 months ago

Yes, that seems to work. Still working on configuring the time to wake up, but using some of their code works great!