I have a sensor that outputs the last time something was updated
I’m wanting to trigger an automation, but only if, the sensor doesn’t include the words “days” or “weeks”
So it only runs if it contains “Hours” or "seconds.
condition:
alias: "not days"
condition: template
value_template: "{{ (not 'days' in 'updated 2 days ago') and (not 'weeks' in 'updated 2 days ago') }}"
The value_template: will evaluate as false and the condition will fail, thus the triggered automation won’t run.
Replace the text ‘updated 2 days ago’ with your sensor state.
Thanks but run into another issue now, maybe this isn’t the way to do it?
It keeps triggering as the state is now “Updated 11 minutes ago” - so each minute, it triggers.
Would be easier to just say if “Updated 1 minute ago”