Need some help in concatenated script conditions, which stopped working after 0.109 update

Hey everyone,
I have some scripts that run my irrigation routines.
They worked perfectly for over a year now but they fail to fire after 0.109 update.
I am getting this error when i try to run the automation:

hk_irrigation_irrigate_a_zone: Error executing script. Unexpected error for condition at pos 1: can only concatenate str (not "int") to str

Part of my scripts that **i think **is causing the problem is below:

  hk_irrigation_irrigate_a_zone:
    sequence:
  
  
      #=== Don't continue if switch is unavailable
      - condition: template
        value_template: >
          {{ states('switch.hk_irrigation_valve_' + valve ) != 'unavailable' }}
  
      # #=== Don't continue if duration is zero
      - condition: template
        value_template: >
          {{ (states('input_number.hk_irrigation_valve_' + valve + '_duration') | int) != 0 }}
#tried removing the | int part from here, but it still gives an error

The script is called by another script that passes the value of each valve:

      - service: script.hk_irrigation_irrigate_a_zone
        data_template:
          valve: 2  # 1,2,3,4 accordingly

Each time the first script is called by the second, it checks the durations set as input numbers by my UI and acts accordingly.

This stopped working after the last update to 0.109.

Any clues appreciated.
Let me know if you need more parts of the code.

Try with:

 - service: script.hk_irrigation_irrigate_a_zone
        data_template:
          valve: '2' # 1,2,3,4 accordingly
1 Like

You are a god!
Thank you, i would have spent hours and probably would never find it.
<3

No problem. If you want to understand why, it seems that home assistant has become a bit stricter in enforcing concatenation rules. Scroll down to the section on concatenation here for a brief explanation of why the error occurred:

I see, but python was like that always, right?

It’s HA that was kind of loose in the use / dont use quotation marks. This always troubled me with HA’s yaml.

Looks like now we’ll have to use them more now.

Yes it was only home assistant that previously allowed different data types to be concatenated.

Use quotes when you want to type cast a number as a string, no quotes for it to be an integer or floating point number (numerical state triggers for example).