Using f.lux with Yeelights! First alpha release


#1

Hey guys,

I’m pretty new to coding in general but I recently started to get into Python. I have written a little script that automatically changes your Yeelight bulbs to f.lux display color.

If you don’t know what f.lux is, it’s a tool to darken your display in the evening/night smoothly to reduce strain on your eyes.

First alpha release on here: https://github.com/davidramiro/fluxee
Supports up to 5 lamps.
If anybody wants to test it and give feedback, I’d appreciate it!

Cheers,
David


F.lux behavior with Yeelight
#2

Awesome!

Are you interested to put your tool in the recommendation list of Yeelight app?


#3

Sure, that would be great!
Where can I find that list?


#4

I will PM you about the details.


#5

This is awesome. Waited for someone to develop this for a long time. Working pretty good.

You should include an installer which enables autostart.


#6

@lepathi Glad to hear you like it and thanks for the feedback! I will definitely try to include that.


#7

Don’t forget to think about a way to differentiate between a remote session to the PC and normal Usage. I don’t need my lights to turn on when I am accessing the PC through VPN from the school. Maybe check the “Turned-On”-Status of the lights and only apply settings when they are already turned on.


#8

Alright, for the installer and autostart I still have to read a bit and figure out how to do that.

For your status-check request: I personally want my script to turn the lights on so I will likely add an option in the config, something like “Only control bulbs that are already turned on”. So the script would theoretically do nothing if all lights are off, even when it’s on autostart. Or just control one light of 5 or similar.


#9

I am totally looking forward to see your results.
Take your time. :slightly_smiling_face:


#10

Awesome! Please continue developing.

“Only control bulbs that are already turned on”

This is a must have feature for me.

In the future it would be awesome to have something like this that is not dependent on a PC being turned on. Maybe a Raspberry Pi like solution that could control the lights. This way the PC could be off and the lights would still change.

Edit: Stupid me. F.lux already supports Linux! :slight_smile:


#11

Hi @coasterli ,

how can we see the recommendation list in the Yeelight app? on my app it is empty.


#12

Show me your empty page


#13

@coasterli


#14

I don’t get it… what does this f.lux app do? It only knows which time of day it is??? I maan, if you’re adjusting the bulbs with your script, what is f.lux needed for???


#15

No, it’s not just a clock.

So basically, new research shows that blue light at late hours can keep you awake and is bad for your sleep pattern and general health (see this article from Harvard Medical School). What f.lux does is adjust your display in the evening/sunset/night with a smooth transition to show less blue light. It looks like warm orange-red filter, because the blue subpixel are made darker.

Same with your Yeelights. If you have them at max brightness with 6500K, your lamp emits very much light of the blue wavelengths. By lowering color temperature, we reduce those. This script only synchronizes the two (optimally you shouldn’t use your computer in the night at all and you should put your lamps at red color for best sleep induction, but that’s not the point here).


#16

great work @davidr! I’m just waiting for it to show up on my recommendations list which is currently empty. Looking forward to trying it out since I’m already using f.lux on my macbook


#17

I understand the concept of blue light etc, I was just wondering what f.lux does that you can’t do directly with your scrip (get location, time zome, sunrise/sunset etc).


#18

Ah, I understand.

Well, I could write a script that basically does the same as f.lux - basically dim your lights depending on your timezone and corresponding sunset times. But the most important point of f.lux is that it dims your monitor, which is way too complex for me to write a script for. So I use the data f.lux provides to synchronize it with my Yeelights - nothing more.

I’ve been a f.lux user for years and in the evening I just turned my lights off when I didn’t have any smart lighting. Even a regular desk lamp can be detrimental to your sleep schedule. Now it’s all automated! :slight_smile:


#19

Thank you! From your screenshot I think you’re on the wrong menu though. It’s not built into the app, it’s just on the list for recommended apps under integration, see here. The script has nothing to do on your phone anyway, you need to run it on your computer.

On your phone you need to enable LAN control for the bulbs you want to control. For Mac OS, I cannot provide you with a tutorial as I use windows but it should work. Afaik it should have Python installed, so the fluxee.py file should work for you. But maybe you have toi install Python by yourself, it’s fairly easy to do. If you need any help, I can try and help you set it up.


#20

I thought Windows 10 has this already built in in some extent - there is “night light” option which sets blue to lower value at night.