!include specificstuff.yaml

Can I include any file in configuration.yaml just to keep a set of entries separate?

Something like:

specificstuff: !include specificstuff.yaml

And then in specificstuff.yaml have templates, sensors, automations, etc. that all relate to a specific topic or purpose?

This might be useful for what you’re trying to achieve:

I really do appreciate your help, and for all I know Packages might be the solution I’m looking for.

But, we (the HA community) really really really needs better documentation. The following does not help:

Packages in Home Assistant provide a way to bundle different integration’s configuration together. With packages we have a way to include different integrations, or different configuration parts using any of the !include directives introduced in splitting the configuration.

Packages are configured under the core homeassistant/packages in the configuration and take the format of a package name (no spaces, all lower case) followed by a dictionary with the package configuration. For example, package pack_1 would be created as:

homeassistant:
  ...
  packages:
    pack_1:
      ...package configuration here...

YAML

Copy

The package configuration can include: switch, light, automation, groups, or most other Home Assistant integrations including hardware platforms.

It can be specified inline or in a separate YAML file using !include."

I’m sure that this language makes perfect sense to many people on this forum. I am equally confident that for vast numbers of people, it’s gibbrish.

I read the page and I have only a vague understanding that Packages extends the !include functionality. But “bundle different integration’s configuration” and “way to include different integrations, or different configuration parts” and “are consigured under the core homeassistant/packages in the configuration” and “…package configuration here…” are worse than meaningless – it is super frustrating to read this and think “why am I not understanding this?” I’m sure the implementation works, and the author understands the implementation, and I suspect the author is not wrong in what he/she is saying. And yet, it is simply not helpful.

Ugh.

The link I sent previously directed you specifically to what you asked for: how to create packages with a !include setup by using a packages folder with separate files in it for individual packages.

Here’s a part of the last package setup I’m still using - it’s the content of a file called ‘igrill.yaml’ in my ‘packages’ folder that I’m referring to from the configuration.yaml like this:

homeassistant:
  packages: !include_dir_named packages/ 

I moved most of my packages back into the standard helpers, automations, scripts because it was a pain to maintain outside the GUI, but here you go:

input_select:
  smoker_options:
    name: 'Smoker Options'
    options:
    - '(1) Smoke'
    - '(2) Heat Up'
    - '(3) Fish'
    - '(4) Beef'
    initial: '(1) Smoke'
    icon: 'mdi:grill'

input_number:
# For iGrill
  grill_alert_low:
    name: Grill Low Temp
    initial: 185
    min: 100
    max: 550
    step: 5
    unit_of_measurement: '°F'
  grill_alert_high:
    name: Grill High Temp
    initial: 245
    min: 100
    max: 550
    step: 5
    unit_of_measurement: '°F'

sensor:
  - platform: template
    sensors:
      grill_alert_temp:
        value_template:
          "{% if (states('sensor.igrill2_ambient_temp') |float(0) | int) < (states('input_number.grill_alert_low') |float(0) | int) or (states('sensor.igrill2_ambient_temp') |float(0) | int)  > (states('input_number.grill_alert_high') |float(0) | int) %}
            Alert
          {% else %}
            Normal
          {% endif %}"
        friendly_name: Grill Temp Alert
  - platform: template
    sensors:
      target_alert_temp_probe_1:
        value_template:
          "{% if ((states('sensor.igrill2_probe_1') | float(0) | int) >= (states('input_number.grill_probe_1_target') | int) and (states('sensor.igrill2_probe_1') | float(0) | int) < 250 ) %}
            Alert
          {% elif ((states('sensor.igrill2_probe_1') | float(0) | int) >= (states('input_number.grill_probe_1_target') | int - 5 ) and (states('sensor.igrill2_probe_1') | float(0) | int) < 250) %}
            Warning
          {% else %}
            Normal
          {% endif %}"
        friendly_name: Probe 1 Target Alert
  - platform: template
    sensors:
      target_alert_temp_probe_2:
        value_template:
          "{% if ((states('sensor.igrill2_probe_2') | float(0) | int) >= (states('input_number.grill_probe_1_target') | int) and (states('sensor.igrill2_probe_2') | float(0) | int) < 250 ) %}
            Alert
          {% elif ((states('sensor.igrill2_probe_2') | float(0) | int) >= (states('input_number.grill_probe_1_target') | int - 5 ) and (states('sensor.igrill2_probe_2') | float(0) | int) < 250) %}
            Warning
          {% else %}
            Normal
          {% endif %}"
        friendly_name: Probe 2 Target Alert
automation:
  - alias: "Probe 1 Warning Temp"
    id: probe_1_warning_temp
    trigger:
      - platform: state
        entity_id: sensor.target_alert_temp_probe_1
        to: 'Warning'
    action:
      - service: notify.mobile_app_wg_s_pixel_4a
        data_template:
          title: "Probe 1 @ Warning Temp."
          message: 'Currently {{ states.sensor.igrill2_probe_1.state }} F'
      - service: notify.mobile_app_drdashboard
        data:
          message: TTS
          data:
            tts_text: "warning - grill sensor 1 is close to target temperature at {{ states.sensor.igrill2_probe_1.state }} degrees"
            media_stream: alarm_stream
            priority: high

You can see the various domains that are addressed in this file, like input_select, input_number, sensor, or automation.

And, BTW, I’m part of the ‘we (the HA community)’ as well - so, your call for better documentation might be a valid one, but we’re all in the same boat here.

1 Like
1 Like

We are definetly in the same boat.

And I hope you know I was absolutely not directing my rant against you.

I am grateful to you and admire your generousity to help strangers.

I just feel like absolutely everything I want to do it extremely complicated. I understand that what I want to do is not easy, and wasn’t even possible a decade or two ago, and I am tremendously grateful for HA’s existance – and for the people who develop, add to, and support it.

Thank you yet again for sharing your solution – I will keep at it as best I can.