core: Including scripts.yaml and a folder with scripts at the same time is not possible (legacy scripts and GUI editor co-existing way)

Home Assistant release with the issue: All versions up to current 0.114.0.dev20200731

Last working Home Assistant release (if known): Never worked so far

Operating environment (Hass.io/Docker/Windows/etc.): Docker on arm based SBC

Component/platform: https://www.home-assistant.io/components/script/

Description of problem: This does not work. The second line does not do anything.

script: !include scripts.yaml
script manual: !include_dir_merge_named scripts

Please refer this two years old, stale and closed issue for the further detail. Very well described. https://github.com/home-assistant/core/issues/15628

Additional information: No debug logs. because HA does not shows anything in the log about loading scripts.

Additional comment: First, it has been like this for years, so feels like a feature we live with. Please note that, the HA documentation actually does not mention Automations and Scripts would work like above.

you can, however, have multiple top-level !includes for a given integration, if you give a different label to each one:

And the given an example,

light:
- platform: group
  name: Bedside Lights
  entities:
    - light.left_bedside_light
    - light.right_bedside_light

# define more light groups in a separate file
light groups: !include light-groups.yaml

# define some light switch mappings in a different file
light switches: !include light-switches.yaml

I guess one can argue automation and scripts are not ‘integration’, but ‘core component’. Of course, then this does not explain why bellow works great for years. Both lines a executed and loaded.

automation: !include automations.yaml
automation manual: !include_dir_merge_list automations

Anyway and unfortunately this hasn’t been fixed for over two years to my knowledge.

Maybe there is nothing to fix, because it’s just misunderstanding of the documentation. Maybe. One thing for sure is that the current situation and the unclear documentation has created fair amount of confusions over the period.

Note that a member tried to clarify this in the documentation, https://github.com/home-assistant/home-assistant.io/pull/14084/commits/31119773ae497ecae8bb6be5dabd589c2a27df5b

but, apparently met an opposition,

Actually this note is incorrect. It does work, and have used it myself as well. … I will not allow for documenting bugs in our documentation. _Originally posted by @frenck in https://github.com/home-assistant/home-assistant.io/pull/14084#issuecomment-667494369_

Meanwhile, I tried to get some information from my past configurations and logs over the years, but could not find any error logs or any HA version that worked as @frenck mentioned, or anything useful. And could not find any official documentation that it would work, but a few community posts it would. (and posts that it wouldn’t)

At the moment, I am not really sure that this is a bug or intended feature or misunderstanding of unclear phrase, but has been asked to just raise an issue of it.

I’m sorry, for the fourth time now, would you please just raise an issue? _Originally posted by @frenck in https://github.com/home-assistant/home-assistant.io/pull/14084#issuecomment-667524482_

So with much lack of useful information produced by myself and all that I could gather, this is it. I am especially sorry for the lack of useful information, at least identifying HA version that works would speed up the things.

One more thing, there is a related work-around worth mentioning https://community.home-assistant.io/t/script-editor-and-split-up-files/40459/20?u=grashugger

As this work-around works rock solid for both legacy scripts management and new GUI editor.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 8
  • Comments: 35 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Alright, got this in a working state now 👍

Will open a PR in the upcoming days for review.

Finally got round to using this so my configuration.yaml has: `` and it’s working as expected.

Thank you all for addressing the issue.

@frenck Ah I must have missed that. Thanks for pointing out!

Still an issue in 2021.2.3: Putting this in configuration.yaml will not load files from the scripts directory.

script: !include scripts.yaml
script manual: !include_dir_named scripts

(Nothing new here, just confirming for the bot)

Still an issue in 0.117.5

Sorry about that. Cleaned up some for future reference. Too excited to see it get fixed. I thought this would just go stale as the last time. am very grateful.