Configuring entities via the UI vs. YAML

I’m an HA noob so I’m sure I’m missing some concept or something. But what is the difference between configuring entities through the UI vs having them specified in the configuration file(s)? Is there a difference? Or am I thinking of two entirely different things?

For example, I added my Ecobee thermostat by just adding the following to my configuration:

ecobee:
  api_key: <my_api_key>

After restarting, a number of entities were automatically added (sensors, climate, etc). I can then override the entity name and some other properties through the UI. But if I look at other people’s config examples, I see they have a bunch of sensors defined in their yaml. Are the two things interchangeable? Or are people defining sensors in their yaml because the UI doesn’t allow it? Another example is my Ring Alarm integration which is done via MQTT. Once I added the Ring topics to my broker, all of the sensors automagically showed up in my entity list. If I had set “discovery” to false in my mqtt config, could I have added my sensors manually via a config? If so, what would the benefit be?

I like the idea of having my entire configuration in code, mainly so there’s a single place where all configuration exists. Or like I said at the beginning, maybe I’m just not getting it. Any help would be appreciated. Thanks!

Some integrations can be setup only throug the UI, some only in YAML and some support both methods. There’s no right or wrong here, just personal preferences. However in general HA is going in a direction to configure everything in the UI.

Hi at all :slight_smile:

Im currently starting with home assistant too, and im struggling with gui vs yaml settings too.

Can someone explain me where entities are stored through the gui?

For example: Ive created persons through the gui. But there is no persons.yaml where I can see the configured settings through the gui? Should be anything in the configuration.yaml?

regards

No, there won’t be. To view entities in your system:

Open your Home Assistant instance and show your entities.

Or

Open your Home Assistant instance and show your state developer tools.

Hi Petro,

thanks for your quick response. Can you gimme some more details? Are theses entities stored in a database and can I handle these like entities from yamls?

Sorry for stupid questions :smiley: just want to understand how its working :slight_smile:

I don’t know what you mean by “handle these like entities from yaml”. They are entities in your system. You can see them in the pages that are linked.

I mean if there is a difference between objects from gui and yaml?

When im home, i will take a look. thank you :slight_smile:

No difference.

Hi petro,

thanks for your help! I took a deeper look yesterday and found the information I need :slight_smile:

For a specific entity type (eg Utility Meters) - can I have some defined in YAML AND some defined via the UI?