Condition limiting automation from being triggered for 60 since state last changed

I know it’s probably the basic thing even but I’m searching the answer for hours and I still dont know why it doesn’t work for me…

The case is deadly simple: I want to prevent automation to trigger if my motion sensor state has changed in last 60 sec or sooner.

My condition:

condition: template
value_template: >
  {{ (as_timestamp(now()) - as_timestamp(states.binary_sensor.czujnik_ruchu1_occupancy.last_changed)) > 60 }}

I checked many times, my sensor binary_sensor.czujnik_ruchu1_occupancy is correcty changing the state from “off” to “on”

Without this condition automation is trigger correctly.
What Im doing wrong ?

Is your automation using a State Trigger to detect changes to binary_sensor.czujnik_ruchu1_occupancy? If it does then this Template Condition should do what you want:

condition: template
value_template: >
  {{ now() - trigger.from_state.last_changed > timedelta(minutes=1) }}

I think you forget one bracket but thank you! It works!

condition:
  - condition: template
    value_template: |
      {{ (now() - trigger.from_state.last_changed) > timedelta(minutes=1) }}

For future reference, it isn’t necessary to enclose the subtraction in parentheses.

The following example demonstrates the result is the same with and without the parentheses.