
Unit Watering is a capacitive soil moisture sensing and control Unit. It integrates a water pump and sensing electrodes to detect soil moisture and drive pumping, making it easy to implement moisture sensing and irrigation control in smart plant care scenarios. The electrodes use a capacitive design; compared to resistive probes, this helps avoid electrode corrosion in real use.
The capacitive soil moisture sensor reports voltage/ADC readings, so you need to enable and configure the ADC component according to the controller you use:
# Example configuration entry
sensor:
- platform: adc
pin: GPIOXX
name: "xxxx"
update_interval: 60s For example, using Atom Lite:
# Example configuration entry
sensor:
- platform: adc
pin: GPIO32
name: "xxxx"
update_interval: 60s Configure the water pump switch:
switch:
- platform: gpio
pin: GPIO26
name: "Water pump" This lets you control the pump on/off from the Home Assistant frontend.
Complete configuration example:
sensor:
- platform: adc
pin: GPIO1
id: voltage
name: "Voltage"
attenuation: auto
update_interval: 10s
- platform: template
id: adc_reading
name: "ADC Reading"
lambda: |-
return roundf( id(voltage).state * 1000.0f );
update_interval: 10s
text_sensor:
- platform: template
name: "Soil Moisture"
icon: "mdi:water-percent"
lambda: |-
const int ADC_DRY = 1550; // Dry threshold
const int ADC_WET = 1450; // Wet threshold
if ( id(adc_reading).state >= ADC_DRY) {
return {"Dry"};
} else if ( id(adc_reading).state >= ADC_WET) {
return {"Wet"};
} else {
return {"Saturated"};
}
update_interval: 10s
switch:
- platform: gpio
pin: GPIO2
id: water_pump
name: "Water pump"
icon: "mdi:water-pump"
restore_mode: RESTORE_DEFAULT_OFF Here the template sensor can be adjusted based on actual readings to report soil moisture level using thresholds:
const int ADC_DRY = 1550; // Dry threshold
const int ADC_WET = 1450; // Wet threshold In general, the drier the soil, the higher the value; the wetter the soil, the lower the value. You can also create automations based on the sensor readings to control the pump for scheduled or moisture-based watering.
If you want to schedule on/off in ESPHome, refer to the time component.
For example, turn on the pump at 7:30 AM on weekdays, water for one minute, then turn it off:
# Example configuration entry
time:
- platform: homeassistant
id: homeassistant_time
on_time:
# Every morning on weekdays
- seconds: 0
minutes: 30
hours: 7
days_of_week: MON-FRI
then:
- switch.turn_on: water_pump
- delay: 60s
- switch.turn_off: water_pump After configuration, you can view the sensor data in Home Assistant.
