Rule machine - as per the app developer, this app is no longer available for new installs, distribution, or support

Rules and Triggers work differently. They are not the same. Your logic is flawed.

3 Likes

@jnschemm Can you please elaborate? Thank you. As in, when do you use a trigger and when do you use a rule? And why would you not be able to use a trigger instead? Explain to me the major concept difference between the rule and the trigger. Can you use a trigger to do what you’d “normally” do with a rule?

a “Rule” consists of events AND evaluation of attribute states at the same time.
a “trigger” consists of events only
a “conditional trigger” consists of attribute state evaluations contained in the conditions, but are only evaluated when the specified trigger events happen

1 Like

In my case

I use a rule that between Sunrise and -90 Sunset
If the temp is >=25 degrees outside
and my chickens door is closed
then
open the door

I do this with a rule because the day could start out below 25 degrees but warm up and if it does I want to let the girls stretch their legs a little bit before they go in for the night.

Scenario 2

If the lux is between 1000 and 500 turn on the living room lights and set to a level if its false turn them off.

I don’t want a trigger for that because I want to evaluate the conditions unlike the triggers where i.e. at sunset close the door to the chickens

Going through the code of RM, the rule seems to be a newer implementation that more or less “supersedes” the trigger. The rule can say “when the door is closed and the window is also closed, then do this”. It’s the “AND” in there that the trigger can’t do. But the rule itself is also “triggered”. It just listens for events on the window and the door. The trigger won’t be able to do that, because it was never developed to do that. My point is, there is no need for both to coexist. One single entity can deal with all scenarios and that is has a closer resemblance to the rule.

2 Likes

Did you search the forum? I don’t mean that in a negative way. The answer to your question is easily found.

I’m not sure when this was last updated but it should suit your needs.

3 Likes

@Mike_Maxwell so then why the existance of triggers? I guess I know the answer, backwards compatibility. Rules are the more evolved triggers…

you have actually got it backwards, the concept of conditional triggers was mine, and was implemented after rules…

1 Like

The difference is when the “thing” (rule or trigger) gets evaluated.

A trigger only gets evaluated when the trigger event happens:
(Door Contact Opens) (while Light Switch is On) (then do something…)

A rule gets evaluated every time the state changes from true to false or false to true so:
(Door Contact Opens AND Light Switch is On) (then do something…)

The trigger would only get evaluated when the door contact opens. Ever.

The Rule would get evaluated when the Door Contact Opens while the Light Switch is On and also when the Light Switch turns on while the Door Contact is Open.

1 Like

@jnschemm I am looking for constructive comments. My point is, there is no need for both rules and triggers. You can do with a rule that says “if door opens do this”. Simpler, user-friendlier approach.

1 Like

incorrect, though I guess in your setup you have no need for them, I however do, 30% of my rules are conditional triggers

4 Likes

I said triggers. Not conditional triggers. Triggers were first. Then rules “improved” them. As a new user of RM, I found the existence of both as confusing at best. I do programming for a living. In many languages and ecosystems.

well cool, we’ll all actively interested in your clean slate implementation!

4 Likes

Can you please give me an example of a conditional trigger so I can understand what you mean?

Again, my point is, there is no need to decide what to use before you set it up. This implies high-level understanding of the complexity of a software, leading to that software being hard to grasp for most users. I am trying to imply that with a little bit of planning, we can figure out something that can incorporate the functionality of all three entities (triggers, rules, conditional triggers) into one single entity that will no longer confuse the user as to which one to start with…

Consider the following:

Do something every time that a temperature sensor reads > 0

With a rule (T > 0), this would only happen when the temperature goes from less than or equal to zero to greater than zero (i.e., once). With a trigger, it would happen every time the sensor gets a reading greater than zero.

Historically, if I recall correctly, rule machine came first, then there was a separate app for triggers, then things got combined. Just sayin’.

As for designing your own rules engine smartapp, sounds great, please use the following new thread for that to keep people from getting confused.

@ady624

3 Likes

I have modified my copy of RM to incorporate other features, among which:

  • the ability to rate limit a trigger, so that it won’t execute if it just did in the last x minutes - had to do with presence
  • the ability to send the device name in the push notification text (dynamic messages) - again, presence. I want a notification that John got home, not someone got home.
    etc.

There are many ways RM can be improved, but it takes a lot of us to figure out the core concept before we can start implementing it. Analysis, that is. And I am asking for help and coordinated efforts so we can get something working, in case RM never comes back. By all means, RM is a genius piece of code, not talking trash about it.

1 Like

How do you do hysteresis? Can you make something happen if and only when the temperature exceeds a certain temperature? i.e. goes over 100F, do something, then do it again only when it went over 100F again, after it has gone below 100F… this is an example of something that can be “factored in” into the analysis of an “entity” that can do it all.

What would it take to do such a thing?

@JDRoberts I wasn’t aware of that thread, I’ll move there. I am only trying to help, so far I only find opposition… :slight_smile:

1 Like