Asking for ideas and opinions on how to properly configure Home Assistant

Hello,

quick note before: I already found this similar topic, but as its now over 5 years old and doesn’t really answer my questions, I thought I simply ask this again in hope that this topic grows to a collection of ideas and opinions regarding these topics.

I’ll edit and complement this thread with new topics over the time and add links to answers to the corresponding topics for easier navigation for future readers.

While I’m using Home Assistant for quite a few years now, I haven’t really done a deep dive. Most resources on the internet (including YouTube) only cover either the basics (thats an automation, thats an entity and so on), or how to do a verify specific thing. But no resource I could find covers: How to properly configure that, name this, structure that.

I’ll try to give this post some structure. Unless otherwise stated, the following topics stand for themselves and can (probably) be handled independent from each other.

Preamble
My current Home Assistant configuration is quite messy in my opinion and I try to clean it up, especially in preparation for extending it further with new devices I plan to add.

Currently, most of the things are done in the UI and some things are configured via the configuration.yaml. For refactoring I got myself inspired by the configuration of @frenck before his purge about two years ago (I hope tagging you is OK for you, frenck).

The thing that bothers me with YAML configuration is, that (as far as I know, please correct me if I’m wrong) not everything can be done in YAML. For example: Areas are a UI only thing. I cannot assign an area to an automation completely written in YAML outside the automations.yaml file. Maybe I just have a very wrong interpretation of YAML configuration altogether.

1. To UI or not to UI
I have to configure most of my relevant integrations via the UI. ZHA is a brilliant example, as it’s required to adopt devices through the UI. This is understandable, as adopting a device is a whole process, not just a configuration thing.

Some integrations are lacking a YAML configuration documentation entirely. For example: The workday integration documentation only covers on how to do it via the UI. But I couldn’t find any documentation on how to properly add a workday sensor (probably a binary sensor?) in plain YAML. Some other integrations provide documentation to configure them via plain YAML. This is in no means a rant, but it makes me think: Is configuring stuff via YAML even considered bad practice or was it just forgotten / overlooked / for some other reason not documented?

Back to the automation and area/zone topic: Most of the time I noticed that options are available via YAML, but not via the UI. Especially for new stuff. In this example it’s the exact opposite. This option is available via the UI, but not in YAML (at least as far as I’m aware of). This raises the same question as before.

2. Naming entities (Labels and Entity IDs)
I’m in huge trouble with naming things. Both devices and entities. Let’s explain this by a practical example: A Philips Hue light bulb / strip (I’ll simply call it “light” from now on).

When adding a light bulb as a device, I’ll typically name it like
[Room, eg. "Bedroom"]: [Arbirary Name, eg. "Floor Light"].

This also gives me a base for entity IDs:
light.bedroom_floor_light.

This devices adds several entities:

  • light (the light itself)
  • input_boolean (should this device autostart after power loss?)
  • input_number (what brightness should it have after auto restarting?)
  • and some more. Not relevant for explaining this example.

When naming these entities, I currently kinda follow the same schema, but append the entity purpose. For example:

  • Bedroom: Floor Light Light
    (light.bedroom_floor_light_light)
  • Bedroom: Floor Light Autostart
    (input_boolean.bedroom_floor_light_autostart)
  • Bedroom: Floor Light Startup Brightness
    (input_number.bedroom_floor_light_startup_brightness)

As Home Assistant strips the device name from the entity name in some contexts, this works great as the entites are then simply represented as Light, Autostart and Startup Brightness.

But especially for the “base entity”, the light in this case, this leads to duplication in both the name and the entity ID: …Light Light (...light_light).

Simply removing the duplicated Light makes it so that Home Assistant wont remove the device name (Bedroom: Floor Light), as the entity wouldn’t have a name in that case, and instead simply shows the full entity name. How do you handle these situations?

End
I feel like that without a convention (may be self-thought, may be inspired by other people), especially a large Home Assistant installation can get messy really quickly.

I’m really interested in your ideas and opinions and on how you handle configuration of different integrations and the naming of devices and entities :slight_smile:

True, some integrations are UI only, some are YAML only, and some can be set up in both but may have limitations based on which method you use to set them up.

That’s because it, and a number of other integrations, have been moved fully to the UI. If you look in the docs history on github you will find how the Workday sensor used to be configured via YAML. It wasn’t overlooked or forgotten, it’s not included because it’s not an option anymore.

You could create something with similar functionality to the old Workday sensor in YAML using a Template binary sensor but you would have to figure out holidays yourself and you would loose the new ability to query for a response based on a given date.

Thanks for the link!

This makes me wonder: Is there a preferred way to do things? I’ve read in other threads, that YAML will always be an option to configure things. But this looks like that, at least for some things, the UI is preferred over YAML in the future. Is YAML still a recommended way for some things?

UI has the advantage, that even not-so-tech-savvy people in my home can easily configure or modify dashboards, add new integrations and so on.

My exact question is: I’m currently completely refactoring my Home Assistant setup from the ground up. To be “future proof”, should I use the UI if I can and only configure things directly in YAML if I have to?