Turn off a light

The Turn off action turns a light off. You can switch it off instantly, add a transition so it fades out smoothly, or ask it to flash briefly before going dark.

This action works with any light entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] in Home Assistant, whether it’s a single bulb, a group of lights, or a smart fixture. If the light is already off, calling the action does nothing.

Using this action from the user interface

If you prefer building automations and scripts visually, Home Assistant walks you through this action step by step. You pick what to target, tweak a few options, and save. No YAML knowledge required.

To turn a light off from an automation or a script:

  1. Go to Settings > Automations & scenes.
  2. Open an existing automation or script, or select Create to start a new one.
  3. If you’re setting up a new automation, add a trigger in the When section. Scripts don’t need a trigger. They run when something else calls them.
  4. In the Then do section, select Add action.
  5. From the search box, search for and select Light: Turn off.
  6. Under Targets, choose what you want to turn off:
    • To turn off a specific light, select the entity.
    • To turn off every light in a room, select an area.
    • To turn off every light on a floor, select a floor.
    • To turn off lights sharing a tag, select a label.
  7. Optional: under Advanced options, set a transition or a flash effect.
  8. Select Save.

Options in the UI

Transition (Optional)

How long, in seconds, it takes to fade the light out. Use this for a smooth fade instead of switching off instantly.

Flash (Optional)

Ask the light to flash briefly before it turns off, either short or long. Useful as a visual notification.

Using this action in YAML

If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required.

In YAML, refer to this action as light.turn_off. A basic example looks like this:

ActionActions are used in several places in Home Assistant. As part of a script or automation, actions define what is going to happen once a trigger is activated. In scripts, an action is called *sequence*. [Learn more]
action: light.turn_off
target:
  entity_id: light.kitchen

This turns off light.kitchen.

Options in YAML

YAML sometimes provides additional options for more complex use cases that are not available through the UI.

transition integer

Duration, in seconds, it takes to fade the light out. Use this to dim down smoothly instead of switching off instantly.

flash string

Tell the light to flash briefly before turning off. Accepts either short or long.

Targets

This action supports targets. A target tells Home Assistant what the action should act on. You can point it at a single entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more], a device, an area, a floor, or a label, and Home Assistant runs the action on every matching light entity behind that target.

  • Entity: one specific light entity, such as light.living_room.
  • Device: every light entity that belongs to a device.
  • Area: every light entity in a room or area.
  • Floor: every light entity on a floor.
  • Label: every light entity that shares a label.

You can also mix target types in one call. For example, combine a specific entity with an area to run the action on both at once.

Good to know

  • The Turn off action works on any light entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more], such as bulbs, groups, fixtures, or strips.
  • If the light is already off, calling this action does nothing.
  • Not every light supports a transition or a flash. Home Assistant quietly skips options the device can’t handle.
  • To reverse this action, use Turn on a light. To flip a light between on and off with a single call, use Toggle a light.

Try it yourself

Ready to test this? Open Developer tools > Actions, search for this action, fill in the fields, and select Perform action. You see what happens on your actual entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] without writing a line of YAML.

More examples

Real scenarios where this action shows up in automations and scripts. Copy any example and adapt it to your setup.

Tip

You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.

Action: fade out gently at the end of movie night

Fade the bedroom light out over five seconds, which is a much nicer way to end a movie than an instant off.

  • Action: Light: Turn off
  • Target: Bedroom light
  • Transition: 5 seconds
YAML example for a gentle fade-out
ActionActions are used in several places in Home Assistant. As part of a script or automation, actions define what is going to happen once a trigger is activated. In scripts, an action is called *sequence*. [Learn more]
action: light.turn_off
target:
  entity_id: light.bedroom
data:
  transition: 5

Action: turn off every light on a floor

Target a floor instead of a specific entity and Home Assistant resolves it to every light on that floor.

  • Action: Light: Turn off
  • Target: Ground floor
YAML example for turning off every light on a floor
ActionActions are used in several places in Home Assistant. As part of a script or automation, actions define what is going to happen once a trigger is activated. In scripts, an action is called *sequence*. [Learn more]
action: light.turn_off
target:
  floor_id: ground_floor

Automation: porch light off at sunrise

Turn the porch light off automatically as the sun comes up. No more wasted electricity after you’ve already gone to bed or left for work.

  • Trigger: Sun: Above horizon
  • Action: Light: Turn off
  • Target: Porch light
YAML example for a sunrise porch light off
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Porch light off at sunrise"
triggers:
  - trigger: sun
    event: sunrise
actions:
  - action: light.turn_off
    target:
      entity_id: light.porch

Automation: turn every light off when the house is empty

When the last person leaves home, turn off every light in the house. A simple way to save energy without having to think about it.

  • Trigger: Zone: Everyone leaves home
  • Action: Light: Turn off
  • Target: All lights (by label)
YAML example for turning off all lights when nobody is home
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Lights off when everyone leaves"
triggers:
  - trigger: zone
    entity_id: person.paulus
    zone: zone.home
    event: leave
conditions:
  - condition: state
    entity_id: group.family
    state: not_home
actions:
  - action: light.turn_off
    target:
      label_id: all_lights

Automation: bedtime fade-out

At 11 in the evening, fade every light in the living room out over ten seconds. A calmer way to end the day than flipping a switch.

  • Trigger: Time: 23:00
  • Action: Light: Turn off
  • Target: Living room
  • Transition: 10 seconds
YAML example for a bedtime fade-out
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Bedtime fade-out"
triggers:
  - trigger: time
    at: "23:00:00"
actions:
  - action: light.turn_off
    target:
      area_id: living_room
    data:
      transition: 10

Still stuck?

The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the action you’re calling and what you expected to happen, or share on our subreddit /r/homeassistant.

Tip

AI assistants like ChatGPT or Claude can also explain actions or suggest the right one when you describe what you want in plain language.

Related actions

These actions work well alongside this one:

  • Turn on a light - Turn a light on. Optionally set brightness, color, color temperature, an effect, or a transition.

  • Toggle a light - Flip a light between on and off. If it’s off, it turns on. If it’s on, it turns off.