I need a condition check for if-that the attribute has not changed values for some time. If the volume level has not changed in the last 5 seconds, then perform the action
Does a State element with an empty value perform the check I need? Or it is possible to check through templates?
If I were working with specific values, I would use a binary template sensor with delay_on. Or a similar template value. But in this case, the options are unclear to me.
Show us what the entity you’re working with that holds the volume looks like: screenshot from Developer Tools / States, showing entity, state and attributes columns.
I’m just checking you genuinely meant attribute and weren’t confused with state, which would have an easier solution via last_updated.
I’d do this with a trigger-based template sensor that updates to the current time whenever the volume changes, then create an automation with a template trigger checking if that sensor is more than five seconds away from the current time.
This construction works in a trigger. But I need a condition check in the action block.
Any trigger is a subscription to the HAssistant’s event stream to catch the right one and pull the trigger.
Creating additional automation to track volume changes and then calculate the time stamp difference is the only solution. You said it right.