How to group sonoff switches by room

ok i found a video to customize lovelace ui to your liking. I clicked on the gear wheel top right and selected TAKE CONTROL. How do I get rid of that and go back to my default config?

Create a new dashboard and allow Home Assistant to populate it with all your entities (this will become a new automatically generated dashboard).

Yes but when I go into my HA, i get a blank screen now, presumably because i told HA i wanted to “take control” of my dashboard. But I dont want to anymore, how do i get my old dashboard back?

GOT IT! Ok so im back to grouping groups…

The way I explained above, by creating a new one allowing it to be populated.

You can’t undo what you just did and Home Assistant informed you of it just before you confirmed you wanted to take control of the default dashboard:

This dashboard is currently being maintained by Home Assistant. It is automatically updated when new entities or Lovelace UI components become available. If you take control, this dashboard will no longer be automatically updated. You can always create a new dashboard in configuration to play around with.

Are you sure you want to take control of your user interface?

ok so for nesting groups, do i just do this in order to put Patio Group & Garage Group into the main OUTSIDE Group:

Outside:
  Patio:
    name: Patio Sockets
    entities:
        - switch.sonoff_10008c0dab
        - switch.sonoff_1000aa7e4c
  Garage:
    name: Garage
    entities:
        - switch.sonoff_1000650c18_1
        - switch.sonoff_1000650c18_2
        - switch.sonoff_1000650c18_3

Guess not cause i get this config error:

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

Like this:

  patio:
    name: Patio Sockets
    entities:
      - switch.sonoff_10008c0dab
      - switch.sonoff_1000aa7e4c
  garage:
    name: Garage
    entities:
      - switch.sonoff_1000650c18_1
      - switch.sonoff_1000650c18_2
      - switch.sonoff_1000650c18_3
  outside:
    name: Outside
    entities:
      - group.patio
      - group.garage

Thanks. I followed your format like this, but it didnt create the groups:

Entrance:
  name: Entrance
  entities:
      - switch.sonoff_10007ee316_1
      - switch.sonoff_10007ee316_2
den_room:
  name: Studio
#  icon: mdi:motion-sensor
  entities:
      - switch.sonoff_1000a83860_1
      - switch.sonoff_1000a83860_2
      - switch.sonoff_1000a83860_3
Old_Den_Extra:
  name: Old Den Extra Lamp
  entities:
      - switch.sonoff_1000b84968
Den_Sox:
  name: Den Sockets
  entities:
      - switch.sonoff_1000cf9964
      - switch.sonoff_1000cf9c6a
THE_DEN:
    name: The Den
    entities:
        - group.den_room
        - group.Old_Den_Extra
        - group.Den_Sox
Master_Bedroom:
  name: Master Bedroom
  entities:
      - switch.sonoff_100064b2ee
Master_Sox:
  name: Master Bedroom East Socket
  entities:
      - switch.sonoff_1000cf9c0f
MASTER:
    name: Master Bedroom
    entities:
        - group.Master_Bedroom
        - group.Master_Sox
Sams_Terrace:
  name: Sams Terrace Lights
  entities:
      - switch.sonoff_10007ebeee_1
      - switch.sonoff_10007ebeee_2
      - switch.sonoff_10007ebeee_3
Sams_Sox:
  name: Sams East Socket
  entities:
      - switch.sonoff_1000cf9a8b
SAM:
    name: Sams Bedroom
    entities:
        - group.Sams_Terrace
        - group.Sams_Sox
don_relay:
  name: Don Outside Relay
  entities: 
      - switch.sonoff_100064b24a
Don_Lights:
  name: Don Lights
  entities:
      - switch.sonoff_10007ece5a_1
      - switch.sonoff_10007ece5a_2
      - switch.sonoff_10007ece5a_3
DON:
    name: Dons Bedroom
    entities:
        - group.don_relay
        - group.Don_Lights
Laundry:
  name: Laundry
  entities:
      - switch.sonoff_100064ca09
Stairs:
  name: Stair Lights
  entities:
      - switch.sonoff_100064ccb7_1
      - switch.sonoff_100064ccb7_2
Guest:
  name: Guest Bathroom
  entities:
      - switch.sonoff_100064e8be_1
      - switch.sonoff_100064e8be_2
Linen:
  name: Linen Relay
  entities:
      - switch.sonoff_10007ec067_1
      - switch.sonoff_10007ec067_2
      - switch.sonoff_10007ec067_3
SERVICE:
    name: Service
    entities:
      - group.Laundry
      - group.Stairs
      - group.Guest
      - group.Linen
LR1:
  name: Living Room1
  entities:
      - switch.sonoff_10007ee105_1
      - switch.sonoff_10007ee105_2
LR1_Sox:
  name: Livingroom1 Socket
  entities:
      - switch.sonoff_1000cf9fbb
LR2:
  name: Living Room2
  entities:
      - switch.sonoff_10007ecf09_1
      - switch.sonoff_10007ecf09_2
      - switch.sonoff_10007ecf09_3
LR2_Sox:
  name: Living Room2 Socket
  entities:
      - switch.sonoff_1000cf996a
