KISS - With multiple trigger devices

After watching the last Hubitat Live, I went through and rewrote most of my rules that had two states to them (e.g. motion and contact). I'm now trying to apply the same theory to rules that have triggers with lots of states (e.g. illumination, and temperature). The example below is a simple rule for my front porch. It comes on when it is near dark or when the mode changes to evening. It turns off when the mode changes to day. The reason for the IF statement is that I call the actions of this rule from another one ("run rule actions).

As seen in the log files, it is triggering even though the illumination sensor was higher than 5 around 6:30 this morning. Is there a way to lower the amount of triggering on this rule ?

Screen Shot 2020-05-10 at 10.00.10 AM

A very good question! :thinking:

I've been trying to apply the same KISS-principle on my rules as well, some of them are both easy and pretty straight forward. Though I have a rule that might have some resemblance to yours that uses two illuminance sensors outside. For sure I will have the value changes in the log, but I try to limit the triggering by using the Wait for Events and intensionally spread the trigger values apart.

Skärmavbild 2020-05-12 kl. 19.07.07

Can you check the box in the logging section of the rule to include triggers and then post a portion of the log file? I'm curious if yours is also firing every time either of the illuminance sensors are reporting changes.

My question in writing rules like this is whether it makes any sense to use a qualifier in the trigger section or just leave it as "changed" and build out the IF since the rule seems to be firing no matter what.

I'm still outside the range for my trigger, so the log at the moment is looking like this:

Skärmavbild 2020-05-12 kl. 19.26.28

That's what I thought. I think I might be mistaken in how the triggers are applied. Even though the events are outside the range in both of our examples, the rules are still triggering, which means the actions are still being evaluated.

I could then go on to theorize that if a person had a lot of "multi-state" sensors triggering, then maybe that might be part of a slow-hub issue.

@bravenel Are there any ideas you can guide us with?

You might be correct, but is really my rule triggering? In you log it's actually stating Triggered, but I cannot see that in mine.

Try checking both the trigger and actions box and watch your log.

I thought that I did! But I'll give it a go one more time...

If a trigger requires evaluation, e.g. temp > x, then obviously it has to evaluate that. Only if the evaluation is true, does it trigger. RM will log the event, and then log the triggering. So something like temp > x will run RM for every reported event. Something like switch on will only run RM when the on event happens.

Then I am clearly missing something. With the actions and triggers turn on, I have the following in my log:

So even though the condition is being evaluated returning as false since the light sensor is above 5, it's still firing the rule.


Am I getting my terms mixed up. As I'm seeing it now, the rule is triggering based on an evaluation and regardless of that, it is still firing.

Do you have all of the logging turned on? If not, please do so, and post that log.

Here is the logs with Triggers, Actions and Events checked:

I have written rules like to debouce. My question come before that. If the trigger is outside the range it's set to/for, then why is the whole rule running? Which leads back to my other question which is if there is any difference between setting a condition in the trigger section vs. just using "changed"

As a side note, I use the local variable for that. It easier for me if the rule gets out of sync to change the variable.

Not much of a log, but this is what I have after checking all options for logging. So from my point of view, it does not seem like it's triggering

Skärmavbild 2020-05-12 kl. 19.44.29

The log is showing that it's turning off the front porch over and over again because all you have is a ELSE statement. Every time the illumation changes it fires.

If you changed that to a ELSE-IF statement with something to evaluate against, it wouldn't keep turning your light off.

1 Like

Good question, I don't know. I'll look into it.

Ohh, just caught that. :slight_smile:

Here's something of interest. I removed the "mode becomes changed" from the trigger list and now it has stopped firing. There was nothing that would have caused the mode to change.

Screen Shot 2020-05-12 at 10.53.00 AM

1 Like

Interesting. Thanks.

Here I have a rule for my clothes dryer. It also has two triggers setting a range but is not firing every time the dryer sensor reports back a value outside the range:

Screen Shot 2020-05-12 at 10.55.07 AM

1 Like