I have moisture sensor for my avocado tree and I've configured a rule to open a valve and water the tree when the humidity reading drops below a level. I will then close the valve when the humidity reaches a higher level, but I don't want it to run for more than 10 minutes, so I enabled the timeout in that wait event. Thought it was pretty straightforward where if the threshold wasn't met in 10 minutes it would timeout and close the valve, however, it ran for 20 minutes and I had to manually stop it. What did I do wrong?
What do the logs show?
Without seeing your whole rule, it's impossible to say; a re-trigger cancels waits, which is one possibility that could account for your description of events. But as mentioned above, logs would be even better.
If those are logs from a problematic time, the only problem is that you either hit "Done" or "Update Rule" when the timeout was pending (only four seconds in), thus canceling the the wait itself (see: Rule 5.1 | Hubitat Documentation). This is the "Initialized" log entry in your screenshot.
Another problem you might run into is that your rule is going to trigger every time you get a humidity reading of < 35% (e.g., not just the first, which it seems might be an expectation). A required expression of "humidity >= 35" is an easy way to make that work, assuming you don't see any conflicts with the time or other considerations you may have. As you'll see in the docs, a retrigger is another way to cancel a wait.
It's also not clear if you want the "Time between sunrise and sunset-120" condition to do anything; if you do, you'll need to actually use it somewhere (e.g., as a conditional trigger or in a conditional action), as merely being created does not have any effect, as the "unused" designation is telling you.
I would definitely agree with @bertabcd1234's suggestions. Based on the logs, it looks like your moisture sensor might be reporting multiple times that is causing the wait to be reset. You might want to select the option "Ignore Trigger Events While Running" as that would also help limit this rule to a one-time trigger.
Per Robert's comment on your Time condition, if you only want the rule to run between those two times, you can make that your Required Expression, then the rule won't run unless it's between those two times.
You can just choose your existing condition in the Required Expression setup...
Not intending to nit-pick or otherwise be "that guy", but they would need to re-create that condition specifically as a Reqd Expression.
I'm guessing there must be some good reason you can't pull from your bucket of conditions for a Reqd Expression, but I don't know that answer.
It's just another gotcha to be aware of when trying to wrap your head around how conditions are entered & used (which is understandably not intuitive at first blush).
That's odd, I never knew that they don't allow using existing conditions. I guess they must restrict which conditions can be used as required expressions. Good to know thanks
It's allowed -- it's just a separate "bank" from these.
So still a little confused...if you use the "Create Conditions" process to create a few conditions, will all of them be available for selection in the "Required Expression" flow, or do you have to create your condition in the "Required Expression" flow for them to be available there? Sounds like the latter... ?
They are separate banks; you cannot use ones created in one from the other. You can't see the one for the required expression in the screenshot above, but it has its own on the Required Expression page itself. Try it and you'll see!
Thanks @bertabcd1234, I did hit "Done" because I triggered the action to run manually using "Run Action" and then hit "Done". Didn't realize that would affect the running of the rule.
The logic of the humanity reading < 35% is because I want it get watered if humidity level drops below that, but if it doesn't drop below that within 4 days then run anyways. This is because I've found that outside factors like humidity can keep the reading higher and then it's not watered for over a week which isn't good.
I created the condition but hadn't yet applied it. It has been applied to the checking of the humidity so that running doesn't happen in colder times.
Sounds like my problem was hitting "Done" and I'll wait for rule to run on its own again and watch what happens. Thanks!
I understood @bertabcd1234's suggestion that the wait was cancelled because of hitting "Done", not because the sensor is reporting. I'll watch what happens on next run and if I see the same thing in the logs I'll set the "Ignore Trigger Events". Thanks!
I've never used a Required Expression. What I did was apply the condition to the Trigger as shown below. That way it won't run outside those times because the Every 4 days trigger runs at 1:00pm anyways. Would using a Required Expression result in something different?
Yes, you can add that to the trigger if you want to do it that way. In this case doing it either way will have the same result on the rule triggering, so more of a preference how to do it.
In general, for a rule where I want a consistent condition/limitation applied to enabling the rule to trigger, I find it neater/easier to manage that condition via Required Expression, and also like the fact that it simplifies my trigger(s). The rule might also use fewer resources that way (only evaluating triggers during the allowed run time), but that's probably not significant enough issue to worry about.
Thank you, I'll have to look into this!
So it ran today at 1 pm, but it hasn’t been 4 days since I created the rule?
The good news is that it stopped after 10 minutes.
Day 4 today and it ran for 10 minutes at 1 pm. Seems to be working as expected now. Thanks all!