Automation numeric value timespan condition

In an automation system, it would be nice to have a condition, as with the state, that a numerical number must also be reached for a certain period of time.

I’m sure you know this, but the workaround is to create a template binary sensor based off that number, and trigger on its ‘on’ state.

{{ states('sensor.SOURCE_NUMBER')|float(0) > THRESHOLD_VALUE }}

The difficulty with the feature request is that it requires the system to keep track of all changes, or to periodically look them up from the database. The state check is easy: “are we in that state, and when did it happen?”; your FR is “are we above that number, and can we check back to see when we were last below that number?”

1 Like

The conditions can’t have a time period.
As soon as something triggers then the condition is checked.

The time period must be in the trigger

I used to think that, but I was also wrong :wink: (for state conditions, not numeric state which is the subject of this FR).

That was frustrating:

dc

original

2 Likes