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.
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.
Choose one of the other two modes of Forced On
or Forced Off
.
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:
- 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 likec:\Users\fancyUsername\AppData\Local\adrilightApp\app-2.0.9\logs
. - Open up an issue on adrilight and upload this file as well (drag and drop on the text field works!)
- It is essential that you provide information whether the night light was ON or OFF when the detection failed.