You are not logged in.

#1 2022-02-07 21:04:30

CBX
Member
Registered: 2022-02-07
Posts: 3

[SOLVED] Control display brightness based on environment brightness

I am using KDE Plasma on a desktop computer with an external monitor and am able to manually control the display brightness through Plasma's settings and widgets (ddcutil / powerdevil). This works fine and all.
What I am asking you is if you know of any way to automatically control display brightness based on local environmental brightness. My desktop monitor does not have a brightness sensor therefore I cannot query that.

I would not be afraid of coding a solution myself, but up until now I have not found publically available brightness data - weather services typically only publish temperature, wind, humidity and so on. For a general solution this would also require a sufficient worldwide coverage. But maybe I am getting way ahead of myself and such a solution already exists and I just havent found it yet.

Can you help? Thanks a lot!

Last edited by CBX (2022-02-08 14:19:46)

Offline

#2 2022-02-08 05:28:45

ishaanbhimwal
Member
Registered: 2022-01-21
Posts: 48
Website

Re: [SOLVED] Control display brightness based on environment brightness

What you are talking about in called Ambient lighting. You can achieve this with the help of internal/external webcam. See https://forum.manjaro.org/t/ambient-lig … aanbhimwal.

Offline

#3 2022-02-08 07:42:03

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,311

Re: [SOLVED] Control display brightness based on environment brightness

How finegrained do you need this?
Eg. I switch between light and dark colors based on redshifts calculated color temperature (which is calculated from time of day and year, so it knows whether it's dusk,day,dawn,night - but of course not the environment light when you flip on 10 1000lm lamps ;-)

Offline

#4 2022-02-08 12:16:45

CBX
Member
Registered: 2022-02-07
Posts: 3

Re: [SOLVED] Control display brightness based on environment brightness

ishaanbhimwal wrote:

What you are talking about in called Ambient lighting. You can achieve this with the help of internal/external webcam. See https://forum.manjaro.org/t/ambient-lig … aanbhimwal.

Thank you for this hint, I had something similar in mind. I will look into it and see if I can solve my problem.

seth wrote:

How finegrained do you need this?
Eg. I switch between light and dark colors based on redshifts calculated color temperature (which is calculated from time of day and year, so it knows whether it's dusk,day,dawn,night - but of course not the environment light when you flip on 10 1000lm lamps ;-)

In my naive mind, I imagined my desktop display to adapt to the ambiance light (e.g. mean ambiance light excluding direct light sources like the sun), disregarding time of day / sunrise / sundown / light situation in my room. I am sure that oftentimes it is sufficient to use these metrics to calculate an appropriate screen brightness, but I want to factor in things like cloudy days, changing ambiance brightness throughout the day...

As ishaanbhimwal has already shown, I could use a light sensor - or a webcam - to determine ambiance brightness on my own and then control my display brightness using clight or some other tool. Maybe one could combine this with publicly available ambiance brightness data and therefore make private local sensors obsolete? If someone knows of such a source, I would be very happy to know about it!

Offline

#5 2022-02-08 12:28:36

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,311

Re: [SOLVED] Control display brightness based on environment brightness

I'm not sure how you envision public data reg. your local light conditions - you'll have to use some sensor - you can grab the local weather conditions from eg. accuweather, but that tell you nothing about any indoors conditions (blinds, window direction, ...)

Offline

#6 2022-02-08 14:17:14

CBX
Member
Registered: 2022-02-07
Posts: 3

Re: [SOLVED] Control display brightness based on environment brightness

Thank you for your valuable replies. There are many public (even foss) data sources that cover lots of interesting weather and air quality metrics, but unfortunately the vast majority does not cover light condition.

TL;DR for everyone else:
To control a monitors' brightness depending on your local weather and therefore environment light conditions, we have identified the following viable option:
* use clight in conjunction with a webcam or light sensor to adaptively control display brightness

I have decided to order a light sensor from a well-known chinese smart home brand. I will hook up the sensor to my homeassistant instance, and - using a simple script that I will have to write - will query the home assistant data of that sensor periodically and set the brightness accordingly using ddcutil. When I am done with all that, I will publish the script in this thread for all of you to use.

Offline

Board footer

Powered by FluxBB