Rule Machine 4 - Can't get to trigger on time [RESOLVED]

HI there,

I wonder if I could get some advice figuring out why a simple RM4 app isn't triggering?

The aim is to have it turn on a relay attached to a towel heater for a couple of hours each morning. The times in the rule copied below have been adapted for troubleshooting this evening, while the actual rule aims to trigger at 6am, then delay for 2 hours before turning off.

image

When I edit the app I can click "Run actions" and it works fine, including turning off after the delay. Therefore I think the hardware is all fine, and something to do with the trigger must be causing the problem.

I don't know if it's related, but when I try to figure out what hubitat thinks the time is (by going to settings and clicking "hub details" - is there a better way to check hubitat time?) the time is often wrong. Clicking "Update time from browser time" seems to correct this though.

My location is set correctly (UK) and the timezone is Greenwich.

Any thoughts appreciated!

Thanks,

Chris

Put an IF - THEN as your first action.
So you trigger goes off at 7:30pm.
IF
Time is between 07:29 and 07:31. ( I use this instead of if time is 7:30)
THEN
Your actions.
END-IF

I hope this makes sense. :slight_smile:

HI there,

Thanks for these thoughts. I may be wrong, but I don't think RM4 works quite like this - have you tried to set up the scenario you describe?

I suppose it's possible there's a bug in the RM4 logic, but my understanding is that if the rule is triggered the actions should run, and adding conditions to this would only provide potential circumstances for the actions to not run.

Does that make sense?

What happens when you try my logic?

I tried, but couldn't replicate this in RM4.

As far as I can tell (and I may be wrong) the trigger doesn't allow a time range, only a specific time.

Conditions (such as "time between") can only be applied to actions after a rule has already been triggered to run.

But isn't that what I told you to try.

I could understand using a range if you thought that the trigger just didn't work for specific times, but I don't understand why you'd want to add a condition, who's only function is to stop an action triggering outside of a time range.

As far as I can tell, the problem is the rule triggering in the first place....

image

@bobbles: the IF testing really shouldn’t be necessary, he is just trying to run straight actions. RM4 doesn’t require to have conditions as part of the rule.

@ThinkSta: can you enable the logging for tiggers, events and actions and open a second browser window with the log open to see what is happening at the time the trigger should fire? Post a screenshot of the log window here and we should be able figure that out.

As stated above, this isn't necessary here. You don't need conditionals in Rule actions at all, so the ones provided by the original poster should simply run whenever the trigger fires. This is exactly what you can do if you don't need to test for anything. (Many examples have conditionals for two reasons: first to replicate "actions for true" and "actions for false" from older versions of RM, and second because often your trigger is a sensor "changed" and you want to test for which state it changed to, say when motion active does one thing and inactive another.)

From their description, it sounds more likely that the hub time is off and perhaps the trigger never fires for that reason. Enabling logging as suggested above is one way to try to pinpoint this, but I'd also add manually checking the hub time shortly before and after the expected trigger time to see if that could be the case. If it is, is the time zone set correctly in Settings? If it is and the time just drastically drifts away, you may have a different problem Support may need to help with.

In addition to the test not being needed at all, you also don't need a range for time. If one has this condition:

06%20PM

As you can see it was true. You can have Time of Day conditions that are true for exactly one minute, the minute specified. Or you can have between two times, and that is true from the first second of the first minute to the 59th second of the ending minute.

So it's just gone 6am, and the app hasn't triggered. Here are the logs showing motion detection & IFTTT before/after 6am:

This is the rule as it currently stands:
image

And this is the time:


(although the first time I loaded the settings the time was wrong, pressing "Update from browser" corrected this)

Hi all. Whilst I appreciate the IF - THEN SHOULD NOT be necessary, and indeed I have rules that are built very similar to the OP's rule, I was offering something to try to see if he could get it to work.
I notice that this has not been done yet. It would be interesting to see if it works.

Hi bobbles,

I really appreciate your efforts on this - thank you. In practice, we can see from my log that the rule isn't triggering in the first place, therefore there would be no opportunity for hubitat to get to the actions and conditions to evaluate.

Chris

2 Likes

Do you have logging turned on for that rule? If not, do so. Also, are you using 24 hour time?

I am also having this issue. I have multiple time triggers on a rule and only some of them fire. Even worse, trying to edit the actions generates an exception. I'm guessing that the rule editor munged something up.

As you were advised in that other topic, delete that rule and recreate it. Something has gotten hosed up. Once you create it again, show us the app status page where it has Scheduled Jobs at the bottom. We need to see if all of them are there as expected since they weren't before for some reason.

1 Like

Hi there,

Yes all logging options turned on, and 24 hour clock.

I would prefer to explore other possibilities before I go to that extent, given that it is a complicated rule and will take well over an hour to recreate.