Get it now:
Introduction:
The Smart Lux Dimmer can turn on or dim a light variably, based on the value of a light sensor:
Turn your lights on gradually when the sun goes down? Turn on your desk lamp when the office gets too dark, or turn lights off when there is enough light available. It’s all possible.
How it works:
Set maximum and minimum ambient light values between which the automation will run. The light will vary brightness between the settings at maximum and minimum light value based on the sensor reading.
Optional values can be set for the brightness, color or temperature when the ambient light goes outside of set measuring range.
Example 1: (BASIC)
- Max ambient: 400 lux (± sunset value)
- Min ambient: 0 lux (nighttime)
- Brightness at max ambient: 0%
- Brightness at min ambient: 100%
- No other options activated
→ The above example will start slowly turning up the light until full brightness when the ambient value drops from 400 to 0 (sunset to night).
Example 2: (ADVANCED)
- Condition: I am home
- Max ambient: 350 lux
- Min ambient: 50 lux
- Brightness at max ambient: 70%
- Brightness at min ambient: 40%
- Include values under min and over max: yes
- Brightness over max ambient: 0%
- Brightness under min ambient: 40%
- Include color or temperature values when outside range: Include color
- Color when ambient light value under min: [231,158,10] (warm orange)
→ This is how I use it in my office space.
It will turn on the light at 70% when the ambient light drops under 400 lux (for example when it’s cloudy outside during the day, or when the sun starts to set) and will actually dim the light down to 40% around late sunset-nighttime so that there is not too much light, which might cause eye fatigue.
When the ambient light goes over the maximum threshold, the light is turned off.
When it goes under the minimum it will remain at 40%, but will turn a warm orange color
Credits:
- This blueprint is based on the math of @nickrout in this post: Dim lights as lumens increases
- Second credit goes to Nick’s math teacher at 14.
- @123 for greatly simplifying the code for the day condition
- Added color and temperature settings based on issues detected by @headless
- A special thanks to @Hanske for helping with beta testing
Most important versions:
SMART LUX DIMMER VERSION 4.1 (ADVANCED)
Source code (Github)
See code changes (Github)
SMART LUX DIMMER VERSION 2.0 (BASIC)
Changelog:
07/01/2024 - Version 4.1
- Added a transition timer to smoothen out the dimming from the current brightness setting to the next
- General code correction for uniformity
- Spelling corrections
Open to see older changes.
18/12/2023 - Version 4.0:
- Combined all functions of previous versions into 1 Blueprint:
- Removed separate time and day conditions and added a condition selector instead (It’s pre-set with a ‘Time’ condition, but this can be removed if not needed)
- Added selector to activate color or temperature values for the light (only 1 at a time is allowed by the light.turn service) - ( Only works if the light entity supports color or temperature values! )
- Added boolean selector to activate brightness values outside of the measuring range
- Added selector to activate color or temperature values outside of the measuring range - ( Only works if the light entity supports color or temperature values! )
- General debugging of the code
- Modified names and descriptions to improve usability.
- The name of the blueprint has been updated to Smart Lux Dimmer
BREAKING
- I’ve created a new Github Gist to bring everything together. This means that a re-import in Home Assistant of the older versions will not work. You need to import the latest version (4.0 and up) to be able to use the re-import function and stay up-to-date.
22/11/2023
-
Released Version 2.3:
Added a conditions selector, so users can add their own conditions that prevent the automation from running. -
Released Version 3.3:
Added a conditions selector, so users can add their own conditions that prevent the automation from running.
18/11/2023
-
Split development in 2: Version 2.x and Version 3.x
(Both versions will be maintained (when I have the time), but since they focus on different use cases, they will be viewed a separate projects.) -
Released Version 2.2:
(removed light temperature adjustments. This was a breaking change a while ago where no color values and temperature values could be sent to the light.turn_on service at the same time.) -
Released Version 3.2 (BETA)
(Removed light temperature adjustments. This was a breaking change a while ago where no color values and temperature values could be sent to the light.turn_on service at the same time.)
10/01/2023 - Version 3.0( Known issues)
- BREAKING: Added feature to set light values when going over and under max and min measured light values.
Please download the newest version and recreate the automations if you experience issues.
09/01/2023 - Version 2.1 ( known issues)
- BREAKING: Added color and temperature settings for the light. These are fixed values and are not affected when the light changes brightness values.
Please download the newest version and recreate the automations if you experience issues.
28/03/2022 - Version 2.0 → !! LAST SIMPLE VERSION !!
- BREAKING: Updated brightness values to percentages to improve user experience.
This version is not compatible with older ones. If you experience issues, please download the latest release and recreate the automations.
22/03/2022 - Version 1.3
- Simplified the code for the day condition
22/03/2022 - Version 1.2
- BREAKING: Added day condition support.
Please download the newest version and recreate the automations if you experience issues.
21/03/2022 - Version 1.1
- BREAKING: Added start & stop time conditions
Please download the newest version and recreate the automations if you experience issues. - Added versioning
- Added source url
19/03/2021 - Version 1.0
- Original release