I have a rule that doesn’t work as expected. The rule is:

PIR is absent for 60 minutes and $sonoff-energy.ENERGY.Power < 100 for 3 minutes then xxxx

But after 3 minutes (with POWER < then 100) the rule is executed even when the PIR is not absent for 60 minutes.

What is wrong with this rule?

Thanks in advance

]]>I have a rule that doesn’t work as expected. The rule is:

PIR is absent for 60 minutes and $sonoff-energy.ENERGY.Power < 100 for 3 minutes then xxxx

But after 3 minutes (with POWER < then 100) the rule is executed even when the PIR is not absent for 60 minutes.

What is wrong with this rule?

Thanks in advance

]]>If you use the AND in an event string, all conditions should be true. It doesn’t matter which event became true first.

When you use < event> AND IF <condition> , then only if the condition is already true and the event condition becomes true (triggers), the total rule become true.

If you use the OR in the event condition, than the first event condition that becomes true, triggers already the rule.

@lschip you could try to use the AND IF and i think you should switch the 2 conditions. So the rule becomes:

$sonoff-energy.ENERGY.Power < 100 for 3 minutes then xxxx AND IF PIR is absent for 60 minutes.

So the PIR should be absent for at least 60 minutes and after that the $sonoff could trigger the rule. ]]>

I temporarly solved it with a pir device that resets after one hour.

So now I can use just “if PIR is absent” in my rule.

I’ll try the rule as suggested. Its a better solution.

]]>