Can't save script

I’m trying to create a simple script that sends a remote command via my Broadlink RM4. Every time I try to save it via the UI, it doesn’t show in the Scripts tab. My script:

I’ve tried saving the YAML to scripts/spripts.yaml, but it still doesn’t show in the Scripts tab in the UI, nor as an entity. YAML:

primary_bedroom_fan_high:
  alias: Primary Bedroom Fan - High
  sequence:
    - service: remote.send_command
      data:
        num_repeats: 1
        delay_secs: 0.4
        hold_secs: 0
        device: Primary Bedroom Fan
        command: Fan - High
      target:
        entity_id: remote.broadlink_rm4_pro_primary_bedroom
  mode: single
  icon: mdi:fan-chevron-up

I found some¹ previous² posts³, but haven’t found a resolution yet.

In configuration.yaml, I have default_config:, as well as script: !include scripts/scripts.yaml.

What am I missing?

Edit: I just realized I have scripts.yaml in \config and another scripts.yaml in \config\scripts. The latter has the three scripts that show in the Scripts tab in the UI. The former has the new script I’ve been trying to create. How do I resolve these duplicative scripts.yaml files?

HA probably see two scripts.yaml defined in your config.yaml (one included in default_config).

Remove the !include line and copy the content from scripts\scripts.yaml to scripts.yaml and then restart HA.

When I do this, the UI says it can’t find any scripts. When I save a test script in the UI, it doesn’t show in the UI after saving, and it gets saved to scripts.yaml along with the others I had moved to that file from scripts\scripts.yaml.

Ok, some progress then.

Try to add !include scripts.yaml to your configuration.yaml and restart HA.

Thank you! Adding script: !include scripts.yaml to configuration.yaml did the trick. Scripts are now saving in that file and are also showing in the UI.