Need help using groups.yaml file

When I try to create a group in the groups.yaml file I get the following error:

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

Below is my entry in the groups.yaml file and below that is my configuration.yaml file.

# Example groups.yaml entry
group:
  jonandsheila:
    name: Jon and Sheila
    entities:
      - device_tracker.life360_jon
      - device_tracker.life360_sheila

I don’t understand the error as line 8 in my configuration.yaml file is a blank line

Below is a cut and paste of pertinent section of my configuration.yaml file:

# Text to speech
tts:
  - platform: google_translate
(line-8)
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

You’re pointing to the group in your configuration.yaml, but then in group.yaml you’re also using group:, this is one group: too much.
Try:
configuration.yaml:

tts:
  - platform: google_translate
(line-8)
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

groups.yaml:

jonandsheila:
  name: Jon and Sheila
  entities:
    - device_tracker.life360_jon
    - device_tracker.life360_sheila

Thank you!

That did the trick!

I was under the impression that I have put a bunch of different entities under one group and call that group in the code to automate something. In this case, I want to turn on all the lights at a certain time for all the lights in the group.

- id: basementLightsOffTest
  alias: Family Room Lift Turned On At Sunset
  trigger:
    - platform: time
      at: "17:25:00"
  action:
    # Turn on the lights
    - service: light.turn_on
      entity_id: group.basement_lights

The group is defined as:

basement_lights:
  entities:
    - light.leviton_dimmer_switch_2 #basement familyroom
    - light.madelynlamp
    - light.laurellamp
    - light.leviton_dimmer_switch #stairway light switch
    - light.leviton_device_9f8c #basement hallway

When the automation runs, it will turn one of the lights. Am I using this incorrectly?

Thanks in advance for the help!

Are you sure the entities are named correctly and when you made this group did you reload the groups or restart HA?

You should certainly check what thebatfink suggests, and this won’t be the reason why your old-style group doesn’t seem to be working, but as your entities are all lights, you would be better off using the newer-style light group platform.

You can set this up through the UI, or via YAML as you wish (under the light: key rather than the group: key).

Thank you for the responses - @thebatfink & @reste_narquois !

Are you sure the entities are named correctly

I believe so. The entities were autopopulated instead of typed out.

when you made this group did you reload the groups or restart HA?

I don’t recall but did both this morning. It didn’t work.

your entities are all lights, you would be better off using the newer-style light group platform 1.

At this point, I’d give anything a try to get this to work.

# Example configuration.yaml entry
light:
  - platform: group
    name: "Kitchen Lights"
    entities:
      - light.kitchen_ceiling_lights
      - light.kitchen_under_cabinet_lights
      - light.kitchen_spot_lights
      - light.pendant_lights

With the above example, do you call this light group with: group.kitchen_lights ??

In the YAML for light group, I have several different light groups for the upstairs, specific bedrooms, basement, etc.

As a light group, it will be part of the light domain, so likely light.kitchen_lights - do a search for it in the States tab of Developer Tools

light.kitchen_lights

But I still suspect you have / had some other issues. The original group should have worked. Go to developer tools, services, choose light.turn_on service and as the entity your light.kitchen_lights, call the service. What happens?