Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 2.57 KB

NightlightDetection.md

File metadata and controls

37 lines (22 loc) · 2.57 KB

How does Adrilight detect the nightlight state of Windows?

Windows has no API to explicitly ask it about the night light state. At least the Internet does not know one.

Depending on your version of Windows, it stores the current state of the night light in the registry either in:

older Windows 10 editons:
\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\$$windows.data.bluelightreduction.bluelightreductionstate\Current

new Windows 10 editions:
Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\DefaultAccount\Current\default$windows.data.bluelightreduction.bluelightreductionstate\windows.data.bluelightreduction.bluelightreductionstate

Either way, this is a huge blob of bytes without any description for decoding it. It may be some kind of a compressed format because even the number of bytes differs a lot.

Adrilight uses ML.net to solve it

I compiled a list of observed values with the known state. I used ML.net to train a model and eventually got it working.

If you select Auto Detect mode for alternate white balance, adrilight reads the registry values every other second and lets the ML.net model predict the state. This works very well on my test machines, but the data itself are from these machines as well.

If it does NOT work

Quick fix

Choose one of the other two modes of Forced On or Forced Off.

Provide sample data to smarten up adrilight!

To let adrilight improve over time, more data is needed. If you observe adrilight not correctly detecting the current state of the night light (this can very well be only once!) you should provide the data to the project so we can train the model on them as well to make the next adrilight version even smarter.

What you need to do:

  1. Find the adrilight.log.nightlight.yyyyMMdd.txt log file(s). Look in the folder %localappdata%\adrilightApp\app-2.0.9\logs or the highest version number you have. The real path may look like c:\Users\fancyUsername\AppData\Local\adrilightApp\app-2.0.9\logs.
  2. Open up an issue on adrilight and upload this file as well (drag and drop on the text field works!)
  3. It is essential that you provide information whether the night light was ON or OFF when the detection failed.