It would be nice if you could turn on/off everything but exclude certain entities. A use case is to simply add: service: light.turn_off to my config to turn off every light in the system…however, I may want to exclude the porch lights. To simplify the config, I’d like it if we could do something like:
service: light.turn_off
exclude:
entities:
- light.porch_light
- etc.
`
that would make it much easier to configure global actions, IMO
True, but I got the idea from someone who asked on Gitter and it makes sense. If you add new devices, it sucks having to re-configure all of the different scenes, scripts, etc.
With this method, no updates to configurations are necessary unless you want them excluded. This seems to be a dead-simple add on, no?
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.