Template not responding as developper tool

Hello
… happy new year to all …
i have a simple test : comparison between 2 times. it doest not work in automation:
the results are different when i check it in developper tool:

manuel ecoule:
{{now()|as_timestamp >=states('input_text.fp_m_offset_duree_var')|as_timestamp}}

returns:

manuel ecoule:
True

its ok :slightly_smiling_face:

but same test in template in automation returns “dont pass” …it is not ok ! :woozy_face:

the code of the automation (testing purpose):

alias: fp_m_time_raz_wui
description: ""
trigger:
  - platform: time_pattern
    minutes: /1
  - platform: state
    entity_id:
      - input_select.fp_m_duree
condition: []
action:
  - if:
      - condition: template
        value_template: >-
          now()|as_timestamp
          >=states('input_text.fp_m_offset_duree_var')|as_timestamp
    then:
      - service: input_boolean.turn_off
        data: {}
        target:
          entity_id: input_boolean.pf_m_g
    else:
      - service: input_boolean.turn_on
        data: {}
        target:
          entity_id: input_boolean.pf_m_g
mode: single

what i am doing wrong ?

You forgot the curly brackets to make it a template. So, like this (multi-line, not quoted):

action:
  - if:
      - condition: template
        value_template: >
          {{ now()|as_timestamp >= states('input_text.fp_m_offset_duree_var')|as_timestamp }}
    then:
      - etc...

or this (single line, quoted):

action:
  - if:
      - condition: template
        value_template: "{{ now()|as_timestamp >= states('input_text.fp_m_offset_duree_var')|as_timestamp }}"
    then:
      - etc...

or even like this (shorthand):

action:
  - if:
      - "{{ now()|as_timestamp >= states('input_text.fp_m_offset_duree_var')|as_timestamp }}"
    then:
      - etc...

thank you, it works,
but without any change from me :thinking:
i explain: i have restarted HA this morning and the syntax is magically good (same as you wrote), but without any editing from me !

action:
  - if:
      - condition: template
        value_template: >
          {{ now()|as_timestamp >= states('input_text.fp_m_offset_duree_var')|as_timestamp }}
    then:
      - etc...

thank you again.