Could it be possible for automations use both !include automation.yaml and !include_dir_named automations at the same time?
Nope, one or the other.
EDIT:
I think you can use packages with multiple automation sections though.
Ok thanks… so i must split the automation.yaml in several files and put them into a folder called automation?
Yeah, its easy.
Just make sure that you start off every automation file with your ordered dictionary indicator:
- alias: My First automation.
trigger:
... etc...
no space, starting with a dash then space (indicates an ordered dictionary item).
yes, just like i have now in automation.yaml
Sorry @petro , gotta correct you there…
automation: !include automations.yaml
automation 2: !include_dir_list automations/
So it will work using both at the same time?
Meh, no big deal. It never made sense to me why they couldn’t just merge all automation sections…
Yup, certainly should do.
using automation and automation 2?
Aye, it doesn’t make sense to me either, but there must be a reason for it.
Yes, that’s what I meant.
The reason is that i have a very big automation.yaml, so i want to begin to split it… so actually i want to use new automations in dir_list and the old one in automation.yaml
My guess is the way that yaml parses the file, it would replace the automation section with the last version of the automation sections. I could see HA just using a normal yaml library instead of creating a new one to handle special cases.
I’ve only used the dir_list in automations. The drawback is editing. It can be a bitch finding and replacing entity_id’s if things change. If you are planning on making the switch, you may want to investigate packaging.
Ah, no, you can only use the editor on automations.yaml
?? What you mean? I am not using the editor for this file and have all automations working…
Blimey this is hard work.
If you want to use the automation editor, then you must use the file automations.yaml
You can use this in addition to other automations split however you want.
If you are not using the editor, then you can split the files however you want.