Consolidating Scripts

My Home Assistant is getting quite large now and getting a little messy to organise and keep track of.
Previously, I’ve seen people creating projects and have multiple switches, sensors, config etc. within one custom .yaml file…

My question is - can I consolidate parts of my automation into one .YAML?

For example - I have many automations, helpers, scripts, config etc. for my lights.
Turn on with motion, turn off after so many minutes.

Can I pull all of the code into one YAML and references that in the config… or is that not how it works?

use packages.

1 Like