#        - switch.sonoff_1000cf9994 UNKNOWN
LIVING:
    name: Living
    entities:
      - group.LR1
      - group.LR1_Sox
      - group.LR2
      - group.LR2_Sox
Patio:
  name: Patio Sockets
  entities:
    - switch.sonoff_10008c0dab
    - switch.sonoff_1000aa7e4c
Garage:
    name: Garage
    entities:
        - switch.sonoff_1000650c18_1
        - switch.sonoff_1000650c18_2
        - switch.sonoff_1000650c18_3
OUTSIDE:
    name: Outside
    entities:
      - group.patio
      - group.garage
Kitchen_Sox:
  name: Kitchen West Socket
  entities:
      - switch.sonoff_1000cf9c2e
Pantry:
  name: Pantry
  entities:
      - switch.sonoff_10007d355e_1
      - switch.sonoff_10007d355e_2
Dining:
  name: Dining Room Socket
  entities:
      - switch.sonoff_1000cf982b
DINING:
  name: Dining
  entities:
    - group.Kitchen_Sox
    - group.Pantry
    - group.Dining

Respectfully, how much of the documentation have you read? I’m asking because the mistakes you are making suggest you have not reviewed the basics of Home Assistant. I recommend, at an absolute bare minimum, to read this section if you intend to modify anything in YAML:

The reason why it refused to create the groups is because there are several basic YAML syntax errors. After it failed to produce the groups, did you check Configuration > Logs? It undoubtedly contains error messages.

  • Don’t capitalize key names (like OUTSIDE and DINING and Kitchen_Sox).
  • Don’t duplicate key names (for Home Assistant there’s no difference between Dining and DINING).
  • Be consistent with indentation (sometimes you use 2 spaces, sometimes 4).
  • An entity_id is always in lowercase (never uppercase or titlecase like this group.Old_Den_Extra).

After you fix all of the YAML mistakes, execute Configuration > Server Controls > Reload Groups and then check Logs to ensure no new errors are reported.

Screenshot from 2021-09-12 19-56-05

ok truthfully i didnt read much. Ive seen some videos and stuff. Normally i only do the server controls * check config, I dont go to the logs. So i fixed everything and checked the logs. The only thing that keeps coming up is this:

2021-09-12 17:33:33 ERROR (MainThread) [homeassistant.components.group] Entity id already exists - ignoring: group.dining

but im not sure why, here is the code snippet:

The groups are showing up, but now i just need to hide the individual entities, so for example, Outside Group contains Patio Sockets and Garage so I get a card view for those 2 entities in there. But I still see the Garage T3 and the Patio Sockets:

Screen Shot 2021-09-12 at 6.29.59 PM

btw, thanks for all the help!

Where’s the ‘code snippet’?

Somewhere in your group configuration there are duplicated group.dining.

it must have been an old log line before i made the modifications.

ok so the only thing left is to hide the individual entities and just leave the groups with those entities inside. Is this possible. Ive been reading the hidden feature is no longer available.

As explained previously, you won’t be able to do that with the automatically generated Lovelace dashboard. … unless you take control of it and add/remove/modify the cards to suit your preferences. In addition, your original goal cannot be achieved using standard Lovelace cards:

have 1 card show up called SOCKETS and when you click on it, it takes you to a screen where you can see the individual cards inside

ok thanks. im not sure about making my own dashboard. it seemed kinda complicated. Is there a way to order the cards such that the group cards show up first in the current dashboard?

Only if you take control of the automatically generated Lovelace dashboard or create a new dashboard.

If you choose to take control of it, the cards can be re-ordered. However, if you add new entities they will no longer be automatically added to the dashboard, and you will need to add them manually (that’s a consequence of “taking control”).

true, i read about that. so im looking into creating a dashboard again. if i manage to do so, and i DO add a new entity in the future, and creating that new dashboard is simple, i could just erase my old one and have HA add the new entities once back in the default dashboard, and then create the new dashboard with the automatically added entity…dunno if that was clear or confusing:

  1. today - all my entities are there
  2. today - create new dashboard
  3. tomorrow - i buy a new device
  4. tomorrow - i delete my custom dashboard (reverting to default & HA adds new device automatically)
  5. tomorrow - re-create my new custom dashboard which should contain the new device/entity

Ok before proceeding to create the dashboard, I wanted to create a couple of scenes but i noticed that is gone. Scenes have been removed from the visual editor. Is there an equivalent?

They have not been removed from the visual editor. I’m using Home Assistant 2021.09.6 and I can see the menu command (Configuration > Scenes > Add Scene). If you don’t have that command, it implies there may be an issue with the configuration of your instance of Home Assistant. However, that’s a completely separate topic (as are about Lovelace dashboards) from this topic’s original question which was how to create groups of switches.

It’s preferable to keep a topic focused on one issue as opposed to covering a broad spectrum of Home Assistant’s features. If you have questions about dashboards, scenes, etc then start separate topics to discuss them.

agreed! thx for all the help.

1 Like

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic is resolved. This helps other users find answers to similar questions. For more information, refer to guideline 21 in the FAQ.