How to make a smart controller for my Pond Drum Filter ??


Hi All
I recently fitted a drum filter to my pond. The controller basically monitors a float switch inside the drum and when the water level drops (because the filter mesh is clogged) it triggers a cleaning cycle. A cleaning cycle can also be triggered manually by pushing a button on the controller

At the moment I monitor the filter by plugging it into a smart plug and checking there is a power usage spike every 40 minutes or so.

I'd like to change the board in the controller to a smart ESP board and use this to duplicate and increase the functionallity by changing the timings and setting overrides etc..

I've ordered a device I hope will do what I need (see pic)

Basically there will be:

2 input devices: Reed based Float Switch and a Manual button

2 Output devices: 12v normally closed Solenoid Valve to allow water to the spray bar for cleaning and a 12v motor to rotate the drum when its being cleaned

There is a large 12v psu in the current controller box that I can use to power the ESP device (also POE is an option) and also power the output devices.

I've used Home Assistant for a while and have automated scripts etc.. for lights and various other devices but this is my first time with an ESP device.

Are there any templates I can use that can be a starting point for what I'm doing as a complete ESP newbie

Cheers

Sounds pretty simple, you don't need specific templates for that.
Two binary sensors and two switches.
Something like this:

# Inputs

binary_sensor:
  - platform: gpio
    pin:
      number: GPIOxx
      mode: INPUT_PULLUP
      inverted: true
    name: "Float Switch"
    

  - platform: gpio
    pin:
      number: GPIOxx
      mode: INPUT_PULLUP
      inverted: true
    name: "Clean Button"
    on_press:
      then:
        - switch.turn_on: solenoid_valve
        - switch.turn_on: cleaning_motor
        - delay: 60s
        - switch.turn_off: cleaning_motor
        - switch.turn_off: solenoid_valve


# Outputs

switch:
  - platform: gpio
    pin: GPIOxx
    id: solenoid_valve
    name: "Solenoid Valve"
    restore_mode: ALWAYS_OFF

  - platform: gpio
    pin: GPIOxx
    id: cleaning_motor
    name: "Cleaning Motor"
    restore_mode: ALWAYS_OFF

You need to study your inputs voltage levels and if they are inverted and modify binary sensor parameters accordingly.

Thanks, once I get the basic setup working I want then to implement some additional logic around the cleaning cycle ie:

  • If water level sensor hasnt turned off by the time cleaning has finished (Ie water level has not returned to normal in the filter) then keep the cleaning cycle running for an additional 30 seconds. This loop should repeat up to another 10 times (5 minutes) in total and if then still not successful it should stop and message me via HA with an error/warning.

  • Also there should be the ability to set a maximum time between cleaning so that even if the water level doesnt drop the filter will clean after a maximum of 90 minutes. This is needed for winter time when the fish are inactive and less waste and plant matter/algae in the water

No problem with esphome.
Have a look at the links here: