Group 2 entities in groups.yaml resulting into error in configuration.yaml

I’m a complete newbie using HomeAssitant for a few days now. I’m trying to figure out HA, so I can move away from my other AIO home automation device.
This AIO device holds all the antennas and has fairly simple configuration tool with a lot of options… So why moving away than?.. well the unit is showing more and more errors. It was an expensive device, but free from subscription and an acceptable update policy. But the updates are less and less and they started to make some features to be paid and the worst part… lack of a good dashboard.

So back to HA… i’m playing around and I have only added the IKEA Tradfri bridge at the moment. When I’m happy with the progress (I made) I will start to move more over to HA and remove it from the AIO.

I’m struggling with grouping lights. Example: I have a ceiling light which hold 2 bulbs. I want to group this so I have 1 entity on my dashboard.
I have tried to adjust the groups.yaml, but this results in an error

default_view:
  view: true
  icon: mdi:home
  entities:
    - group.office
    - group.master bedroom
office:
  name: office ceiling lights
  entities:
    - light.office_light_ceiling_1
    - light.office_light_ceiling_2
master bedroom:
  name: master bedroom ceiling lights
  entities:
    - light.master_bedroom_light_ceiling_1
    - light.master_bedroom_light_ceiling_2

resulting in below error

Invalid config for [group]: [view] is an invalid option for [group]. Check: group->group->default_view->view. (See /config/configuration.yaml, line 8).

Who is able to support.

Thanks from a newbie

You are looking at a REALLY REALLY old guide somewhere.

default_view hasn’t been a thing since the dinosaurs.

Get rid of the first 6 lines, the other two groups you have will work fine, although I suspect you actually wanted light_group rather than group. I’ll leave you to read the up-to-date documentation to make a decision on that in due course.

it now shows my age :slight_smile:

removing the first 6 lines indeed solve the error

and you are right, it should be a light_group. Do I use the groups.yaml for this or do I need to create (or add to configuration.yaml) a new file?

Remove everything from the group’s.yaml and copy this directly to configuration.yaml

light:
  - platform: group
    name: office ceiling lights
    entities:
      - light.office_light_ceiling_1
      - light.office_light_ceiling_2

  - platform: group 
    name: master bedroom ceiling lights
    entities:
      - light.master_bedroom_light_ceiling_1
      - light.master_bedroom_light_ceiling_2

Make sure that the first line is aligned to the left edge of the page and the indentation for everything below is preserved.

Then config check and restart homeassistant.

works like a charm. thnx for teaching this old dino

And now up for discovering a new function, which would make the AIO device obsolete :slight_smile:

1 Like

No worries. Just make sure to look at the current official documentation, online guides go out of date really fast as the project develops :+1:

Last Q for this topic:
Is there a logical reason to find to have all config options in separate yaml files?
I see the configuration.yaml is where to put everything in, but having a separate groups.yaml, a lights.yaml etc looks like being more organized and creates better insight.

Or is it better to have only the configuration.yaml and categories it in the file (which potentially could create a very long list of code)

Splitting up the configuration is to make it easier to read for you. Essentially all of the files get bundled back in to one big configuration.yaml when homeassistant starts.

There are multiple ways to split up the configuration so you can separate concerns based on the logic that makes the most sense to you.

I personally think that the best way to start is to put everything directly in configuration.yaml, and then when it starts getting big and unwieldy split it up.

I chose to split my configuration using the ‘packages’ method, where each file contains the components I need for a specific task (security, heating, lighting etc), but a lot of people prefer to use the include methods to split by component (automations, scripts etc). Some people use a combination of the two, but it comes down to what makes sense for you :slightly_smiling_face:

1 Like