[Released] Rule Machine 3.0


#295

were not all as good as you :smile:

actually in this case it was fine in my original setup of this rule, i just needed to move it with how i now used the rule.

i agree and this is what i ended up doing i was just using the previous bit as a reference rather than writing it down :wink: , hence how i found it and let you know but if it's there for a reason then its all OK.


#296

@bravenel would a wiki style page of RM “recipes” be helpful? I would think it would benefit everyone, I know it would me. Maybe break it into sections depending on what the rule would oversee. Easy to complicated, lighting, motion, etc. This way there would examples for users to follow to set up their own systems. The recipes could be posted with “device type motion” or “music player” etc and then be adapted to each users individual devices, or used as a guide to get a rule set up correctly. This would also serve as a “best practice” for creating rule machine rules. This might also give a user inspiration to automate something that they hadn’t thought of, or even know was possible.


#297

+1 I had thought about starting a thread on this!


#298

@bravenel noticed this not sure if its UI or RM

when setting GV it allows you to select more than one, when you do it allows you to give them both their values but when you click done with action it only shows the last GV. Instead of both.


#299

That 'feature' of setting more than one doesn't really work, and has been eliminated in the next release for that reason.


#300

When trying to run conditional actions can you have two independent IF conditions?

For example

If {Mode = Day AND Global Variable = TRUE}.

Can’t seem to figure that out.


#301

No a conditional action can only have a single condition but you can do something like this: (A combination of IF-THEN-ELSE and Simple Conditions)


#302

This is something I wish we had but so far I have been able to find a way around it by adding more conditions and them using them as the expression of IF ELSE IF ELSE IF ELSE statements in very specific orders. Sometimes I have been required to split up logic and use two rules.


#303

Elseif?


#304

Yes, but often chained e.g.

if (expr) { }
else if (expr2) {}
else if (expr3) {}
else {}

Then you basically have to put your conditions in order from most restrictive to least restrictive so that by the time you get to the bottom of the chain you don't need to AND expressions hopefully. If you still need AND then that's when the second rule comes in to play and you essentially have to utilize the "Set Rule" portion of the rule for the AND or OR expressions.

image

You can also AND and OR if the types are the same. For example, in this image "all is off" is lamp is off AND bulb is off. So you can do that as well.

(*edit: This example is a four state toggle.)


#305

Dare I say it?

This screams for a CASE statement!

ImpressIF skills @codahq!

S.


#306

So looking at this, I can't figure out why kitchen lights and island lights will not turn on?


#307

Here is the log.


#308

You do realize I hope that those will repeat forever. Do you have some other rule that would stop them?

Not sure why it's not working. Will see if I can reproduce...


#309

I also realize that. How would I be able to stop them in the same rule?

Could I change it to a triggered condition where if Motion sensor = inactive then delay all off for x minutes?


#310

The question really is this: For how long, or how many times, or under what conditions do you want these to repeat. Answer that question first, and then we can see the right way to do that.


#311

In a perfect world, it would depend upon whether each of the conditions are true.

  1. If @movie = true, the lights action would repeat until there has been no motion in the kitchen for 2 minutes;
  2. If @movie = false and mode = Day, Cleaners, Babysitter, the action would repeat until there has been no motion in the kitchen for 10 minutes; and
  3. If @movie = false and mode = night, late night, the action would repeat until there has been no motion in the kitchen for 2 minutes.

#312

I reproduced something like your trigger, and the IF-THEN on a Boolean variable, followed by and ELSE-IF with a mode condition, worked as expected. So I'm not sure why yours doesn't continue to log. It should log the ELSE-IF, ELSE, etc.


#313

It actually did the first time I ran it... could it be because the condition keeps repeating?


#314

It should be logging something for each action.