Hey guys,
I finally decided to make the jump and start splitting my config files.
First thing I wanted to do is to split the automation file into multiple yaml files.
I used the !include_dir_merge_list instruction to provide a folder where all automation files will reside, but I noticed it doesn’t give me the ability to edit in the gui when I do that. I saw in some post that home assistant gui doesn’t work when you have your yaml files inside folders. So I decided I would just specify 2 automation locations like this:
I figured I will use the automations.yaml for the automation that will be editable in the gui, and the folder for the yaml automation files that is not editable in the gui. But when I did that it looks like it disabled all automations I have. It’s llisted in the gui but looks disabled.
Any idea how to achieve this?
Thanks for any helps with this.
@Pedro1x
Pedro, my config file from yesterdays post shows how to use both the automations.yaml file for UI automations AND an automations folder in which you can have multiple files for clarity. All files become merged internally but this solution gives you the best of both options. See attached screenshot of my automations folder and files.
When trying to edit (with the pen idon at the very right of the line) the entry switch bureau single press (which corresponds to an entry in the file automations/lights.yaml), I get
This means:
Only automations in automations.yaml are modifiable
If I manually move the code from automations/lights.yaml to automations.yaml the entry becomes editable from the UI.
No. My original response detailed HOW to split the automations between YAML and the UI editor. Only automations created in the UI can be modified there. Automations created in YAML are still edited in YAML. Yes, there are ways to move all your YAML automations to the UI, but personally I prefer to work in YAML. The UI editor is great if you don’t have a lot of automations/devices or don’t require advanced options. YAML offers much greater control of file structure, search ability including find & replace using Atom Editor and the use of includes. With 600+ sensors and a combined total over 700 scripts and automation, the UI editor just doesn’t have to tools or convenience necessary for my situation.
I do not have nearly that number of automation and devices but I also prefer to work in YAML (as a developer, I am used to code) but was curious nevertheless.
Thanks for the follow-up after your last post 10 months ago
You’re welcome. Always trying to give back. I’ve learned a ton from this community.
Just for fun, paste the following code into a Markup Card or the template editor.
**Counters**
{% set unique_domains = states | map(attribute='domain') |list | unique | list -%}
{%- for domain in unique_domains -%} {{"\n"}}- {{domain}}
{%- for item in states[domain]%}
{%- if loop.first -%}
: ({{loop.length}})
{%- endif %}
{%- endfor %}
{%- endfor -%} {{"\n"}}