I’d like to bring this up again, because I’m also missing an exclude function. Yes. working with groups as a workaround is possible but this gets pretty complex quiet fast and ends in way to much logical groups which get hard to take care of after a while.
But sticking to the concept of groups it would be great to exclude entities from groups - one example:
I still agree, but ultimately use the suggested “interior / exterior” groups … not as convenient, as home assistant has the wonderful feature of service: light.turn_on which is a superior catch-all without having to touch the group config.
+1. The more lights you have controlled by home assistant, the more this feature is needed. I want to turn off all of my lights except for one in the kitchen, so I have to make a group of all of them except that one, and then when I add more lights, the scene breaks unless I remember to update that group. Then I want to turn off all of the lights except for one in the bedroom, so I have to make a group of all of them except that one, and when I add more lights I have to update both groups. Etc. You end up with a ton of huge groups and it’s not manageable.
I’ve been trying to work around this in scenes by turning off the group of all lights and then turning on the one light, but groups don’t seem to care about order and the behavior is unreliable. I’ve also tried using a script, but it waits for each light as it goes so it’s very slow.
As far as implementation goes, the most generally useful pattern I can think of would be something that allows both adding and subtracting entities to form a group as you go, like:
Are you still interested in being able to exclude something from a group?
I also need this feature so I started tinkering with the code to make it work. It works roughly on groups so if you turn on/off a group with items excluded, those don’t get actioned. They do however participate in determining the group’s state. You can also use this in scripts for light/switch domains for now. Just add ‘exclude’ where you see ‘entity_id’. You should also be able to exclude a group from a group.
This is probably bound to be buggy as hell since I’m not a Python programmer but a C# guy however it seems that Python is amazingly simple and it’s gone well so far.
Looking forward to some feedback, you should be able to pull the master branch from me as this was merged with latest master from homeassistant today.
piling on here as I would also really like to see something like this. My use case is simple and I believe a very good argument for the need for this feature.
My automations, groupings and sheer number of devices is growing very quickly. Managing automations and scenes that turn on/off groups of devices becomes difficult to manage in terms of updating and maintaining them. Its much easier to split into groups and write automations that trigger scenes or turn on/off groups.
In many cases I need to aggregate groups together in order to avoid turning off or on something that otherwise belongs in the same group as everything else.
chiming in here as well - this would be great to see this implemented. My use case is similar to those above: I want to easily turn off all lights except the master suite. When I add more lights to HA, I don’t want to have to re-do groups to add them back in.
I would like to see this also. I have a few things I use all switches on for - issue is, i’ve added an alarm siren to my home and now when I turn all switches on, my alarm sounds outside. It seems like this feature should be here all ready! It’s been asked for since 2016…
I have tried everything and still need this feature in HASSIO. If I say google, turn everything on, it will turn on thing like sirens, whole house fans (with the windows closed), set off my smoke detectors! It becomes a dangerous command. We need to be able to exclude devices! This seems so easy to do?
This would be a fantastic feature. I have an automation to turn off all the light except on ( at night ), when nobody is home. But now, I need to add all lights to one group to turn off all the lights except that one.
Yes, this was already mentioned here in post #13: In a scene it’s unpredictable, which command (on or off) is executed first. You could implement it as a script and include a delay, but it makes this workaround even worse in my opinion.
And, last but not least, there are devices that take it badly to be turned off at all, f.e. computers. Or my lawn mower, which immediately starts panicking, if it can’t detect it’s perimeter wire anymore…