I have been tuning this automation for about a month now but I cannot get it to work quite the way I want it to.
I want this automation to take a reading from sensor.pool_fc. If this reading is below 4 and the pool pump has been running for at least 30 mins, execute the automation to inject chlorine.
The pool pump runs 2x a day for 4 hours each time. I want the automation to wait until the pool pump has running for 30 mins before triggering so fresh water can be read from the sensors. After 30 mins of pump run time and if the free chlorine has been below 4 for 30 mins the chlorinator automation runs and injects chlorine. I then want the automation to delay for 55 minutes so the chlorine has time to disperse and then run again. The problem is the automation does not run again. The free chlorine is below 4, the pump has been running for over 30 mins and the automation is not triggering.
Here is a history of the sensor.pool_fc that show is has been consistently below 4 for 24 hours:
During this 24 hour period the automation attempted to run at 1am, 1:21am, 3:53am and 4:54am. The pump was not running at this time so the automation did not run. The pump was running from 5-9am and from 3-7pm and the fc was below 4 but the automation did not run.
Any suggestions to clean up the automation and get it to run the way I would like it to?
alias: Pool Auto Chlorinator
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.pool_fc
below: '4'
for: '00:30:00'
condition:
- condition: state
entity_id: switch.sonoff_pool_pump
state: 'on'
for: '00:30:00'
action:
- service: automation.trigger
target:
entity_id: automation.pool_increase_cl_1ppm
- service: automation.trigger
target:
entity_id: automation.bleach_pump_activate
- delay:
hours: 0
minutes: 55
seconds: 0
milliseconds: 0
mode: restart