Custom_Components Directory Help

I have a few components that state to put the “py” files in a directory under “custom_components” but how does the configuration.yaml find that directory? I have looked at many example configures but I do not see an !include_dir_merge_list custom_components entries in anyone’s configs. How does it know to go there for a component? I am new to HASSIO so just trying to figure all this out.

Thanks ahead…

Greg

It’s just built-in to the HA core. It will automatically look in config/custom_components for any components to load.

Really! Ok that is why I could not figure the “py” files out. I was trying to include that directory. Thanks!

So on another question if you have “sensor:” and various platforms do you have to put sensor: above each platform like below?

sensor:

  • platform moon
  • platform: tautulli
    so on and so on

or do you have to do this?

sensor:

  • platform moon
    sensor:
  • platform: tautulli

I have been putting each sensor type in its own YAML file but was not sure about having to put the work “sensor:” on each file or just one.

Just put sensor: once and all sensor platforms should go under that.

Ok got it so if I put them in a directory called “sensors” and put each sensor in its own YAML file to I just have to put it once at the top file? I guess it would be easier to make one file.

It kind of depends on exactly how you want to organize them, but if you want each individual sensor in a separate file you would have

sensor: !include_dir_list sensors

in your main configuration.yaml and then in config/sensors/example_sensor1.yaml you’d have the configuration for that specific sensor:

platform: example
name: Example Sensor

Ok thanks for the help