How to define AREA in "configuration.yaml"?

I prefer to define zones, persons, integrations (if possible) in the configuration.yaml instead of GUI.
There is no info about declaring “areas” (like “Kitchen”, “Bathroom” etc) in the config file.
Am I missing something or is it kind of “What the heck” issue?

It can only be done via the UI.

In addition, currently, there’s very little you can do with an Area (besides assign entities to it).

Oh, thank you, Taras !
I am a beginner, just wanted to have everything in the config file.

You should be aware that there’s a trend to move the configuration of various things (notably integrations) from configuration.yaml to the UI (where it stores the data in JSON format in hidden files with the hidden .storage directory). Given that Areas are currently defined exclusively via the UI, I suspect they may never be configurable any other way (but that’s just my guess).

For me the main purpose of “keeping everything in config files” is to provide:

  • a quick migration from one PC/RPi/etc to another one (because of damage/upgrade/etc or for testing);
  • a quick restoration in case of crash.

I am using HA in Docker so I do not have Supervisor with snapshots functionality.
So currently I have to backup yaml files & Lovelace cards’ declarations (copy-paste from yaml editor) periodically.

In that case, some of what you configure may exist in those hidden JSON files I mentioned. For example, if you use the UI to create an input_boolean, or an input_select, or other "Helper, it will be stored as JSON data within the hidden .storage directory. Similarly, if you configure the default Lovelace UI and/or create additional Lovelace dashboards, they will be stored as JSON data in .storage. The backups you are creating should take that directory into consideration.

Thank you very much for advices.
What I usually do is:

  1. Copy whole HA folder with subdirs.
  2. Open every Lovelace dashboard in an internal editor (as yaml file), select-all + copy + paste into txt-files. These txt-files then can be easily used for recreating dashboards.
    May be I am doing stupid things, but I am just a beginner)).

Just back up the entire config directory including hidden files and you’ll have everything you need. No need to back up the Lovelace config separately.

1 Like