"Sun tunnel" lighting, have indoor lights match outdoors?

Search has been fruitless but I can’t believe I’m the first to try this: I have a dark room I’m trying to make feel more naturally lit during the day (basically the digital equivalent of a “sun tunnel”). I have a hue light strip, the goal is to have the strip:

  • Auto-adjust brightness based on outdoor brightness
  • Auto-adjust color temperature based on time of day

The reason adaptive lighting isn’t enough on it’s own is because on cloudy/darker days it still goes full-bore with the brightness which feels artificial.

I’ve got "illuminance sensor" (which apparently incorporates weather data) installed and “working”, but it outputs a “lx” reading (0-12,000), and I need to translate that somehow to brightness (1-255) before I can have it match brightness.

  • 255 brightness if over 9k Lux
  • Otherwise, adjust one “brightness” for every X Lx units, down to zero.

Any ideas?

You could use an ESP with a color sensor pointed at the outside sky, which would give you RGB values that can be processed and sent to the light.
You could for example use this: TCS34725 RGB Color Sensor — ESPHome

1 Like

Well, as a template you could work the maths so that 9,000 / X = 255, and then it will scale linearly.

Call X 35.29 and you’ll be close enough, and use a max of 255:

{{ min(states('sensor.light_level')|float(9000)/35.29,255) }}

Thanks, this is the part that’s beyond me (the programming, not the math). Where could I put this? In the “brightness” section of a script?

Yes, something like:

- service: light.turn_on
  data:
    entity_id: light.petunia
    brightness: "{{ min(states('sensor.light_level')|float(9000)/35.29,255) }}"

This was perfect, thanks!