Script Not Firing - Service not found for call_service

Looking for help on where I went wrong in building out a routine that uses scripts in the routine to make it easier and reusable in other automations.

I’m clearly not calling the script correctly. What am I doing wrong when calling the script?

Below is the log of the error, the routine, script, and group that is involved in the routine:

Log:

2023-04-10 21:27:00.365 INFO (MainThread) [homeassistant.components.automation.end_of_day_routine] End of day routine: Running automation actions
2023-04-10 21:27:00.366 INFO (MainThread) [homeassistant.components.automation.end_of_day_routine] End of day routine: Executing step call service
2023-04-10 21:27:00.366 ERROR (MainThread) [homeassistant.components.automation.end_of_day_routine] End of day routine: Error executing script. Service not found for call_service at pos 1: Unable to find service script.interior_lights_off

Routine:

######################################################################
##  End of Day Shutdown Routine
######################################################################

# Define an alias for this automation
- alias: 'End of day routine'
  # Give the automation a unique ID
  id: endofdayroutine1
  # Set the mode to "single"
  mode: single
  # Set the trigger for the automation
  trigger:
    # The automation will also be triggered at 22:15 
    - platform: time
      at: '21:28:00'
    
  # Set the conditions for the automation to run
  condition:
    # The automation will only run if it is a weekday
    - condition: template
      value_template: "{{ 1 <= now().isoweekday() <= 5 }}"

  # Set the actions to be performed by the automation
  action:
     # Run the "script.interior_off" service
    - service: script.interior_lights_off

    # Turn off all TVs
    - service: script.tv_turn_off

# Close garage doors
    - service: script.garage_doors

    # Turn off tvs
    - service: script.tv_turn_off

Script:

interior_lights_off:
  sequence:
    - service: homeassistant.turn_off
      entity_id:
        - group.basement_lights
        - group.familyroom_lights
        - group.masterbedroom_lights
        - group.laundry_room_lights

Groups:

upstairs_lights:
  entities:
    - group.familyroom_lights
    - group.masterbedroom_lights
    - group.powder_room_lights
    - group.laundry_room_lights

masterbedroom_lights:
  entities:
    - light.graham_lamp #brian lamp
    - light.masterlampkayhryn #kathryn lamp

familyroom_lights:
  entities:
    - light.lights_china_cabinet
    - light.leviton_dimmer_switch_3 #mantle
    - light.kitchen_spotlight #kitchen spotlight
    - light.familyroomlamp

powder_room_lights:
  entities:
    - switch.upstairspowderbathlight

basement_lights:
  entities:
    - light.leviton_dimmer_switch_2 #basement familyroom
    - light.madelynlamp
    - light.laurellamp
    - light.leviton_dimmer_switch #stairway light switch
    - light.leviton_device_9f8c #basement hallway

laundry_room_lights:
  entities:
    - switch.laundry_light
    - light.garage_hallway
bathroom_lights:
  entities:
  - switch.madelynvanitylight
  - switch.laurel_vanity

Can you explain (this link may help):

  • What you are trying to do?
  • What you would like the code to do? (e.g. X calls Y to perform Z)
  • What is actually happening?

Without some help, we’re all just staring at some code blocks!

Thanks for the response.

What you are trying to do?

Execute the series of scripts at a defined time each weekday.

What is actually happening?

I’m receiving the error message included in the homeassistant.log referenced.

Have you checked that service: script.interior_lights_off actually exists by running the service in developer tools?

Thank you for the response and the suggestion.

I was able to figure it out. My mistake in how the configuration.yaml file referenced the script folder.