Jinia2 Template works in versions of HA prior to 2023.5 but no longer working

Hi All,

I created a template which worked great before the 2023.5 update. Since then, it works in the template editor but renders “unknown” when added to my configuration file. Here is the code, can someone point me in the direction as to what needs to be changed in order to get it to work in the newer versions of HA.

Edit: I figured it out, there is nothing wrong with this code. I needed to remove the “Unit of measurement:” line from the sensor itself.

          {% set time1 = states('input_datetime.irrigation_start')[0:3] + ((states('input_datetime.irrigation_start')[3:5] | int + states('sensor.irrigation_added_minutes') | int) | string) + states('input_datetime.irrigation_start')[5:9] %} 
          {% set time2 = ((time1[3:5] | int - 59) | string) %}
          {% set time3 = ((time1[0:2] | int + 1) | string) %}
          {% if time1[3:5] | int > 59 and time1[3:5] | int < 69 %}
          {{ time3+':' + '0' + time2+':' + time1[6:9] | string }}
          {% elif time1[3:5] | int > 59 and time1[3:5] | int > 69 %}
          {{ time3+':' + time2+':' + time1[6:9] | string }}
          {% elif time1[3:5] | int < 10 %}
          {{ states('input_datetime.irrigation_start')[0:3] + '0' + states('sensor.irrigation_added_minutes') + states('input_datetime.irrigation_start')[5:9] }}
          {% else %}
          {{time1}}
          {%endif%}