What do you need before you start?
- Home Assistant 2026.11 or later. The exclude option does not exist in earlier versions, so update first and check Settings, About.
- Areas, floors or labels set up. Exclusions work best when the thing you target is a group such as a floor. If your devices are not yet assigned to areas, do that first; our entity naming guide for 2026.11 covers how names and areas now fit together.
- A light, switch or other entity that supports the action. The examples use
light.turn_off, but the sametargetblock works with other actions.
Step 1: Create the automation and add a broad target
Go to Settings, Automations & scenes, create a new automation and add an action such as Light: Turn off. Under Targets, choose the broad group you want, for example the floor called Ground floor.
Home Assistant documents that targets accept entities, devices, areas, floors and labels. Starting broad is the point: you describe the rule once and let exclusions carve out the exceptions.
Step 2: Select Exclude target and pick what to leave out
Next to Add target, select Exclude target, then choose the kitchen area, a single device, or a label. The exclusion appears below the targets it affects, with a count of how many entities it removes, so you can see at once whether it did what you expected.
An exclusion applies to all targets in that trigger, condition or action, not just one of them. If you want different exceptions for different targets, split them into separate actions.
Step 3: Exclude individual entities from a target's details
If you only want to drop one or two entities that a target covers, open the target's details, clear the checkbox next to each item to leave out, and select Apply. Tick the box again and apply to bring it back.
One limit catches people out. An entity removed by an area, device, floor or label exclusion cannot be re-included on its own. Remove that exclusion instead, then re-add the entity.
Step 4: Write the same thing in YAML
Open the automation in YAML mode and you will see the exclusion as an exclude block inside target. It uses the same keys as target: entity_id, device_id, area_id, floor_id and label_id, each taking one ID or a list. Use IDs, not names.
alias: "Downstairs lights off at bedtime"
triggers:
- trigger: time
at: "23:00:00"
actions:
- action: light.turn_off
target:
floor_id: ground_floor
exclude:
area_id: kitchen
label_id: night_light
This switches off every light on the ground floor except those in the kitchen and anything labelled night_light. The exclude block cannot use all or none, cannot contain another exclude, and is not a valid target on its own, so it must sit alongside at least one real target.
Step 5: Use a label for exceptions you will change often
Hard-coding the kitchen into the automation is fine until the exceptions move. A label is easier to maintain: create one called, say, keep_on under Settings, Areas, labels & zones, then exclude that label.
From then on, keeping a lamp out of the routine means applying the label to it. You never touch the automation. It pairs well with the goodnight script for the whole house, where a hallway or landing light often needs to survive the shutdown.
Step 6: Check for exclusions that do nothing
Exclusions are re-evaluated every time the trigger, condition or action runs. If you exclude an area and later add a light to it, that light is left out automatically.
If an exclusion matches nothing in your targets, Home Assistant lists it under Exclusions with no effect, where you can remove it. Check that section after renaming areas or moving devices, because a stale exclusion is the usual sign something has changed.
Do groups work with exclude in Home Assistant?
It depends on the group type. Excluding a regular group excludes only the group entity, not its members, so exclude the members, their area or their label if you want them left alone.
Old-style groups, with entity IDs starting group., behave differently by context. In actions, the group, its members and any nested groups are all excluded. In triggers and conditions, only the group entity is excluded, so exclude the members separately.
Why is my excluded light still turning on or off?
The most common cause is that the light is reaching the automation through a second route. Another action or a different target in the same automation may name it directly, and an exclusion only applies to the targets in the trigger, condition or action where it is set.
Other causes: the exclusion uses a name where YAML needs an ID; the light belongs to a group excluded by the wrong group type (see above); or a different automation, scene or script is controlling it. Open the light's logbook entry to see which automation acted.
What to do next
Try replacing one existing long entity list with a floor target plus an exclusion, and compare the YAML. Shorter is the benefit; keep the automation readable. For blinds, the same pattern works with covers: see our blinds automation guide and exclude the bedroom from the morning open.







