Need new comparison for attributes in Rule Machine

I'm monitoring the power on an outlet and I want to trigger actions if the power changes by more than "10" for example. Unfortunately there is no changed by over selection (either increased OR decreased). I know I could create multiple conditions but that seems messy when it should just be a selection on the dropdown.

Why can't you just create two trigger events, one for increased and one for decreased? There is nothing messy about an OR for triggers in one rule.

6 Likes

Worth considering how your rule would account for, say, two consecutive increases of "6". That totals more than "10" yet would never trigger the rule the way you described.

I'd vote for storing your last/threshold Power value in a hub variable, with two triggers > and < "10" from that value. Just a thought.

1 Like

I assumed they are looking for a jump of more than ten, not a jump of six, or the rule would have no purpose. Turning something on will often cause a jump of more than ten in one report, which is apparently what they want.

I wouldn't do it that way, I normally just look for a rise above a fixed number where I know the device plugged in is turned on at that point, but to each their own. Looking for a jump of ten could work, if that is how the sensor reports.

Good point. But that's irrelevant to the request of having a "changed by over". In other words, if that scenario makes "changed by over" impractical, it also makes "increased by over" impractical.

I was going to suggest seeing if what is desired here couldn't also be handled by power reporting at the device level. If I only ever care about changes over 10, then configure reports that way.

Was thinking the same:

Trigger: Device turns ON
Actions:
  Store current sensor temp -> currT
  Wait for expression: (Sensor temp > currT + 10) OR (Sensor temp >= maxT)
  Turn device OFF

See docs

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.