Announcing 'On Transition Only' Triggers

We’re excited to announce not one, but two much-anticipated features! Today’s update includes a new On Transition Only option as well as generic ‘updates’ and ‘changes’ triggers.

On Transition Only

We’re debuting a new ‘On Transition Only’ option which refines your comparison to only take place when the value changes to your desired state. This nifty feature switches the operator from ‘updates and is XXX’ to ‘changes to XXX’.

This is helpful for situations where you only want the rule to trigger when a value ‘rises above’, ‘drops below’ or ‘changes from’ a specific value. This means that your rule will only be activated when the configured trigger initially transitions to true… and will only reactivate once the trigger leaves the configured state and re-enters it.

Any Update / Change

We’ve also introduced a new set of triggers that occur on any update or change to your specified attribute.

The first item in your list of operators is a new updates operator. This is much like the ‘updates and is’ operator, but you don’t need to specify a value to compare to. Instead, the rule will be triggered any time a new value is received for the attribute.

image

You can further refine this to only trigger on value changes by using the new changes operator. This functions much like the ‘updates’ operator, but requires that a value actually changes. Where the ‘updates’ operator triggers even if the device reported the same value again (eg. level=0 → level=0), the ‘changes’ operator only triggers when the value is different than its previously reported value.

5 Likes

This is great. Thanks @josh.

1 Like

Updated about a dozen rules to use this today. Working like a dream.

1 Like

Fantastic additions! the update option alone has simplified so many rules and makes creating rules so much faster! THANK YOU!!!

Hi People, excuse me, maybe its for my lack of English, but I am still not getting the difference between update and change triggers. Can anybody give an practical example ? Thanks in advance.

@Carlos_Juarez Some values get updated, but don’t change. For example, a temperature device can update its temperature every 5 minutes, but the value stays the same. It will trigger every 5 minutes.

Change will only trigger if the actual value has changed. Instead of every 5 minutes when the device updates its temperature, it will only trigger if the temperature changes to a new value.

2 Likes

Updates vs Changes

Great example. Here’s my attempt at visualizing this.

With a generic updates (no comparison specified), when any value comes in, the ‘updates’ trigger would be fired.

But with a generic changes (no comparison specified), the new value would have to be different than the previous value for the trigger to fire.

On Transition Only

The same type of logic applies when the ‘On Transition Only’ option is selected for a trigger that has a comparison configured.

Regular (On Transition Only: ☐, unchecked)
The trigger would fire any time a value came in that matched the configured comparison.

On Transition Only: ✓ (checked)
The trigger would only fire the first time the trigger evaluated to true. If new events came in and the trigger continued to evaluate to true, the trigger would not fire again. A value would have to be received where the trigger is not true for it to ‘exit’, then a new value would have to come in that evaluates true again before an ‘On Transition Only’ would fire again.

Explanation

TLDR: The ‘On Transition Only’ will only trigger when the event value first transitions to the configured state. It won’t trigger again until the event value transitions out of the configured state.

Step-by-Step Timeline Description (tap to expand)

At t0, the value was 74 which is below the configured threshold so the rule is not triggered.

Then at t1, the reported value was 75 which is >74, so the rule would have been triggered under either the ‘On Transition Only’ or the regular trigger.

At t2, we see the benefit of the ‘On Transition Only’ setting.

  • With the regular trigger, the new event would have evaluated and the rule would have seen it as >74 and triggered the rule to run again.
  • But with ‘On Transition Only’, the rule would have known that it had already been triggered on a previous change to >74 and it had remained above 74, so it does not need to trigger again.

At t3, the new event value is below 74 and the trigger condition is not met, so neither configuration is triggered.

  • Behind the scenes, the On Transition Only is internally reset at this point. It flags itself as the trigger not being matched, so the next time an event comes in that is matched, the system will know it’s a change in the trigger state.

At t4, the new value is >74, so the rule is triggered in either configuration.

  • Regular Trigger: triggered any time the received event value matches the configuration
  • On Transition Only: per the t3 notes, the system knows that the last event did not match the trigger configuration, and it knows that this new value is >74, so the rule is triggered.

At t5, the same logic as t2 applies. The regular trigger, is always triggered when it’s configured condition is met. And the On Transition Only, knows that it was already triggered and since the received events stayed triggered, it doesn’t need to trigger again.

Naming
The same type of language is used with these triggers as well (‘updates’ vs ‘changes’). The regular trigger would read:

…temperature updates and is greater than 74

And if you ticked the box for ‘On Transition Only’, the trigger would read:

…temperature changes to greater than 74

3 Likes

Got it my friend, Thanks !

1 Like

I had seen the light ! :grin: Thanks Josh !

1 Like