#Make "state" in state condition optional

1 messages · Page 1 of 1 (latest)

random forge
#

When creating an automation based on a state, the "From" and "To" are optional. This makes it easy to make something trigger if something has been in a given state for N seconds/minutes/etc., regardless of what the current state.

When adding a state condition though, the state is a required field. Would it be possible to allow this to be optional? In my case I'm looking to build an automation where something happens if a (different) device has been in a certain state for at least N minutes, regardless of what that state is.

(I believe it's possible to achieve this with templating, but it'd be great if this could just be built in.)

ashen pier
#

"If a device has been in a certain state for N minutes, regardless what state that is" = "if a device has not changed state for N minutes", which is not a state condition. That checks if the state/an attribute of an entity has a certain given state 😬

You will need a template to check if N minutes have passed since the entity was last_updated

random forge
#

Isn't that what the "For" is checking though in both cases?

ashen pier
#

i'm not sure that a trigger with no From and no To works if you set a For on it, either 🤔

naive hedge
#

It does

#

The docs even call that out 😛

#

It's not optional in a condition though

random forge
#

Could it be optional in a condition though?