mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-12 14:54:04 +02:00
Adaptive Lighting custom component for Home Assistant
https://adaptive-lighting.nijho.lt
- Python 99%
- Shell 0.6%
- Dockerfile 0.4%
The basis of Circadian Lighting is to figure out how to adjust lights to mimic the sun, which is roughly parabolic above and below the horizon. Originally I used three points to calculate the parabolas - sunrise, sunset, and solar noon/midnight. I did a bunch of generic arithmetic to generate the parabola from those three points. The problem is that this arithmetic generates a parabola from _any_ three points - in reality the points I have are the intercepts and vertex. The problem with the old method is that if solar noon/midnight did not fall exactly between sunrise and sunset then the calculated vertex could be more or less than 100%, which would cause the integration to set color/brightness values above or below the set min/max. Generating a parabola from the intercepts and vertex is much simpler and also should guarantee the min/max are what's expected. In addition to this change, I'm also now calculating 4 "half" parabolas instead of just one for above horizon and one for below horizon. The "half" parabolas are: sunrise->solar-noon, solar-noon->sunset, sunset->solar-midnight, solar-midnight->sunrise. This is necessary for the case where solar noon/midnight don't fall exactly half way between sunrise and sunset, which is especially prevalent for users who specify a specific time for sunrise or sunset but not both. I'm embarrassed at how it's been before it dawned on me that I could calculate the parabolas from intercepts/vertex rather than the three random points method, but hopefully this fixes inconsistencies for users - it should definitely fix issue #25! |
||
|---|---|---|
| custom_components/circadian_lighting | ||
| custom_updater.json | ||
| LICENSE | ||
| README.md | ||
Circadian Lighting [Home Assistant Component]
Stay healthier and sleep better by syncing your lights with natural daylight to maintain your circadian rhythm!
Circadian Lighting slowly synchronizes your color changing lights with the regular naturally occuring color temperature of the sky throughout the day. This gives your environment a more natural feel, with cooler hues during the midday and warmer tints near twilight and dawn.
In addition, Circadian Lighting can set your lights to a nice cool white at 1% in “Sleep” mode, which is far brighter than starlight but won’t reset your circadian rhythm or break down too much rhodopsin in your eyes.
Expand for articles explaining the benefits of maintaining a natural Circadian rhythm
- Circadian Rhythms - National Institute of General Medical Sciences
- Circadian Rhythms Linked to Aging and Well-Being | Psychology Today
- Maintaining a daily rhythm is important for mental health, study suggests - CNN
- How Nobel Winning Circadian Rhythm Research Benefits Pregnancy
- Body Clock & Sleep - National Sleep Foundation
- How our body’s circadian clocks affect our health beyond sleep
Visit the Wiki for more information.
Basic Installation/Configuration Instructions:
Installation:
Install custom_component files automatically using Custom Updater or Manually.
Component Configuration:
# Example configuration.yaml entry
circadian_lighting:
Switch Configuration:
# Example configuration.yaml entry
switch:
- platform: circadian_lighting
lights_ct:
- light.desk
- light.lamp
Switch configuration variables:
- name (Optional): The name to use when displaying this switch.
- lights_ct (Optional): array: List of light entities which should be set in mireds.
- lights_rgb (Optional): array: List of light entities which should be set in RGB.
- lights_xy (Optional): array: List of light entities which should be set in XY.
- lights_brightness (Optional): array: List of light entities which should only have brightness adjusted.
Graphs!
These graphs were generated using the values calculated by the Circadian Lighting sensor/switch(es).
