When I try to add a new script I get Message malformed: Integration '' not found

I have seen many problems with this error, but when creating an automation, and I am not having luck reading the answers. I would like to create a new script, but cannot add one as I keep getting this Message malformed: Integration ‘’ not found error.

I have also tried through yaml:

configuration.yaml has the following:
script: !include scripts.yaml

and then scripts.yaml has the following:

testscript:
  alias: Test scripting in YAML
  description: "Linda se eerste toets script"
  sequence:
    - alias: Toggle living room
    service: switch.turn_on
    data: {}
    target:
      entity_id: switch.10009f5995

This does not show up as a script on the UI, neither can I add a card to the overview with as it does not pick up the script. That’s when I tried to add the script with the UI, but keep getting this error. I have made sure the indentation is correct.

Any help will be appreciated, I am a complete beginner.

Your indentation is incorrect. Try this:

testscript:
  alias: Test scripting in YAML
  description: "Linda se eerste toets script"
  sequence:
    - alias: Toggle living room
      service: switch.turn_on
      data: {}
      target:
        entity_id: switch.10009f5995

You should really rename your entity_ids to something more meaniful like this too: switch.living_room. Do it before you use it a lot in automations and scripts.

You can edit the entity_id in the more info pop up for the entity (cog icon top right of the card) or from the integrations page.

If you have already used this switch elsewhere don’t forget to update it in all those places too. Most text editors have a handy “find and replace” tool to make this easy.

Thanks for pointing that out. When I correct the indentation the script works. However, I still cannot add a script with the UI.