Help with automation and timers - should this even be an automation?

Hi there, hoping someone can point me in the right direction, I have a feeling I am not using the right tool for the job here.

Problem Statement:

I have a Reverse Osmosis (RODI) unit for my aquarium that is linked to various solenoid’s and level sensors.

I require the following cycles to occur when the low level sensor is triggered.

When Water Level Low
Then
Turn on the water supply (solenoid)
wait 5 seconds
Turn on the water flush valve (solenoid)
wait 5 seconds
turn on the water booster pump (outlet)
wait 60 seconds to allow for membrane flushing
Turn on the water output (solenoid)
wait 5 seconds
Turn off the flush valve (solenoid)

This is my start up procedure, I then need this to continue to run until the high level sensor is triggered or if the output has been running for a total of 2hrs for a failsafe.

Every hour, I need it to turn on the flush valve for 60 seconds to keep the membrane of the filter healthy

I then have shutdown procedure, which is essentially the start up in reverse, this is either triggered by the above process finishing, or if the Water Level High sensor is triggered

At the moment I have all this in 2 automations, but I do not think its efficient because it is running the automation for the whole 2hrs+ which from what I see is a silly way of doing it.

Indeed, that is not a good way to do it. Why not trigger another automation on the high level sensor being reached or 2 hours after turning on the water (failsafe), i.e. two triggers?

I have the 2 triggers done, but because i need the flush to run for 60 seconds every hour the filter is running, maybe i need a sort of helper that determines if it is running, or an automation that runs the flish for 60 seconds when the filter has been running for 1hr…not sure the best way to do it.

Any suggestions that you can point me toward for a visual reference?

I would make the once an hour thing a separate mechanical thing, personally. A raspi0W or something with MQTT to HA so you can monitor it, and some kind of a lockout because do you want to flush while the the start-up / shut-down is running?

Then have a script for the start-up, another script for the shutdown, just to clean it up a bit.
The automations would be a bit easier to see what you’re doing then.
Not exactly helping you I guess, but looking it over, that’s where I would go.

I do appreciate your input, every response is helpful one way or the other :slight_smile:

Each solenoid is controlled by a Sonoff 4CH Pro R3

image

The High and Low Level Sensors are linked to a 3rd party aquarium controller (Neptune Apex) which I have virtual switches that turn off / on depending on the level sensor, which allows for deferral of the outlet being switched to prevent a rapid on/off

image

So my start/run automation look like this:

The trigger is the 3rd party switch

and my stop automation looks like this:

and now I am toying with the following automation to see if that can achieve the desired result to remove more steps out of the Start…inb4 someone tells me this is even more silly :rofl:

It’s a lot easier for us to understand and offer comment on your automations if you share them as YAML instead of screenshots.

1 Like
id: '1727935123055'
alias: RODI - Refill AWC - Start
description: ''
triggers:
  - type: turned_on
    device_id: acbd50af8b493cb409970c6cd1040d05
    entity_id: 833ea930720a4826ef808f466f2c8cec
    domain: switch
    trigger: device
conditions: []
actions:
  - metadata: {}
    data:
      message: AWC Refill - Started
    action: notify.mobile_app_leos_iphone
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - metadata: {}
    data: {}
    target:
      entity_id: switch.sonoff_1000e5f654_1
    action: switch.turn_on
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - metadata: {}
    data: {}
    target:
      entity_id: switch.plug_ro_booster_pump_switch
    action: switch.turn_on
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - metadata: {}
    data: {}
    target:
      entity_id: switch.sonoff_1000e5f654_3
    action: switch.turn_on
  - delay:
      hours: 2
      minutes: 0
      seconds: 0
      milliseconds: 0
  - data: {}
    target:
      entity_id: switch.sonoff_1000e5f654_3
    action: switch.turn_off
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - data: {}
    target:
      entity_id: switch.plug_ro_booster_pump_switch
    action: switch.turn_off
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - data: {}
    target:
      entity_id: switch.sonoff_1000e5f654_1
    action: switch.turn_off
mode: restart