[Released] Rule 4.0

I'm wondering if it might be useful to have a global variable for "current time" to reference in rules - trying to think about how to generate it.

Bruce, quick question about how END-REP and Stop Repetition behave. Below are two different repetitions that are supposed to only happen between two different blocks of time based on a condition. I've set END-REP, but I am unsure if it will stop repeating when needed. Will each END-REPs stop upon truth change? Or do I need to manually initiate the stop?

NEVERMIND, I've RTFM and found it right there:

A Repeat Actions, like any action, can have a condition specified. If the condition is false, the Repeat Actions block of actions will not be executed. If the condition becomes false during repetition, the repetition will be stopped (not in the case of Repeat a selected number of times). This provides three features well known to computer programmers; A while-loop, a for-loop and repeat-until loop. The while-loop runs only if the condition is true, and stops if it is false. A for-loop runs for a fixed number of times, but if a condition exists, it will only start that iteration if the condition is true; the condition is not retested during iteration. A repeat-until loop runs until a condition becomes true, running at least once.

Okay it's someone else's turn to ask the stupid questions now :crazy_face:

You can put the current time into a String variable, by using %now%. You can also get the hour and minute separately, in Set Variable.

1 Like

@bravenel I think I found a bug... I hope its a bug.

I changed some trigger values and the actions aren't updating to the new values. I did click on update rule but nothing changed.

I'm not sure they are designed to be updated automatically.

When you first create the rule it puts any triggers you set into the conditions part of the rule for convenience, but if you update the trigger events I'm pretty sure you have to change it manually in conditional actions. I can't think of an example of the top of my head, but I guess there are cases where you may not want it to automatically update the conditions just because you've changed the trigger.

There is no way to edit the triggers.....

That means you have to delete the entire rule just to fix it ? That's insane coding.

1 Like

Unless something is wrong on your system, you can edit triggers or actions by clicking on the appropriate section of the first page of the rule. That then brings up a the edit screen for that section

I see no way to edit the actions. I even tried opening the hub in a incognito window and same effect.

Try selecting a capability (any) and see if you just have to “finish” the flow once to get your buttons back. I had that once or twice when I started to change something without finishing it

No go

Do you not get a screen like this?

Nope

Can you post a screenshot showing what you get when you click on the actions section of the rule page?

I did...

OK. I'm at a loss then. Need to wait until bruce can have a look

I did another test with RM 4.0 I made another test rule and same results.

Did the same rule in 3.0 and I can edit everything.

My example above is a RM4.0 rule so it is definitely possible to edit actions in RM4.0. There must just be something odd about your example. Maybe it is a very specific bug.

Well duckme... I made a 3rd test rule and that one actually works.... @bravenel any ideas ?

What happens when you select the capability when it goes wrong? Does it let you select a device? If so, select one, if it lets you set the condition, set one, even if it is arbitrary. See how far you get “just following” RMs lead. I think the UI is in the “maintain condition flow”... for whatever reason....

I occasionally end up with a large accumulation of unused conditions while optimizing a rule. Is there any harm in leaving a load of these in the rule, unused? Or is it wise to remove the ones that aren't used?