Set mood
Use this action to apply one of the LIFX app’s Moods to one or more LIFX lights. A Mood is a named set of colors, and this action lays it out on each kind of light the same way the LIFX app does. The lights keep their current brightness, so a Mood changes the colors of a room without making it brighter or darker.
When you target several lights in one call, they are treated as one group, as they are in the LIFX app. Bulbs with a single color share the Mood’s colors out between them, instead of each one picking a color at random. The lights are turned on only if every target is off.
If you want Home Assistant’s own arrangement of a theme instead, with a transition and a choice of whether to turn the lights on, use the Paint theme action.
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 apply a Mood from an automation or a script:
- Go to Settings > Automations & scenes.
- Open an existing automation or script, or select Create automation > Create new automation.
- 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.
- In the Then do section, select Add action.
- From the search box, search for and select Set mood.
- Select what you want to control. Under By target (see Targets), pick the area your LIFX lights are in (like your living room or bedroom). You can also select a floor, a device, a specific entity, or a label.
- Pick a value in Mood.
- Select Save.
Options in the UI
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. For how an automation or a script is built in YAML, refer to Automations in YAML and Scripts.
In YAML, refer to this action as lifx.set_mood. A basic example looks like this:
action: lifx.set_mood
target:
entity_id: light.living_room
data:
mood: dream
This applies the dream Mood across the living room lights.
Options in YAML
The Mood to apply. Any of the available themes is accepted, including a renamed one, which applies the Mood it became.
Available Moods
Every theme the integration knows can be applied as a Mood. The Themes section of the LIFX integration page lists them by category. The Moods category holds the ones the LIFX app shows under Moods.
Targets of the action
This action requires a target. The target is the object of the action. You can point the action 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 will run 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 select different target types in one action. For example, you can add a specific entity and an area as targets in the same action to run the action on both of them at once.
To learn which entities Home Assistant includes for a device, area, floor, or label, and how it handles several entities, refer to Automation targets.
To leave out some of these entities, refer to Excluding targets. For example, you can leave out one light entity in an area.
Good to know
- This action works with every LIFX color light. White-only lights are skipped. When you target lights by entity and none of them is a LIFX light, the action fails with the message “The targets of action lifx.set_mood include no LIFX light”. When you target an area, floor, device, or label that holds no LIFX light, nothing happens and no error is returned.
- A Mood always covers the whole light. The separate uplight, downlight, front, and back entities of a LIFX Ceiling or Mirror can’t be targeted: target the light itself instead.
- On multizone and matrix lights, the Mood select shows the Mood afterwards, for as long as the light still shows it. Any change to the light, including a brightness change, clears it.
- Applying a Mood paints a still set of colors, so there is usually nothing to stop afterwards. The exception is a light already running an effect that animates Moods, as the LIFX app does:
- On a multizone light running the Move effect, the Mood is painted and Move carries on with it, moving forward at the LIFX app’s speed. The Mood select shows unknown while Move runs.
- On a matrix light running the Morph effect, the Mood is animated the way the LIFX app animates it, and the Mood select shows the Mood.
- To stop the animation, use the Stop effect action.
Try it yourself
Ready to test this? Open Settings > 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. In the visual editor, select the UI options listed in the example or paste the YAML code.
You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the visual 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.
Automation: apply a Mood in the living room at sunset
When the sun sets, apply the warming Mood to the living room lights, so the room shifts to an evening look at the brightness it already has.
- Trigger: Sunset
-
Action: Set mood
-
Target: Living room (
light.living_room) - Mood: Moods > Warming
-
Target: Living room (
alias: "Apply a warm Mood in the living room at sunset"
triggers:
- trigger: sun.sunset
actions:
- action: lifx.set_mood
target:
entity_id: light.living_room
data:
mood: warming
Automation: wind the bedroom down at bedtime
At 21:30, apply the sleepy Mood to every LIFX light in the bedroom. The bedside bulbs and the strip are treated as one group, so the bulbs share the Mood’s colors out between them instead of each showing the same one.
-
Trigger: Time
- At: 21:30
-
Action: Set mood
- Target: Bedroom area
- Mood: Moods > Sleepy
alias: "Apply a sleepy Mood in the bedroom at bedtime"
triggers:
- trigger: time
at: "21:30:00"
actions:
- action: lifx.set_mood
target:
area_id: bedroom
data:
mood: sleepy
Still stuck?
To test the action on its own, run it in the automation editor with Run action, and check the message that it shows. To see what the action did when the automation ran, open the trace of that run. For details, refer to Testing automations. For common problems and their solutions, refer to Troubleshooting automations.
If that doesn’t help, 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.
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
Explore related actions:
-
Paint theme: Paints either a provided theme or custom palette across one or more LIFX lights.
-
Morph effect: Start the firmware-based Morph effect on a matrix LIFX light, such as the LIFX Tile or Candle.
-
Move effect: Start the firmware-based Move effect on a multizone LIFX light, such as the LIFX Z, Lightstrip, or Beam.
-
Stop effect: Stop a running effect on LIFX lights.