I have an industrial evaporative cooler which now has an 8266 controlling its operation.
It has a water dump valve which dumps all the water, flushing the dirt out that gets collected on dusty days. This is normally a manual switch but i would like to trigger it every 8 hours the cooler has been running. some days the cooler may not run for 8 hours so it would not need to dump until the next day.
I was hoping to use the History Stats integration with an automation to trigger the dump cycle and reset the meter, but History Stats doesnt have a reset function.
Is there another alternative for this?
if it helps the entity that i am monitoring to give the run time is:
switch.evap_water_pump
and the entity that needs to be turned on is:
switch.evap_dump_cycle
This just triggers a cycle turning on the valve for 5 mins and turning it off again.
I am a bit short on time at the moment.
The thing is that, in my experience, triggers in “state duration” are not reliable since a reboot or even an automation edit can influence them.
So, since you want something to run every 8 hours, I’d suggest having it run every 8 hours using a pattern. I guess you would not mind being it 7hr55min I guess. So a very simple example where the bulb replaces your switch.
Of course, I’d advice to make it more robust and have a choose to make sure it’s always toggling correct and not that it is pumping 8hrs and off for 5min.
alias: Bulb example
description: ''
mode: single
trigger:
- platform: time_pattern
hours: /8
id: On each 8hrs
- platform: state
entity_id: light.dimmable_light_22
to: 'on'
for:
hours: 0
minutes: 5
seconds: 0
id: Off after 5min
condition: []
action:
- service: light.toggle
data: {}
target:
entity_id: light.dimmable_light_22
Since it’s every 1/3rd of a day, you might even just consider making it trigger on fixed times. If I am correct, one can even give the 8hr times the same trigger id, so a choose condition could be on one trigger id, and is dedicated on/off instead of toggle.
Thanks, this has worked every time all year so far!
I do notice that it does still do a dump cycle at midnight sometimes even though its not run for 8 hours. not a deal breaker but it would be a nice refinement if it didn’t.