This is an automated archive made by the Lemmit Bot.
The original was posted on /r/homeassistant by /u/Fragrant-Coast5355 on 2026-07-01 16:45:56+00:00.
Full docs for Ambience. Github Repo: https://clintongormley.github.io/ambience/
It all started with me wanting automations to fade my lights on and off, but for the lights to react immediately when switched on at the wall. (Most Shelly relays that I have don't support the transition parameter in the light.turn_on action.)
That resulted in Fado Light Fader. (Read more here)
Then, I wanted to make my automations more sophisticated, taking into account conditions like the time of day, the weather, whether somebody was asleep in the bedroom next to the bathroom I'm entering, etc.
Things got complicated quickly...
Home Assistant scenes let you define the state that you want to achieve, but not how to achieve it (meaning I couldn't use Fado to fade my lights). They're also verbose and difficult to read. Automations are amazingly powerful, but they are similarly verbose, complicated, and can be difficult to debug, especially when they're big and complex.
Also, they're trigger based. "Turn on the lights when somebody walks into the room", but what happens if the weather changes while somebody is already in the room?
Ambience is different.
Think about the scenes you want to implement, and under what conditions each scene should match:
| Conditions | Device state | |
|
| | Watch movie on projector | Lights fade off, except side-table lights at 10% | | The room is vacant for at least 1 minute. | Lights fade off | | The room is occupied during the day, when it is sunny | Lights fade to 60% | | The room is occupied during the day, when it is cloudy | Lights fade to 70% | | The room is occupied during the nighttime | Lights fade to 25% |
These scenes form a scene group, a collection of conditions and actions relating to devices in the same area (Lounge) and of the same category (Lights). The scenes are automatically sorted by priority and specificity (with manual overrides supported), and a list of relevant triggers are automatically extracted from the conditions. When any trigger fires, the conditions for each scene are evaluated scene by scene. The first scene that matches wins.
Two important points:
- There can only be one winner, so you never have the problem of automations fighting with each other.
- If the conditions for scene 1 fail to match, then you don't need to retest those same conditions for scene 2. So if "the room is vacant" is false in the first scene, then we can assume that the room is occupied for the other scenes.
This makes it possible to build sophisticated logic using quite small, understandable building blocks. Here's what the above scene group looks like:
Scenes to handle lighting in the lounge
And you can expand them to see all of the details, but still in a summarised form which makes them easy to read and to compare with each other.
Details of the "Watch projector" scene
Tracing
The details of the five most recent executions can be viewed to determine which scene won and why the other scenes failed to match.
Trace view explaining why a particular scene won
Simulator
You can even use the simulator to change the current conditions (e.g. time or weather) to see if your conditions are working as you expected.
Simulate conditions to understand how scenes win
Pause Button
And sometimes you just want to stop automations and take control of the room you're in. Ambience creates a switch for each room which can be added to dashboards or exposed to voice assistants, so "Hey Google, turn off Ambience" is enough to pause your automations until you turn them back on, or until a configurable timer elapses.
Pause button pressed on the Lounge scenes in Ambience
Ambience is a custom integration available via HACS. I'd love you to try it out and if you have any good ideas for ways to make it better, please open an issue on https://clintongormley.github.io/ambience/