Script stopped working since 0.113 but cant figure out why

Hi,

I have a script that is being used for a fan, but since upgrading to 0.113 it stopped working and i cant figure out why it stopped working. I have rolled back my installation to 0.112.3 andthe script does work on that version.

Someone here that can kick me in the right direction?

zolder_fan_on:
  alias: zolder ventilator aan
  sequence:
    - service: input_boolean.turn_on
      data:
        entity_id: input_boolean.zolder_fan_state
    - delay:
        seconds: 1
    - service_template: >
        {% if is_state("input_select.zolder_fan_speed", "Min") %}
          script.zolder_fan_min
        {% elif is_state("input_select.zolder_fan_speed", "Med") %}
          script.zolder_fan_med
        {% elif is_state("input_select.zolder_fan_speed", "Max") %}
          script.zolder_fan_max
        {% endif %}

zolder_fan_min:
  alias: zolder ventilator min
  sequence:
    - service: script.turn_off
      entity_id: script.zolder_fan_min
    - service: switch.turn_off
      data:
        entity_id: switch.comfo_fan_0, switch.comfo_fan_1
    - service: input_select.select_option
      data_template:
        entity_id: input_select.zolder_fan_speed
        option: "Min"
    - service: fan.turn_on
      entity_id: fan.zolder_fan

zolder_fan_med:
  alias: zolder ventilator med
  sequence:
    - service: script.turn_off
      entity_id: script.zolder_fan_med
    - service: switch.turn_off
      data:
        entity_id: switch.comfo_fan_1
    - service: switch.turn_on
      data:
        entity_id: switch.comfo_fan_0
    - service: input_select.select_option
      data_template:
        entity_id: input_select.zolder_fan_speed
        option: "Med"
    - service: fan.turn_on
      entity_id: fan.zolder_fan
      
zolder_fan_max:
  alias: zolder ventilator max
  sequence:
    - service: script.turn_off
      entity_id: script.zolder_fan_max
    - service: switch.turn_on
      data:
        entity_id: switch.comfo_fan_0, switch.comfo_fan_1
    - service: input_select.select_option
      data_template:
        entity_id: input_select.zolder_fan_speed
        option: "Max"
    - service: fan.turn_on
      entity_id: fan.zolder_fan
      
zolder_fan_set_speed:
  alias: zolder ventilator snelheid
  sequence:
    - service: input_select.select_option
      data_template:
        entity_id: input_select.zolder_fan_speed
        option: "{{ speed }}"

You have five scripts. Which one doesn’t work? Also, can you elaborate on “doesn’t work”? What doesn’t do what you expect it to do, or what does it do that you don’t expect it to do?

Why do the three scripts in the middle start by stopping themselves?

None of the scripts are working, when i hit a button in my lovelace it should put the fan on low, medium or high. But that doesnt happen, when i click the buttons nothing happens.

The stop in the three scripts is because of in version 0.112 i got errors that the script was already running.

three in the middle, zolder_fan_mid, zolder_fan_med, zolder_fan_max should change the fan speed and that doesnt happen.

That would only happen when an attempt was made to run a script that was already running. Having the script stop itself is not how to handle that, and never was. Honestly I’m not sure how these scripts ever worked. But that’s beside the point.

I would say the first thing to do is to remove that first step from each of the three middle scripts. That will definitely prevent them from working as you expect now. (They actually run, but they stop themselves immediately.)

Ok removing the stop in the middle 3 scripts worked, its working again. Now i still get the error that the script is already running but not sure why.

Because it’s getting called multiple times simultaneously. What is calling those scripts? There’s obviously more than just the scripts you shared. Are there automations that call them? If you want to know what’s going on, look in home-assistant.log. That’s what it’s there for.