Trying to get my head around rule machine

I'm trying to convert this webCoRE rule.

IF
Bath 1 light is on
OR
Bath 2 light is on
THEN
Wait 5 minutes
Turn on fan
ELSE
Wait 20 minutes
Turn off fan

I like the idea of it running locally but I just can't see it using rule machine! Any ideas?

Thanks

Been a while since I messed with webcore. Webcore on HE also runs locally btw.

Might be helpful if you described what it was you were trying to accomplish. The above will work just fine in RM as long as there is some trigger event that causes it to process the logic, but I have a suspicion it won't behave the way you want it to.

Assuming this works now in Webcore, can you post a copy of that setup? That would help folks assist with translation.

But what you posted has flawed logic -- there's no distinction for when it should do the THEN vs the ELSE. Are the lights coming on the actual trigger or is that just part of the conditional?

In RM you need a Trigger for the rule to "run"

ALL triggers are "OR"ed so in every case any of the triggers becoming true will run the rule.

In your case The triggers could be:
Bath 1 light ON
OR
Bath 2 light ON

You don't need any conditional conditions

Action would be:
Wait 5 minutes
Turn on fan
wait 20 minutes
Turn off fan

Now you might want to make this more complex by adding the ability to cancel these actions if the lights go off within 5 minutes. But I would start with the above.

1 Like

If either bathroom is in use (light on) then turn the MVHR fan on - only turn if off 20 mins after both bathrooms (all lights off) are not in use.

WebCoRE will step through the conditions until it fails then execute the ELSE statement.

I can do that but just waiting 20 mins and simply turning the fan off even if the bathrooms are still in use is not what I am trying to achieve.

If either bathroom is in use (light on) then turn the MVHR fan on - only turn if off 20 mins after both bathrooms (all lights off) are not in use.

The logic works great in webCoRE.

Ah ok. You can probably do this with room lighting or any number of other automation apps but if you want to do it in RM this might work... I haven't tested it of course but somewhere to start. The "cancel delayed actions" should cause the pending shutoff in 20 min to get canceled if the rule gets re-triggered within that 20 min.

You could also add a timeout so the fan didn't stay on indefinitely if no one turned off the lights... this one would wait for both switches to get turned off but only for 30 min. Then it would trigger the delayed shutoff.

Nice one! I'll give it a go with the "cancel delayed actions".

also good tip about the timeout.
Thanks

Sounds good. Like I said I didn't actually test it so it might need some tweaking.

You could combine the on and off but I would start with two rules.

Lights on turn on fan. 5 min on ???? off

Lights off turn off fan (perhaps delay some number of minutes for the gas to clear).

Rules

The primary difference between Triggers and Rules is that Triggers run when a certain event occurs, while Rules watch for certain conditions and runs different actions depending on whether or not the conditions are met.

I was looking for something like webCoRE's subscribe - I guess then a rule as opposed to a trigger will do the job...

Shouldn't it show "cancelable" on the delayed actions in the screenshots?

I had to Google that whole quote and find the source. I'm not sure that article is making sense here. Unless I'm mistaken, rules don't "watch for" certain conditions. Rules have triggers. Once triggered they have actions that run. Within those actions there can be all sorts of added complexity from conditional statements.

I guess it's the "watch for" language that seems off to me. A rule doesn't have to have any conditions in the action. It can simply turn on a switch or send a notification every time it is triggered with no conditions.

1 Like

Yup, it should! Good catch.

@mikeh1 edit as follows:

Done. Seems to work ok!

Download the Hubitat app