Problems with groups

Hi,
I can´t get the hang of group configuration. I have read numerous guides but I still can´t get HA to accept my config.

My setup is an RPI3 connected to a vera with a RfxTrx.
Here is the latest version of my not working groups.yaml. Please help!

group:
  default_view:
    view: yes
    icon: mdi:home
    entities: 
      - group.matrum
      - group.mediaspelare
    matrum:
      Name: matrummet
      entities:
        - switch.fonster_2_93
        - switch.fonster__hall_17
        - switch.golvlampa_15
        - switch.koksbank_9
    mediaspelare:
      Name: media
      entities:
        - media_player.tvrum
        - media_player.samsung_tv_remote
        - media_player.matrum
        - media_player.kok
        - media_player.chromecast_vardagsrum

What error are you seeing in home-assistant.log? Please paste those details here.

Also, you can check out my groups.yaml file & the rest of my configuration files here: https://github.com/brianjking/homeassistant-config/blob/master/groups.yaml

I am new to Home assistant so not 100% on the answer but if you have a groups.yaml file i dont think you need to include the line
group:
at the top of the file.

have a look through this page
https://home-assistant.io/cookbook/
I found the other users configuration files great to see how thing are done in Home assistant.

Are you directly editing these into your configuration.yaml or have you got a seperate file containing that?

I have a separate groups.yaml

17-05-04 06:23:22 ERROR (MainThread) [homeassistant.config] Invalid config for [group]: [default_view] is an invalid option for [group]. Check: group->group->group->default_view. (See /home/homeassistant/.homeassistant/configuration.yaml, line 58). Please check the docs at https://home-assistant.io/components/group/
17-05-04 06:23:22 ERROR (MainThread) [homeassistant.setup] Setup failed for group: Invalid config.
17-05-04 06:23:22 INFO (MainThread) [homeassistant.setup] Setting up discovery
17-05-04 06:23:22 INFO (MainThread) [homeassistant.setup] Setting up updater
17-05-04 06:23:22 INFO (MainThread) [homeassistant.setup] Setting up tts
17-05-04 06:23:22 INFO (MainThread) [homeassistant.setup] Setting up logbook
17-05-04 06:23:22 INFO (MainThread) [homeassistant.setup] Setting up media_player
17-05-04 06:23:22 INFO (MainThread) [homeassistant.setup] Setting up config
Failed config
group:
group: [source /home/homeassistant/.homeassistant/groups.yaml:1]
default_view: [source /home/homeassistant/.homeassistant/groups.yaml:2]
entities: [source /home/homeassistant/.homeassistant/groups.yaml:5]
- group.matrum
- group.mediaspelare
icon: mdi:home
matrum: [source /home/homeassistant/.homeassistant/groups.yaml:8]
entities: [source /home/homeassistant/.homeassistant/groups.yaml:10]
- switch.fonster_2_93
- switch.fonster__hall_17
- switch.golvlampa_15
- switch.koksbank_9
Name: matrummet
mediaspelare: [source /home/homeassistant/.homeassistant/groups.yaml:15]
entities: [source /home/homeassistant/.homeassistant/groups.yaml:17]
- media_player.tvrum
- media_player.samsung_tv_remote
- media_player.matrum
- media_player.kok
- media_player.chromecast_vardagsrum
Name: media
view: True

General Errors:
- Setup failed for group: Invalid config.

Successful config (partial)
group:

If you are using a seperate groups.yaml all you need in configuration.yaml is the include

group: !include groups.yaml

OR for multiple group yaml files

group: !include_dir_merge_named includes/groups

Then in the file groups.yaml there is no requirement to state group: . The first line should be default_view:

3 Likes

matrum and mediaspelare are indented one level too much, they should be on the same level as default_view. Try removing two spaces in front of them and everything underneath each group.

Now it´s looking like this, still doesn´t work

default_view:
  view: yes
  icon: mdi:home
  entities: 
    - group.matrum
    - group.mediaspelare
matrum:
  Name: matrummet
  entities:
    - switch.fonster_2_93
    - switch.fonster__hall_17
    - switch.golvlampa_15
    - switch.koksbank_9
mediaspelare:
  Name: media
  entities:
    - media_player.tvrum
    - media_player.samsung_tv_remote
    - media_player.matrum
    - media_player.kok
    - media_player.chromecast_vardagsrum

