Hi,
I somehow fail to understand this. Did not find anything in the search. Could anyone please explain?
Thanks!
What is the difference in a rule between "if" and "and if"?
Hi,
I somehow fail to understand this. Did not find anything in the search. Could anyone please explain?
Thanks!
“and” allows for adding another event trigger while “and if” combines the WHEN part with and IF condition part. See https://github.com/pimatic/pimatic/issues/135 for some background on the ECA rule system in pimatic and https://en.wikipedia.org/wiki/Event_condition_action for the general concept. Certainly, the rule system is lacking documentation. Contributions on the matter will highly appreciated.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
Aaaaaahhhh, now I get it, I think. Ok, the example in the link you provided makes it a bit clearer. Also I think I understand that “and if” means actually “if” and the “and” is only there for technical reasons.
Huuu this is confusing. But it think I get it.
@karlm261 said in What is the difference in a rule between "if" and "and if"?:
Huuu this is confusing
Yes, not nice at all. It’d much better to have three sections in the rule editor for WHEN, IF, and THEN parts. What we currently have is the old pimatic 0.8 rule editor which has been tweaked to support the new rule system
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
Hm, it is not super clear, still.
WHEN phone becomes present
AND it’s after 18:00
THEN turn light on
WHEN phone becomes present
AND IF it’s after 18:00
THEN turn light on
What does it mean? The first one would turn the light on if it is either 18:00 or the phone becomes present? But this would be an OR statement, no?
The second sounds clearer to me.
I still don’t get the difference between the two.