Sonoff BASICZBR3 – Simple and automatic watering plant system

Buy Sonoff Basic ZB
Buy Water Pump
Buy Sonoff Waterproof Box
Buy Garden Watering Kit

The summer season is over, and my plants have survived while I was on holiday. Home Assistant, was the responsible to take care of their watering.

The schema is quite simple, you need two basic components: a Sonoff Basic Zigbee and a 220V Mini Immersion Water pump.

Other than that you will need a water tank to feed the pump (I’m using a 15L generic water tank) and a Garden Watering System Kit (just pay attention to match the pipe diameter with the pump nozzle diameter)

So connect everything as shown above, put the pump on bottom of the tank (only the pump not the sonoff!!!) and connect a pipe from the pump nozzle to your loved plant. For safety reason (keep the water away from electronics) I’ve also enclosed the Sonoff on a electronics waterproof box.

Handling mains voltage can be very dangerous!!!

As any another Zigbee devices we are going to pair the Sonoff Basic ZB using the Zigbee2mqtt addon on Home Assistant:

  • Click Enable join (All) button from Zigbee2mqtt control panel
  • Power your Sonoff from mains
  • Hold Reset button on Sonoff until led blinks
  • Wait for device pairing, after few seconds it will appears on you Devices list
  • Navigate from Home Assistant main menu to Configuration IntegrationDevices
  • Find out the Sonoff BASICZBR3 device and click on it
  • Two entities will be automatically available: Link quality and the Switch
  • Use the switch entity to turn on the pump and test the system. Water should flow from the tank to the thirsty plant

So now to use this entity we could create an automation that will automatically run the pump for a fixed time on scheduled week days.

  • ConfigurationAutomationsADD AUTOMATION
  • Click Edit in YAML
  • Copy and Paste following code
  • Replace device_id and entity_id with your Sonoff Switch device and entity information
alias: Plant Scheduling Watering
description: ''
  - platform: time
    at: '09:00:00'
  - condition: template
    value_template: '{{ now().weekday() in [0,1,3,5] }}'
  - type: turn_on
    device_id: 7f6174bb6b9ad71e8137b7bdfb94964c
    entity_id: switch.pompa_acqua
    domain: switch
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: 7f6174bb6b9ad71e8137b7bdfb94964c
    entity_id: switch.pompa_acqua
    domain: switch
  - service: notify.mobile_app_sm_a525f
      message: Plant watering completed!
      title: Plant watering
mode: single

This automation will automatically run the irrigation pump for 1 minutes on Monday, Tuesday, Thursday, Saturday and will send a notification to my mobile phone.

Now, just pay attention to not run out of water!