What's wrong with this sensor?

Hi, what’s wrong with this sensor? When I add it to the sensors.yaml, and go to developer tools → check configuration, all I get is a spinning wheel, forever.
It’s meant to check if PLC time (controller accessible via mobus) is not in sync with home assistant time.

- platform: template
  sensors:
    plc_time_sync:
    unique_id: plc_time_sync_check
    value_template: >
      {{ -180 <=
        as_timestamp(now()) -
        as_timestamp(strptime(states('sensor.plc_rtc_year' | int) + "-" +
                              states('sensor.plc_rtc_month' | int) + "-" +
                              states('sensor.plc_rtc_day' | int) + " " +
                              states('sensor.plc_rtc_hour' | int) + ":" +
                              states('sensor.plc_rtc_minute' | int) + ":"+ "00",
                              "%y-%m-%d %H:%M:%S"),
                               now()) <= 180 }}

![plc_time_format|690x211](upload://A0W1xbtv8aJ7qyuUXKy3WfqmL0e.jpeg)
![plc_time|690x370](upload://d3n2JYdssQ4xVuARTBRThTXnhzk.jpeg)


The " | int" should be outside the braces, is now trying to convert the sensor name to a number. And it should be “i| int(0)”.

Always test templates in the developer tools template tester, not by putting it straight in config and then checking the config.

Thank you! Obvious error but did not fix the issue.
This has the same problem:

this evaluates to true in the template editor but check config just shows the rotating wheel

That’s due to a YAML syntax error. The lines containing unique_id, value_template, and the first line of the template should be indented to the right by an additional two spaces.

- platform: template
  sensors:
    plc_time_sync:
      unique_id: plc_time_sync_check
      value_template: >
        {{ -180 <=
          ... etc ...

That was it, thank you Good Developer.
if only there was a better way to report this kind of issues instead of the Rotating Circle of Time… i do not even know how to phrase this feature request…
This works perfectly:

- platform: template
  sensors:
    plc_time_sync:
      unique_id: plc_time_sync_check
      value_template: >
        {{ -180 <=
          as_timestamp(now()) -
          as_timestamp(strptime(states('sensor.plc_rtc_year') + "-" +
                                states('sensor.plc_rtc_month') + "-" +
                                states('sensor.plc_rtc_day') + " " +
                                states('sensor.plc_rtc_hour') + ":" +
                                states('sensor.plc_rtc_minute') + ":"+ "00",
                                "%y-%m-%d %H:%M:%S"),
                                now()) <= 180 }}