At least one hour

Hi, I’m new to HA, and I can’t find a way to manage a “minimum day time task”.

I need to runa pump at least 1 hour a day. But the pump can run for other reasons, like presence or manual switch on.

Any suggestion on how to do it?


1 - Set up switches that are toggled on if any other thing turns it on like presence, etc. Create a separate automation to reset the switches to off each day (like at midnight or some other time)

2 - Create an automation to turn on the pump the same time every day

3 - Put an AND condition in to run only if the state of both of the switches in step 1 are set to OFF

Great, thank you

When the pump is turned on because of presence etc, does it automatically stay on for an hour, or could the amount of time when the pump is turned on for presence, etc be less than the minimum hour of runtime that you need?

Can be less. It’s a problem. I need to decrease a variable and check for zero. But i don’t know how. Right now I’m trying with a slider to store runtime, but without success.

How’s your python programming skill??

I know where this is going…


Just saying AppDaemon would be a much easier, more straight forward way of doing this. LOL

Python is not the solution. I’m moving to HA 'cos I need something that can be maintained by others. Nothing custom. It’s not easy but can be done with yaml… I believe.

Cool, no problem.
AppDaemon is a HA addon. It has access to everything in HA. It uses the HA interface and controls. AD just lets you take HA to the next level. As time goes on, it’s something you may want to look into.

To be fair, AppDaemon is just a framework and that framework is vigorously maintained by others here. Just like HA.

The programming required would be just as custom as any script would write in HA. If you have an issue with a script, you can ask here. And if you have a problem with an app you create in AppDaemon, you can also ask here.

So really the only difference between the two is your level of understanding about Python vs. your level of understanding about HA’s scripting language and YAML.

I just want to make a fair comparison.

1 Like

Maybe use MQTT to store the runtime?

You mean read and write from the same agent and topic? I have no experience with mosquitto, are you sure that can be used this way?

Not from direct experience, but I have seen posts from other users mentioning using MQTT to store and retrieve a variable or state.