Question about Rule trigger logic

@bravenel I wanted to double check I understood something about the Rule trigger logic - Am I right in thinking that the following is correct:

  • If a trigger is something simple like motion becoming active or inactive the trigger will fire when the device initially changes to active, but if the device continues to send active reports to the hub, the trigger wont fire again unless the device first reports inactive

  • For something more complex.. for e.g. if the trigger is humidity >= 50... will it work in the same way as the above? so if the device reports 50, 51 and then 52 .. it will only trigger once when it hit 50... because when it went 51, 52 etc it was still satisfying the trigger condition ans so nothing has changed? or will it fire every time the device reports?

First of all, no real motion sensor should do this, or does to my knowledge. Second, it's not the Rule trigger logic that is control of this, it's the hub. In most circumstances, the hub discards events that do no represent a state change for the device attribute, so those events never reach a rule.

Taking into account that 50 followed by 50 would be discarded, as described above, 50 followed by 51 would not be discarded and would retrigger the rule that has humidity >= 50. Why? because that condition is met by the new event, so it triggers.

So there are two levels here: the hub will only send events that represent a change of state. A trigger with only an event, will trigger every time that event hits the rule. A trigger with a relationship of the event value will test the value relationship on each event, and trigger accordingly. Some people don't want this behavior, they want a threshold trigger, that would only trigger for the first event >= 50. That would have to be handled by the rule's logic.