Conditional Action for a rule

I would like to create a rule with a trigger where an action would be executed only if the same action was not executed in last 60 minutes.

For example: pH sensor gets data above threshold value and triggers an action to dose pH- liquid, but only if dosing was not already performed within last 60 mins. pH correction results are detected very slowly and I want to mute any pH- dosing actions until I'm certain that enough time passed.

Any suggestions how to set such condition on timing of past action?

1 Like

Use a Private Boolean for the rule that is set to false as soon as the action is run. Set the Boolean to be true after 60 minutes.

And require the Boolean to be true for the rule to be executed in the required expression for the rule.

just to be clear (I am still a noob with Rule Machine): private bool should be within my rule for pH (that has its own sensor trigger)? I wonder how can I add the timer trigger on top of existing sensor trigger...

Not at my Hubitat, but your Rule would be something like this:

Required Expression:
Private Boolean is True

Trigger:
pH > threshold value

Actions:
Set Private Boolean False
Dose to change pH
Wait 60 minutes
Set Private Boolean True

In this setup, the rule will run only if the Private Boolean is True. And when the rule runs, the Private Boolean is set to False for 60 minutes.

2 Likes

Thanks, your idea let me dig and explore deeper, here is how I solved it:

(no required expression)

Trigger:
if AvgpH > 6.0

Actions:
If (Variable Busy = false): dose 10ml pH-
Set Variable Busy to true
Delay 1:00:00
Set Variable Busy to false

I don't know if the Delay is holding back (pausing) the whole rule for an hour - I'd prefer that the rule finishes without delay each time it is triggered.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.