[Released] Rule 4.0

It's harmless.

Yes. I recreated it anyway just incase but still have the issue rule paused just incase it was useful to you?

It's an inscrutable error. I have no idea why it threw it in the first place, unless you had a variable you'd removed or something.

Probably one of the rules that I had a global variable that I swapped with a local?

That wouldn't do it.

1 Like

Just delete it then? Hasn't happen to the others I have changed (yet).

They all started prior to the last update with those UI issues we talked about. I think you'll find you won't get any more new cases.

I am once again in need of some schooling. I am fading the room lights on or off over 1 second. If we intervene and turn the lights on or off at the wall dimmer I want to cancel the rule. I am using a pico to initiate the start of the rule.

What would I write to make this happen? Here is my current rule using the pico. We would use a different pico or wall switch to actually adjust the lights and cancel the rule.

How to do this depends on what you want to use to cancel it. If a Pico, then a button push; if a wall switch, what kind of wall switch? In either case that device will be the trigger of a rule, whose action is:

Cancel Rule Timers: your rule from above.

Please note: This is a little funky with using the multi-buttons button-controller feature of Rule 4.0. It would cancel any pending timers for any buttons. That would be fine as shown above. Were that to be a problem, you'd have to separate the one button out into its own rule.

It is a Lutron Caseta Dimmer. With RM4 I want to put everything into 1 rule and I have to be reminded sometimes that that isn't possible.

So I have maybe gone a bit overboard and added everything, but does this look correct? Since we would be either turning the light on or off I added the light on or off. Should I just used changed? My thought is that would not play well with the fade that is happening?

After an hour trying to write a simple rule to say if (Mode == Vacation) and Time between x and x do a, OR time between x and x do b, OR time between x and x do c, am I the only one who thinks an interface is needed so you can write your logic (like a programing IDE) then have Hubitat verify it's correct vs. figuring out someone else's crazy web 1.0 logic for when to select what and what to click in order to build a rule? I feel like I've stepped back in time (yes I know I can use Rule 3.0, but 4.0 makes more sense, it's just harder to actually get what you want in a rule because of all the clicks, dones, add before/after and figuring out where you add an action vs. condition). Just give me a blank slate and a defined language let me type it out.

Sure, it's called Groovy, and you can write anything you want with it. The built-in apps, including Rule Machine, are all written in Groovy. It's a straight forward language, not very hard to learn.

3 Likes

hi all,

Not sure if this rule below is done right. I have found having two switches turn on or off at same time - that are ifttt triggers doesn't always fire the ifttt rule.

Essentially I want two switches to turn on at 4;30am and 4:30pm then both turn off 2.5 hours later.

I think i have this rule right but i'm not sure if the last section will result in the last switch turning off 1 min after the on trigger ?

i'd like to stagger the on / offs by a minute or so to ensure the trigger is not missed in ifttt.

Is there a cleaner way I can do this rule to say both switches turn off after 2.5 hours but stagger them by a minute?

Thank you

I think you want

Off: Tile Heat Bathroom ā€”> delayed 2:31:00

Ah so the way I have it. tile heat bathroom will turn off after 1 minute from trigger ? I thought it would be after the prior action.

Thanks

Delays on individual actions only affect that action. Delay Actions delays all that follow.

1 Like

Right. Itā€™s the delay for that action, irrespective of what else is going on.

1 Like

Iā€™m fairly comfortable with Groovy, Iā€™ve contributed several things to this community that demonstrate that. I assume the point of rule machine is to do actions based on conditions, and it recently expanded to if/else conditions, with the goal of keeping people out of an IDE where you have more access to more complex things like parsing data from requests, etc. A simple interface to write out if/else statements has turned into a complex series of button pushes and confusing selects. Itā€™s at a point where a drag and drop devices interface with if/else statement blocks is needed. Now that we have more power to do more things, we need more intuitive UI/UX interfaces to work with. Iā€™m just providing feedback on my first wasted hour trying to build a 4.0 rule. Itā€™s not intuitive to someone who is technical and built many rule 2.0, 2.5 and 3.0 rules and written my own code to do things that require more under the hood. Maybe Iā€™m missing something, perhaps thereā€™s a walkthrough that will make it all make sense. But and if/else if/else rule shouldnā€™t take an hour of fumbling. Off to build 3 version 3 rules and use restrictions!

2 Likes

Yes, noted and agreed. It will always tempt the next level of improvement. Thus has been the course of software development for the last 50 years, and into the future no doubt.

5 Likes

I agree with you Brian. This has been one of the most frustrating parts of Hubitat. I have been able to write a very simple rule (If garage door opens, turn on porch light) type stuff. Once you get into more complex things, I am having some type of mental block of how to make this all work.

Things like when you save a condition, it doesn't take you back to the main menu. Instead it takes you back to conditions. Same with actions. It gets confusing where you are at or what you have done. Things like this need a "save" and "save and new" type button.

Other times, you can't back out of things without deleting everything and starting again.

I just cannot grasp rule machine for some reason, and I wish I knew why. I don't think I am stupid, and I usually pretty readily catch on to other things, often by simply reading it once or twice (I have nearly photographic memory) but I have tried for months now to learn Rule Machine and failed repeatedly.

1 Like