I am trying to split up my home assistant configuration. I used to have:
automation: !include automations.yaml
and my automations in an automation.yaml file which worked absolutely fine.
I’m now trying to split it out into a folder so I added a folder called automation and added the following to the config folder:
automation: !include_dir_named automation/
I have also added a file called ha_night_day_theme.yaml which has the code:
- alias: 'Set HA theme for day and night'
trigger:
- platform: homeassistant
event: start
- platform: state
entity_id: sun.sun
to: above_horizon
- platform: state
entity_id: sun.sun
to: below_horizon
action:
- service_template: frontend.set_theme
data_template:
name: >
{% if states.sun.sun.state == "above_horizon" %}
Light - Navy Blue
{% else %}
slate
{% endif %}
But now when I check my config I get the following error:
Invalid config for [automation]: [ha_night_day_theme] is an invalid option for [automation]. Check: automation->ha_night_day_theme. (See /config/configuration.yaml, line 47)
alias: Set HA theme for day and night
trigger:
- platform: homeassistant
event: start
- platform: state
entity_id: sun.sun
to: above_horizon
- platform: state
entity_id: sun.sun
to: below_horizon
action:
- service_template: frontend.set_theme
data_template:
name: >
{% if states.sun.sun.state == "above_horizon" %}
Light - Navy Blue
{% else %}
slate
{% endif %}
@ThePapaMaan That did the trick! thanks very much. Do you know why !include_dir_named didn’t work? I looked at some of the public configurations and they seemed to include the named version rather than the merge list.