Why am I getting "Running_script: false" in a trace?

There are several posts in this forum that ask about “Running_script: false” in a trace of an automation, but they were all solved for their own individual circumstances. I still do not understand where it comes from; or to put it another way, what rule am I breaking?

Some posts mention “Limit: 10” after “Running_script: false”, but that is not appearing in my case.

These errors are immensely frustrationg because their occurance appears random. There is no otehr error message, and the code in the trace looks correct. I cannot reproduce the errors without knowing the cause, so the automation ends up just looking unreliable!

One specific case is a code step in a blueprint that sends a new setting to a thermostat, then sets a timer. When the timer expires I check whether the setting was correctly set on the thermostat.

It appears in a repeat loop for what can be a list of thermostats, though my current test case has only one (called “climate.butlers_room_trv”).

Here is an extract of the blueprint code (because this forum wll not let me post all of it)


  ## -------------------------------------------------------------------------------------------------
  ## ACTION[2] -- SEND TEMPERATURE CHANGE TO THE THERMOSTATS (BUT ONLY WHEN NECESSARY)
  ## -------------------------------------------------------------------------------------------------

  # ACTION[2].SEQUENCE[0]. Check for each thermostat in the input list whether a change to the setting is required 
  - repeat:
      for_each: !input thermostat_controls
      sequence:

        # *** diagnostic
        - service: input_text.set_value
          target:
            entity_id: input_text.diagnostic_text_1 
          data:
            value: "**{{ state_attr(repeat.item, 'friendly_name') }}**\nCurrent temperature = {{ state_attr(repeat.item, 'temperature') | float(0) | round(1) | string }}.\nRequired temperature = {{ states(local_required_temperature) | float(5) | string}}." 

        # Thermostat is available and a change is required 
        - if:
          - condition: template
            value_template: "{{ not states(repeat.item) == 'unknown' }}"
          - condition: template
            value_template: "{{ not states(repeat.item) == 'unavailable' }}"
          - condition: template
            value_template: "{{ not state_attr(repeat.item, 'temperature') | float(0) | round(1) == states(local_required_temperature) | float(5) | round(1) }}"
          
          then:
            # Send the command
            - service: climate.set_temperature
              target:
                entity_id: "{{ repeat.item }}"
              data:
                temperature: "{{ states(local_required_temperature) }}"
                hvac_mode: heat

            #
            # Start the echoblock timer
            # Only starts if there is a change. It is OK if it starts more than once (only ending triggers this automation).
            - service: timer.start
              data:
                duration:
                  seconds: 20
              target:
                entity_id: !input echoblock_timer


and this is a screehshot of the trace in my test example

A second case in the same blueprint is the setting of an input text field using a template. Mostly it works and then sometimes it doesn’t.

Here’s the code extract and the trace for a case when it did not work

      # ACTION[1].CHOOSE[5]. If there is no active calendar event
      - conditions:
          - condition: state
            entity_id: !input room_calendar
            state: "off"
        sequence:
          - service: input_number.set_value
            data:
              value: !input background_temperature
            target:
              entity_id: !input required_temperature
          - service: input_text.set_value
            data:
              value: >-
                {{ 'Set to background temperature, ' +  local_background_temperature | round(1) | string + ', because nothing is scheduled.'}} 
                {% if state_attr(local_room_calendar, 'message') %}
                {{ "The next event is '" + state_attr(local_room_calendar, 'message') + "' " + ( as_timestamp(state_attr(local_room_calendar, 'start_time')) )  |  timestamp_custom('on %a %d %b %Y at %H:%M', false)}}
                {% else %}
                {{ "There are no future events." }}
                {% endif %}
            target:
              entity_id: !input setting_reason

As in the previous example, everything looks fine except for the fact that it did not execute. Grrr!

I have a similar issue when running an automation to lock my front door. If I run all steps singular, it works well, but executing the automation it fails. In the trace the service shows running_script: false

Here is a screenshot of the whole trace:

1 Like