The custom of this community forum is to assign the Solution tag to the first, or best, post that answers the question. In this case, that would be ardysusilo’s post, not your own post that simply applied the suggestion.
For more information, refer to guideline 21 of the FAQ.
I tried this solution this morning and it didn’t work. It created a group, but when you look into the group it states it has no unique_id. So you can’t perform group actions on the entities, it just comes up in Lovelace greyed out.
Checking the Entities page in devices doesn’t give you much, but shows the group as defined with a red marker next to it. You drill into the details and the “Related” page is blank, no related items found.
I tried defining a unique_id manually in the yaml but this didn’t seem to have worked… So I tried the hail Mary of a full restart. It came back up seemingly not working. I actually started writing a query to this thread when I went back some minutes later to check on details, and found of a sudden it was working. No real explanation as to why it took 5 minutes to decide it would work. My z2m runs very lumpy so maybe that delayed startup…
The critical bit of the puzzle was, I needed to add a unique ID manually for the above to work:
- platform: group
name: Patio Lights All
unique_id: Unique_PatioLightGroup_ID
entities:
- light.PatioCoverLight
- light.PatioArborLight
there is a heavy limitation here. Some lights are switches, others are lights. This is the only way to combine them which is manual. And you can’t assign a custom icon, because you can’t assign a unique_id.
Is there a way to have this hybrid group of switches and lights and set a custom icon?
I think #8 by @123 (Taras) should be marked as the solution to this question!
It is vital to understand that a Light Group is more than a normal Group. A Group can only be switched on or off. In a Light Group you can control additionally properties like brightness and color.
The solution of Taras provides you with a way to integrate switches in such a Light Group. They will then follow the on/off state of the group and simply ignore any color or other settings, just like lights do that are not dimmable.