Please share your configuration.yaml in fill with any secrets redacted.

  default_view:
    view: yes
    icon: mdi:home
    entities: 
      - group.matrum
      - group.mediaspelare
  matrum:
    Name: matrummet
    entities:
      - switch.fonster_2_93
      - switch.fonster__hall_17
      - switch.golvlampa_15
      - switch.koksbank_9
  mediaspelare:
    Name: media
    entities:
      - media_player.tvrum
      - media_player.samsung_tv_remote
      - media_player.matrum
      - media_player.kok
     - media_player.chromecast_vardagsrum

I think you still need the indentation of 2 spaces on each line like you would have if you wrote it under
group: in the configuration file.

1 Like
homeassistant:
  # Name of the location where Home Assistant is running
  name: Järnvägsgatan
  # Location required to calculate the time the sun rises and sets
  latitude: !Secret
  longitude: !Secret
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 42
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Europe/Stockholm

# Show links to resources in log and frontend
# introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
  # Uncomment this to add a password (recommended!)
    api_password: !Secret
  # Uncomment this if you are using SSL or running in Docker etc
    base_url: !Secret

# Checks for available updates
updater:

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time.
history:

# View all events in a logbook
logbook:

# Track the sun
sun:

# Weather Prediction
sensor:
  platform: yr
  monitored_conditions:
      - temperature
      - symbol

# Text to speech
tts:
  platform: google
  language: 'sv'

group: !include groups.yaml


vera:
  vera_controller_url: http://192.168.1.210:3480/
  exclude: [11, 19, 21, 41, 48, 100, 101, 96, 98, 97, 94, 58, 64, 61, 103]
  #lights: [9, 13, 15, 17, 93]
  
media_player:
  platform: samsungtv
  host: 192.168.1.79

Do I have to include all my devices in different groups? Right now I have a couple of devices that isn’t placed in a group. Could that be the cause of the problem?

It doesn’t matter if all devices are in a group or not, however the following line needs an extra space, spaces are very important in yaml :stuck_out_tongue:

  • media_player.chromecast_vardagsrum

I would do something like this…

 # default_view:
  home:
    name: My Home
    view: yes
  #  icon: mdi:home
    entities: 
      - group.matrum
      - group.mediaspelare
  matrum:
    Name: matrummet
    entities:
      - switch.fonster_2_93
      - switch.fonster__hall_17
      - switch.golvlampa_15
      - switch.koksbank_9
  mediaspelare:
    Name: media
    entities:
      - media_player.tvrum
      - media_player.samsung_tv_remote
      - media_player.matrum
      - media_player.kok
      - media_player.chromecast_vardagsrum

Thanks, but doesn´t work. Same error message.

Hmm shouldn’t be the same error as there is no default_view in mine as it’s commented out.

Name: matrummet and Name: media should be name: matrummet and name: media

1 Like

In the Media-Player-Section and the “Matrum”-Section you have “Name” instead of “name”. This could be the solution. I changed it in my Setup to “Name” and got a bunch of errors :smiley:

1 Like

That is correct. You solved it. Thank you very much!!!

1 Like

That solved it. Thank you!

1 Like

I have the same issue with groups and I can see above that it was some syntax errors. Now that I have tried everything from the above solutions Im out of ideas. So now I need your help!

Here are parts of my configuration.yaml:

#group: !include groups.yaml
group:
  nere:
    name: Nere
    enteties:
      - sensor.rokdetektor_smoke
automation: !include automations.yaml
script: !include scripts.yaml

To minimize the risk of indentation errors I started to write group config in the configuration.yaml file instead. The sensor name is taken from the state development tools left column. The error I always get when running Check configuration:

Configuration invalid.CHECK CONFIG
Testing configuration at /config
2017-09-18 22:29:11 INFO (MainThread) [homeassistant.setup] Setting up http
2017-09-18 22:29:11 INFO (MainThread) [homeassistant.setup] Setting up recorder
...
2017-09-18 22:29:11 INFO (MainThread) [homeassistant.setup] Setup of domain conversation took 0.0 seconds.
2017-09-18 22:29:11 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.0 seconds.
Failed config
  group: 
    nere: [source /config/configuration.yaml:65]
      enteties: [source /config/configuration.yaml:67]
        - sensor.rokdetektor_smoke
      name: Nere

  General Errors: 
    - Setup failed for group: Invalid config.
    - Unable to setup dependencies of script. Setup failed for dependencies: group
    - Setup failed for script: Could not setup all dependencies.
    - Unable to setup dependencies of automation. Setup failed for dependencies: group
    - Setup failed for automation: Could not setup all dependencies.

Successful config (partial)
  group:

Can someone tell me what I am doing wrong? I am running hassio version 0.53.1.