I would love to have this feature. I even thought it would work, because it’s available inside the “HomeKit” integration. You can use very easy but powerful filters there:
A feature like this is almost mandatory if the devs are going to keep refusing to support something like tagging/annotating devices and entities, because we’re forced to encode tags in the entity ID’s, like if I want to tag all of the contact sensors which are and are not controlling access from the outside:
sensor.door_front_perimeter
sensor.door_back_porch_perimeter
sensor.door_laundry
sensor.door_grarage_perimeter
Then it would be really helpful to be able to specify entity_id’s such as: entity: sensor.*perimeter*
should leave the laundry door (which is internal to the house) out of the group.
My workaround is to have an automation that is triggered on HA startup and it runs scripts which create groups for me. Here’s an example of a script that creates a group called group.perimeter_doors with all the door and garage door contact sensors for my house. To be honest this is a bit of a silly example because there’s only 5 and I don’t expect to add or remove any ever, so this should probably just be a manually created group. But I wanted to try it so
Hi,
this works for me but where is the group? I cannot edit it in the Gui as it says is has no unique ID. It is not in the groups.yaml. I cannot delete it. Any idea?
The group perstists even after a reboot. I can only get rid of it by restoring a backup from before.
I read through the article but cannot figure out how to add a unique idea. Can you eventually give a helping hand? I would really love to use this but having a group which I cannot delete or modify scares me a bit. I don´t like that idea.
The group won’t persist after a restart. If you are seeing after a restart, it is because it is cached in your web browser or on your phone’s app. You have to clear your cache. Or open an incognito window and log into your instance. If you don’t want to restart, you can call the service group.remove with the object_id of the group (which is what you used to create it, and the part after “group.” in the entity_id)
You can’t add a unique_id for a group created by a service because it doesn’t exist in YAML. Any changes to this group have to be done through service calls.
You can test out all the service calls by going to “Developer Tools → Services” and selecting any of the group services that start with “group.”